First update pass (1/3) - ~1400 -> 82 errors

This is first update pass, which is mainly import reorganization, name
fixes, etc... Although some parts of second were done where changes
aren't important.
Errors: ~1400 -> 82.
This commit is contained in:
elix-x
2016-06-19 14:43:27 +02:00
parent d9725a7d9b
commit 5498eb6d7c
288 changed files with 1637 additions and 1420 deletions
@@ -33,7 +33,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
@@ -438,13 +438,13 @@ public abstract class AEBaseContainer extends Container
if( Platform.isServer() )
{
for( final Object crafter : this.crafters )
for( final Object crafter : this.listeners )
{
final ICrafting icrafting = (ICrafting) crafter;
final IContainerListener IContainerListener = (IContainerListener) crafter;
for( final SyncData sd : this.syncData.values() )
{
sd.tick( icrafting );
sd.tick( IContainerListener );
}
}
}
@@ -20,7 +20,7 @@ package appeng.container;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import appeng.api.parts.IPart;
@@ -24,7 +24,7 @@ import java.lang.reflect.Field;
import java.util.EnumSet;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import appeng.container.AEBaseContainer;
import appeng.core.AELog;
@@ -54,7 +54,7 @@ public class SyncData
return this.channel;
}
public void tick( final ICrafting c )
public void tick( final IContainerListener c )
{
try
{
@@ -82,7 +82,7 @@ public class SyncData
}
}
private void send( final ICrafting o, final Object val ) throws IOException
private void send( final IContainerListener o, final Object val ) throws IOException
{
if( val instanceof String )
{
@@ -24,10 +24,10 @@ import java.util.Iterator;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.text.ITextComponent;
import appeng.api.AEApi;
import appeng.api.config.CopyMode;
@@ -151,9 +151,9 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
this.setValidContainer( false );
}
for( final Object crafter : this.crafters )
for( final Object crafter : this.listeners )
{
final ICrafting icrafting = (ICrafting) crafter;
final IContainerListener IContainerListener = (IContainerListener) crafter;
if( this.prevStack != is )
{
@@ -163,10 +163,10 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
if( s instanceof OptionalSlotRestrictedInput )
{
final OptionalSlotRestrictedInput sri = (OptionalSlotRestrictedInput) s;
icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() );
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
}
}
( (EntityPlayerMP) icrafting ).isChangingQuantityOnly = false;
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
}
}
@@ -352,7 +352,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
@Override
public IChatComponent getDisplayName()
public ITextComponent getDisplayName()
{
return null;
}
@@ -31,9 +31,9 @@ import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
import appeng.api.AEApi;
@@ -259,7 +259,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
}
}
for( final Object g : this.crafters )
for( final Object g : this.listeners )
{
if( g instanceof EntityPlayer )
{
@@ -279,7 +279,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
}
catch( final Throwable e )
{
this.getPlayerInv().player.addChatMessage( new ChatComponentText( "Error: " + e.toString() ) );
this.getPlayerInv().player.addChatMessage( new TextComponentString( "Error: " + e.toString() ) );
AELog.debug( e );
this.setValidContainer( false );
this.result = null;
@@ -365,8 +365,9 @@ public class ContainerCraftConfirm extends AEBaseContainer
return new PlayerSource( this.getPlayerInv().player, (IActionHost) this.getTarget() );
}
//TODO 1.9.4 - removeCraftingFromCrafters => ?
@Override
public void removeCraftingFromCrafters( final ICrafting c )
public void removeCraftingFromCrafters( final IContainerListener c )
{
super.removeCraftingFromCrafters( c );
if( this.getJob() != null )
@@ -24,7 +24,7 @@ import java.io.IOException;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import appeng.api.AEApi;
import appeng.api.networking.IGrid;
@@ -111,7 +111,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
this.getMonitor().removeListener( this );
}
for( final Object g : this.crafters )
for( final Object g : this.listeners )
{
if( g instanceof EntityPlayer )
{
@@ -152,12 +152,13 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
this.setEstimatedTime( -1 );
}
//TODO 1.9.4 - removeCraftingFromCrafters => ?
@Override
public void removeCraftingFromCrafters( final ICrafting c )
public void removeCraftingFromCrafters( final IContainerListener c )
{
super.removeCraftingFromCrafters( c );
if( this.crafters.isEmpty() && this.getMonitor() != null )
if( this.listeners.isEmpty() && this.getMonitor() != null )
{
this.getMonitor().removeListener( this );
}
@@ -202,7 +203,7 @@ public class ContainerCraftingCPU extends AEBaseContainer implements IMEMonitorH
this.list.resetStatus();
for( final Object g : this.crafters )
for( final Object g : this.listeners )
{
if( g instanceof EntityPlayer )
{
@@ -27,7 +27,7 @@ import javax.annotation.Nonnull;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
@@ -186,7 +186,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
if( sideLocal != sideRemote )
{
this.clientCM.putSetting( set, sideLocal );
for( final Object crafter : this.crafters )
for( final Object crafter : this.listeners )
{
try
{
@@ -226,7 +226,7 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
{
this.items.resetStatus();
for( final Object c : this.crafters )
for( final Object c : this.listeners )
{
if( c instanceof EntityPlayer )
{
@@ -300,15 +300,16 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
super.onUpdate( field, oldValue, newValue );
}
//TODO 1.9.4 - onCraftGuiOpened => ?
@Override
public void onCraftGuiOpened( final ICrafting c )
public void onCraftGuiOpened( final IContainerListener c )
{
super.onCraftGuiOpened( c );
this.queueInventory( c );
}
private void queueInventory( final ICrafting c )
private void queueInventory( final IContainerListener c )
{
if( Platform.isServer() && c instanceof EntityPlayer && this.monitor != null )
{
@@ -340,13 +341,13 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
}
}
}
@Override
public void removeCraftingFromCrafters( final ICrafting c )
public void removeListener( final IContainerListener c )
{
super.removeCraftingFromCrafters( c );
super.removeListener( c );
if( this.crafters.isEmpty() && this.monitor != null )
if( this.listeners.isEmpty() && this.monitor != null )
{
this.monitor.removeListener( this );
}
@@ -380,13 +381,9 @@ public class ContainerMEMonitorable extends AEBaseContainer implements IConfigMa
@Override
public void onListUpdate()
{
for( final Object c : this.crafters )
for( final IContainerListener c : this.listeners )
{
if( c instanceof ICrafting )
{
final ICrafting cr = (ICrafting) c;
this.queueInventory( cr );
}
this.queueInventory( c );
}
}
@@ -133,7 +133,7 @@ public class ContainerNetworkStatus extends AEBaseContainer
}
}
for( final Object c : this.crafters )
for( final Object c : this.listeners )
{
if( c instanceof EntityPlayer )
{
@@ -25,7 +25,7 @@ import java.util.List;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.EntityPlayerMP;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.inventory.Slot;
@@ -423,7 +423,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
if( failed != null )
{
p.dropPlayerItemWithRandomChoice( failed, false );
p.dropItem( failed, false );
}
}
@@ -481,19 +481,19 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
if( s == this.patternSlotOUT && Platform.isServer() )
{
for( final Object crafter : this.crafters )
for( final Object crafter : this.listeners )
{
final ICrafting icrafting = (ICrafting) crafter;
final IContainerListener IContainerListener = (IContainerListener) crafter;
for( final Object g : this.inventorySlots )
{
if( g instanceof OptionalSlotFake || g instanceof SlotFakeCraftingMatrix )
{
final Slot sri = (Slot) g;
icrafting.sendSlotContents( this, sri.slotNumber, sri.getStack() );
IContainerListener.sendSlotContents( this, sri.slotNumber, sri.getStack() );
}
}
( (EntityPlayerMP) icrafting ).isChangingQuantityOnly = false;
( (EntityPlayerMP) IContainerListener ).isChangingQuantityOnly = false;
}
this.detectAndSendChanges();
}
@@ -24,7 +24,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerDestroyItemEvent;
@@ -102,7 +102,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
{
if( this.inSlot.getStackInSlot( 0 ) != null )
{
par1EntityPlayer.dropPlayerItemWithRandomChoice( this.inSlot.getStackInSlot( 0 ), false );
par1EntityPlayer.dropItem( this.inSlot.getStackInSlot( 0 ), false );
}
}
@@ -174,6 +174,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
if( item.stackSize == 0 )
{
this.getPlayerInv().mainInventory[this.getPlayerInv().currentItem] = null;
//TODO 1.9.4 - 2 hands. Just do something!
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.getPlayerInv().player, item ) );
}
@@ -246,7 +247,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
}
@Override
public IChatComponent getDisplayName()
public ITextComponent getDisplayName()
{
return null;
}
@@ -21,7 +21,7 @@ package appeng.container.implementations;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IContainerListener;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
@@ -124,12 +124,12 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
if( this.wirelessIn.getHasStack() )
{
player.dropPlayerItemWithRandomChoice( this.wirelessIn.getStack(), false );
player.dropItem( this.wirelessIn.getStack(), false );
}
if( this.wirelessOut.getHasStack() )
{
player.dropPlayerItemWithRandomChoice( this.wirelessOut.getStack(), false );
player.dropItem( this.wirelessOut.getStack(), false );
}
}
@@ -168,11 +168,11 @@ public class ContainerSecurity extends ContainerMEMonitorable implements IAEAppE
this.wirelessOut.putStack( term );
// update the two slots in question...
for( final Object crafter : this.crafters )
for( final Object crafter : this.listeners )
{
final ICrafting icrafting = (ICrafting) crafter;
icrafting.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
icrafting.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
final IContainerListener IContainerListener = (IContainerListener) crafter;
IContainerListener.sendSlotContents( this, this.wirelessIn.slotNumber, this.wirelessIn.getStack() );
IContainerListener.sendSlotContents( this, this.wirelessOut.slotNumber, this.wirelessOut.getStack() );
}
}
}
@@ -23,7 +23,7 @@ import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import appeng.api.config.FuzzyMode;
@@ -88,54 +88,54 @@ public class AppEngCraftingSlot extends AppEngSlot
par1ItemStack.onCrafting( this.thePlayer.worldObj, this.thePlayer, this.amountCrafted );
this.amountCrafted = 0;
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.crafting_table ) )
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.CRAFTING_TABLE ) )
{
this.thePlayer.addStat( AchievementList.buildWorkBench, 1 );
this.thePlayer.addStat( AchievementList.BUILD_WORK_BENCH, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe )
{
this.thePlayer.addStat( AchievementList.buildPickaxe, 1 );
this.thePlayer.addStat( AchievementList.BUILD_PICKAXE, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.furnace ) )
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.FURNACE ) )
{
this.thePlayer.addStat( AchievementList.buildFurnace, 1 );
this.thePlayer.addStat( AchievementList.BUILD_FURNACE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemHoe )
{
this.thePlayer.addStat( AchievementList.buildHoe, 1 );
this.thePlayer.addStat( AchievementList.BUILD_HOE, 1 );
}
if( par1ItemStack.getItem() == Items.bread )
if( par1ItemStack.getItem() == Items.BREAD )
{
this.thePlayer.addStat( AchievementList.makeBread, 1 );
this.thePlayer.addStat( AchievementList.MAKE_BREAD, 1 );
}
if( par1ItemStack.getItem() == Items.cake )
if( par1ItemStack.getItem() == Items.CAKE )
{
this.thePlayer.addStat( AchievementList.bakeCake, 1 );
this.thePlayer.addStat( AchievementList.BAKE_CAKE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemPickaxe && ( (ItemTool) par1ItemStack.getItem() ).getToolMaterial() != Item.ToolMaterial.WOOD )
{
this.thePlayer.addStat( AchievementList.buildBetterPickaxe, 1 );
this.thePlayer.addStat( AchievementList.BUILD_BETTER_PICKAXE, 1 );
}
if( par1ItemStack.getItem() instanceof ItemSword )
{
this.thePlayer.addStat( AchievementList.buildSword, 1 );
this.thePlayer.addStat( AchievementList.BUILD_SWORD, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.enchanting_table ) )
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.ENCHANTING_TABLE ) )
{
this.thePlayer.addStat( AchievementList.enchantments, 1 );
this.thePlayer.addStat( AchievementList.ENCHANTMENTS, 1 );
}
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.bookshelf ) )
if( par1ItemStack.getItem() == Item.getItemFromBlock( Blocks.BOOKSHELF ) )
{
this.thePlayer.addStat( AchievementList.bookcase, 1 );
this.thePlayer.addStat( AchievementList.BOOKCASE, 1 );
}
}
@@ -152,7 +152,7 @@ public class AppEngCraftingSlot extends AppEngSlot
ic.setInventorySlotContents( x, this.craftMatrix.getStackInSlot( x ) );
}
final ItemStack[] aitemstack = CraftingManager.getInstance().func_180303_b( ic, playerIn.worldObj );
final ItemStack[] aitemstack = CraftingManager.getInstance().getRemainingItems( ic, playerIn.worldObj );
for( int x = 0; x < this.craftMatrix.getSizeInventory(); x++ )
{
@@ -179,7 +179,7 @@ public class AppEngCraftingSlot extends AppEngSlot
}
else if( !this.thePlayer.inventory.addItemStackToInventory( itemstack2 ) )
{
this.thePlayer.dropPlayerItemWithRandomChoice( itemstack2, false );
this.thePlayer.dropItem( itemstack2, false );
}
}
}
@@ -28,7 +28,7 @@ import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.item.crafting.IRecipe;
import net.minecraft.util.BlockPos;
import net.minecraft.util.math.BlockPos;
import appeng.api.config.Actionable;
import appeng.api.networking.energy.IEnergySource;
@@ -258,7 +258,7 @@ public class SlotRestrictedInput extends AppEngSlot
public static boolean isMetalIngot( final ItemStack i )
{
if( Platform.isSameItemPrecise( i, new ItemStack( Items.iron_ingot ) ) )
if( Platform.isSameItemPrecise( i, new ItemStack( Items.IRON_INGOT ) ) )
{
return true;
}