Second update pass (2/3) - 82 -> 0 errors

Second update pass which fixes all compile errors. Some parts may have
aftermath effect, hence why 3rd pass will check those maked with
"aftermath".
Errors: 82 -> 0. Mod can be launched.
This commit is contained in:
elix-x
2016-06-21 11:03:10 +02:00
parent 5498eb6d7c
commit 05aa6972c4
83 changed files with 564 additions and 405 deletions
+5 -5
View File
@@ -70,12 +70,12 @@ public final class AppEng
public static final String ASSETS = "appliedenergistics2:";
public static final String MOD_DEPENDENCIES =
// a few mods, AE should load after, probably.
// required-after:AppliedEnergistics2API|all;
// "after:gregtech_addon;after:Mekanism;after:IC2;after:ThermalExpansion;after:BuildCraft|Core;" +
// a few mods, AE should load after, probably.
// required-after:AppliedEnergistics2API|all;
// "after:gregtech_addon;after:Mekanism;after:IC2;after:ThermalExpansion;after:BuildCraft|Core;" +
// depend on version of forge used for build.
"after:appliedenergistics2-core;" + "required-after:Forge@[" // require forge.
// depend on version of forge used for build.
"after:appliedenergistics2-core;" + "required-after:Forge@[" // require forge.
+ net.minecraftforge.common.ForgeVersion.majorVersion + '.' // majorVersion
+ net.minecraftforge.common.ForgeVersion.minorVersion + '.' // minorVersion
+ net.minecraftforge.common.ForgeVersion.revisionVersion + '.' // revisionVersion
+5 -5
View File
@@ -25,8 +25,9 @@ import java.util.regex.Matcher;
import java.util.regex.Pattern;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.common.config.Configuration;
import net.minecraftforge.fml.common.registry.GameRegistry;
public class FacadeConfig extends Configuration
@@ -48,8 +49,7 @@ public class FacadeConfig extends Configuration
return false;
}
//TODO 1.9.4 - UniqueIdentifier => ResourceLocation ???
final UniqueIdentifier blk = GameRegistry.findUniqueIdentifierFor( id );
final ResourceLocation blk = Item.REGISTRY.getNameForObject( Item.getItemFromBlock( id ) );
if( blk == null )
{
for( final Field f : Block.class.getFields() )
@@ -69,8 +69,8 @@ public class FacadeConfig extends Configuration
}
else
{
final Matcher mod = this.replacementPattern.matcher( blk.modId );
final Matcher name = this.replacementPattern.matcher( blk.name );
final Matcher mod = this.replacementPattern.matcher( blk.getResourceDomain() );
final Matcher name = this.replacementPattern.matcher( blk.getResourcePath() );
return this.get( mod.replaceAll( "" ), name.replaceAll( "" ) + ( metadata == 0 ? "" : "." + metadata ), automatic ).getBoolean( automatic );
}
+18 -24
View File
@@ -20,6 +20,8 @@ package appeng.core;
import java.io.File;
import java.util.HashSet;
import java.util.Set;
import javax.annotation.Nonnull;
@@ -46,7 +48,6 @@ import appeng.api.config.Upgrades;
import appeng.api.definitions.IBlocks;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IItems;
import appeng.api.definitions.IMaterials;
import appeng.api.definitions.IParts;
import appeng.api.features.IRecipeHandlerRegistry;
import appeng.api.features.IRegistryContainer;
@@ -74,6 +75,7 @@ import appeng.core.localization.PlayerMessages;
import appeng.core.stats.PlayerStatsRegistration;
import appeng.hooks.TickHandler;
import appeng.items.materials.MultiItem;
import appeng.loot.ChestLoot;
import appeng.me.cache.CraftingGridCache;
import appeng.me.cache.EnergyGridCache;
import appeng.me.cache.GridStorageCache;
@@ -198,14 +200,19 @@ public final class Registration
if( config.storageProviderID == -1 && force )
{
final Set<Integer> ids = new HashSet<>();
for( DimensionType type : DimensionType.values() )
{
ids.add( type.getId() );
}
config.storageProviderID = -11;
//TODO 1.9.4 - Storage provider ids aren't stored anywhere, so no way to find free one. Do something with this!
while( DimensionManager.isDimensionRegistered( config.storageProviderID ) )
while( ids.contains( config.storageProviderID ) )
{
config.storageProviderID--;
}
storageDimensionType = DimensionType.register( "Storage Cell", "_cell", config.storageProviderID, StorageWorldProvider.class, false );
config.save();
@@ -278,9 +285,13 @@ public final class Registration
FMLCommonHandler.instance().bus().register( TickHandler.INSTANCE );
MinecraftForge.EVENT_BUS.register( TickHandler.INSTANCE );
final PartPlacement pp = new PartPlacement();
MinecraftForge.EVENT_BUS.register( pp );
FMLCommonHandler.instance().bus().register( pp );
MinecraftForge.EVENT_BUS.register( new PartPlacement() );
if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
{
MinecraftForge.EVENT_BUS.register( new ChestLoot() );
}
final IGridCacheRegistry gcr = registries.gridCache();
gcr.registerGridCache( ITickManager.class, TickManagerCache.class );
@@ -417,23 +428,6 @@ public final class Registration
registries.wireless().registerWirelessHandler( (IWirelessTermHandler) wirelessTerminalItem );
}
if( AEConfig.instance.isFeatureEnabled( AEFeature.ChestLoot ) )
{
//TODO 1.9.4 - Chest Gen => Loot Tables
final ChestGenHooks d = ChestGenHooks.getInfo( ChestGenHooks.MINESHAFT_CORRIDOR );
final IMaterials materials = definitions.materials();
for( final ItemStack crystal : materials.certusQuartzCrystal().maybeStack( 1 ).asSet() )
{
d.addItem( new WeightedRandomChestContent( crystal, 1, 4, 2 ) );
}
for( final ItemStack dust : materials.certusQuartzDust().maybeStack( 1 ).asSet() )
{
d.addItem( new WeightedRandomChestContent( dust, 1, 4, 2 ) );
}
}
// add villager trading to black smiths for a few basic materials
if( AEConfig.instance.isFeatureEnabled( AEFeature.VillagerTrading ) )
{
+3 -2
View File
@@ -44,6 +44,7 @@ import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
@@ -338,9 +339,9 @@ public class ApiPart implements IPartHelper
}
@Override
public boolean placeBus( final ItemStack is, final BlockPos pos, final EnumFacing side, final EntityPlayer player, final World w )
public boolean placeBus( final ItemStack is, final BlockPos pos, final EnumFacing side, final EntityPlayer player, final EnumHand hand, final World w )
{
return PartPlacement.place( is, pos, side, player, w, PartPlacement.PlaceType.PLACE_ITEM, 0 );
return PartPlacement.place( is, pos, side, player, hand, w, PartPlacement.PlaceType.PLACE_ITEM, 0 );
}
@Override
@@ -25,6 +25,7 @@ import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import appeng.api.AEApi;
@@ -44,10 +45,11 @@ public class PacketClick extends AppEngPacket
private final int x;
private final int y;
private final int z;
private final int side;
private EnumFacing side;
private final float hitX;
private final float hitY;
private final float hitZ;
private EnumHand hand;
// automatic.
public PacketClick( final ByteBuf stream )
@@ -55,14 +57,15 @@ public class PacketClick extends AppEngPacket
this.x = stream.readInt();
this.y = stream.readInt();
this.z = stream.readInt();
this.side = stream.readInt();
this.side = EnumFacing.values()[ stream.readByte() ];
this.hitX = stream.readFloat();
this.hitY = stream.readFloat();
this.hitZ = stream.readFloat();
this.hand = EnumHand.values()[ stream.readByte() ];
}
// api
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ )
public PacketClick( final BlockPos pos, final EnumFacing side, final float hitX, final float hitY, final float hitZ, final EnumHand hand )
{
final ByteBuf data = Unpooled.buffer();
@@ -71,10 +74,11 @@ public class PacketClick extends AppEngPacket
data.writeInt( this.x = pos.getX() );
data.writeInt( this.y = pos.getY() );
data.writeInt( this.z = pos.getZ() );
data.writeInt( this.side = side.ordinal() );
data.writeByte( side.ordinal() );
data.writeFloat( this.hitX = hitX );
data.writeFloat( this.hitY = hitY );
data.writeFloat( this.hitZ = hitZ );
data.writeByte( hand.ordinal() );
this.configureWrite( data );
}
@@ -92,7 +96,7 @@ public class PacketClick extends AppEngPacket
if( is.getItem() instanceof ToolNetworkTool )
{
final ToolNetworkTool tnt = (ToolNetworkTool) is.getItem();
tnt.serverSideToolLogic( is, player, player.worldObj, new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.side], this.hitX, this.hitY, this.hitZ );
tnt.serverSideToolLogic( is, player, this.hand, player.worldObj, new BlockPos( this.x, this.y, this.z ), this.side, this.hitX, this.hitY, this.hitZ );
}
else if( maybeMemoryCard.isSameAs( is ) )
@@ -41,8 +41,8 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
import appeng.api.storage.data.IAEItemStack;
import appeng.client.gui.implementations.GuICraftingCPU;
import appeng.client.gui.implementations.GuiCraftConfirm;
import appeng.client.gui.implementations.GuiCraftingCPU;
import appeng.client.gui.implementations.GuiMEMonitorable;
import appeng.client.gui.implementations.GuiNetworkStatus;
import appeng.core.AELog;
@@ -154,9 +154,9 @@ public class PacketMEInventoryUpdate extends AppEngPacket
( (GuiCraftConfirm) gs ).postUpdate( this.list, this.ref );
}
if( gs instanceof GuICraftingCPU )
if( gs instanceof GuiCraftingCPU )
{
( (GuICraftingCPU) gs ).postUpdate( this.list, this.ref );
( (GuiCraftingCPU) gs ).postUpdate( this.list, this.ref );
}
if( gs instanceof GuiMEMonitorable )
@@ -25,6 +25,7 @@ import io.netty.buffer.Unpooled;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import appeng.core.CommonHelper;
@@ -41,6 +42,7 @@ public class PacketPartPlacement extends AppEngPacket
private int z;
private int face;
private float eyeHeight;
private EnumHand hand;
// automatic.
public PacketPartPlacement( final ByteBuf stream )
@@ -50,10 +52,11 @@ public class PacketPartPlacement extends AppEngPacket
this.z = stream.readInt();
this.face = stream.readByte();
this.eyeHeight = stream.readFloat();
this.hand = EnumHand.values()[ stream.readByte() ];
}
// api
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight )
public PacketPartPlacement( final BlockPos pos, final EnumFacing face, final float eyeHeight, final EnumHand hand )
{
final ByteBuf data = Unpooled.buffer();
@@ -63,6 +66,7 @@ public class PacketPartPlacement extends AppEngPacket
data.writeInt( pos.getZ() );
data.writeByte( face.ordinal() );
data.writeFloat( eyeHeight );
data.writeByte( hand.ordinal() );
this.configureWrite( data );
}
@@ -73,8 +77,7 @@ public class PacketPartPlacement extends AppEngPacket
final EntityPlayerMP sender = (EntityPlayerMP) player;
CommonHelper.proxy.updateRenderMode( sender );
PartPlacement.setEyeHeight( this.eyeHeight );
//TODO 1.9.4 - 2 hands! Just do something!
PartPlacement.place( sender.getHeldItem(), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.face], sender, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
PartPlacement.place( sender.getHeldItem( hand ), new BlockPos( this.x, this.y, this.z ), EnumFacing.VALUES[this.face], sender, hand, sender.worldObj, PartPlacement.PlaceType.INTERACT_FIRST_PASS, 0 );
CommonHelper.proxy.updateRenderMode( null );
}
}
@@ -33,12 +33,13 @@ import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import appeng.api.config.FuzzyMode;
import appeng.api.config.Settings;
import appeng.api.util.IConfigManager;
import appeng.api.util.IConfigurableObject;
import appeng.client.gui.implementations.GuICraftingCPU;
import appeng.client.gui.implementations.GuiCraftingCPU;
import appeng.container.AEBaseContainer;
import appeng.container.implementations.ContainerCellWorkbench;
import appeng.container.implementations.ContainerCraftConfirm;
@@ -97,10 +98,23 @@ public class PacketValueConfig extends AppEngPacket
{
final Container c = player.openContainer;
//TODO 1.9.4 - 2 hands! Just do something!
if( this.Name.equals( "Item" ) && player.getHeldItem() != null && player.getHeldItem().getItem() instanceof IMouseWheelItem )
if( this.Name.equals( "Item" ) && ( ( player.getHeldItem( EnumHand.MAIN_HAND ) != null && player.getHeldItem(EnumHand.MAIN_HAND).getItem() instanceof IMouseWheelItem ) || ( player.getHeldItem( EnumHand.OFF_HAND ) != null && player.getHeldItem(EnumHand.OFF_HAND).getItem() instanceof IMouseWheelItem ) ) )
{
final ItemStack is = player.getHeldItem();
final EnumHand hand;
if( player.getHeldItem( EnumHand.MAIN_HAND ) != null && player.getHeldItem( EnumHand.MAIN_HAND ).getItem() instanceof IMouseWheelItem )
{
hand = EnumHand.MAIN_HAND;
}
else if( player.getHeldItem( EnumHand.OFF_HAND ) != null && player.getHeldItem( EnumHand.OFF_HAND ).getItem() instanceof IMouseWheelItem )
{
hand = EnumHand.OFF_HAND;
}
else
{
return;
}
final ItemStack is = player.getHeldItem( hand );
final IMouseWheelItem si = (IMouseWheelItem) is.getItem();
si.onWheel( is, this.Value.equals( "WheelUp" ) );
}
@@ -250,9 +264,9 @@ public class PacketValueConfig extends AppEngPacket
else if( this.Name.equals( "CraftingStatus" ) && this.Value.equals( "Clear" ) )
{
final GuiScreen gs = Minecraft.getMinecraft().currentScreen;
if( gs instanceof GuICraftingCPU )
if( gs instanceof GuiCraftingCPU )
{
( (GuICraftingCPU) gs ).clearItems();
( (GuiCraftingCPU) gs ).clearItems();
}
}
else if( c instanceof IConfigurableObject )