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
@@ -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;