Port to 1.11

This commit is contained in:
yueh
2016-12-08 12:42:00 +01:00
parent 589730bfad
commit ed9e6dd21c
262 changed files with 4027 additions and 3954 deletions
@@ -243,7 +243,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
if( i.hasNext() )
{
final ItemStack g = i.next().getItemStack();
g.stackSize = 1;
g.setCount( 1 );
inv.setInventorySlotContents( x, g );
}
else
@@ -331,7 +331,7 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
}
@Override
public boolean isUseableByPlayer( final EntityPlayer entityplayer )
public boolean isUsableByPlayer( EntityPlayer player )
{
return false;
}
@@ -383,5 +383,12 @@ public class ContainerCellWorkbench extends ContainerUpgradeable
{
ContainerCellWorkbench.this.getCellUpgradeInventory().clear();
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
}
@@ -66,7 +66,7 @@ public class ContainerCraftAmount extends AEBaseContainer
public World getWorld()
{
return this.getPlayerInv().player.worldObj;
return this.getPlayerInv().player.world;
}
public BaseActionSource getActionSrc()
@@ -279,7 +279,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
}
catch( final Throwable e )
{
this.getPlayerInv().player.addChatMessage( new TextComponentString( "Error: " + e.toString() ) );
this.getPlayerInv().player.sendMessage( new TextComponentString( "Error: " + e.toString() ) );
AELog.debug( e );
this.setValidContainer( false );
this.result = null;
@@ -389,7 +389,7 @@ public class ContainerCraftConfirm extends AEBaseContainer
public World getWorld()
{
return this.getPlayerInv().player.worldObj;
return this.getPlayerInv().player.world;
}
public boolean isAutoStart()
@@ -80,7 +80,7 @@ public class ContainerCraftingTerm extends ContainerMEMonitorable implements IAE
ic.setInventorySlotContents( x, this.craftingSlots[x].getStack() );
}
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj ) );
this.outputSlot.putStack( CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world ) );
}
@Override
@@ -268,7 +268,7 @@ public final class ContainerInterfaceTerminal extends AEBaseContainer
}
else if( is != null )
{
ItemStack extra = interfaceSlot.removeItems( ( is.stackSize + 1 ) / 2, null, null );
ItemStack extra = interfaceSlot.removeItems( ( is.getCount() + 1 ) / 2, null, null );
if( extra != null )
{
extra = playerHand.addItems( extra );
@@ -125,35 +125,28 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
if( !this.isCraftingMode() )
{
this.craftSlot.xDisplayPosition = -9000;
this.craftSlot.xPos = -9000;
for( int y = 0; y < 3; y++ )
{
this.outputSlots[y].xDisplayPosition = this.outputSlots[y].getX();
this.outputSlots[y].xPos = this.outputSlots[y].getX();
}
}
else
{
this.craftSlot.xDisplayPosition = this.craftSlot.getX();
this.craftSlot.xPos = this.craftSlot.getX();
for( int y = 0; y < 3; y++ )
{
this.outputSlots[y].xDisplayPosition = -9000;
this.outputSlots[y].xPos = -9000;
}
}
}
@Override
public void putStackInSlot( final int par1, final ItemStack par2ItemStack )
public void putStackInSlot( int slotID, ItemStack stack )
{
super.putStackInSlot( par1, par2ItemStack );
this.getAndUpdateOutput();
}
@Override
public void putStacksInSlots( final ItemStack[] par1ArrayOfItemStack )
{
super.putStacksInSlots( par1ArrayOfItemStack );
super.putStackInSlot( slotID, stack );
this.getAndUpdateOutput();
}
@@ -166,7 +159,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
ic.setInventorySlotContents( x, this.crafting.getStackInSlot( x ) );
}
final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.worldObj );
final ItemStack is = CraftingManager.getInstance().findMatchingRecipe( ic, this.getPlayerInv().player.world );
this.cOut.setInventorySlotContents( 0, is );
return is;
}
@@ -210,8 +203,8 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
}
// remove one, and clear the input slot.
output.stackSize--;
if( output.stackSize == 0 )
output.setCount( output.getCount() );
if( output.getCount() == 0 )
{
this.patternSlotIN.putStack( null );
}
@@ -277,7 +270,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
final ItemStack out = this.getAndUpdateOutput();
if( out != null && out.stackSize > 0 )
if( out != null && out.getCount() > 0 )
{
return new ItemStack[] { out };
}
@@ -291,7 +284,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
final ItemStack out = outputSlot.getStack();
if( out != null && out.stackSize > 0 )
if( out != null && out.getCount() > 0 )
{
list.add( out );
hasValue = true;
@@ -391,7 +384,7 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
ic.setInventorySlotContents( x, packetPatternSlot.pattern[x] == null ? null : packetPatternSlot.pattern[x].getItemStack() );
}
final IRecipe r = Platform.findMatchingRecipe( ic, p.worldObj );
final IRecipe r = Platform.findMatchingRecipe( ic, p.world );
if( r == null )
{
@@ -407,17 +400,17 @@ public class ContainerPatternTerm extends ContainerMEMonitorable implements IAEA
{
if( ic.getStackInSlot( x ) != null )
{
final ItemStack pulled = Platform.extractItemsByRecipe( this.getPowerSource(), this.getActionSource(), storage, p.worldObj, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) );
final ItemStack pulled = Platform.extractItemsByRecipe( this.getPowerSource(), this.getActionSource(), storage, p.world, r, is, ic, ic.getStackInSlot( x ), x, all, Actionable.MODULATE, ItemViewCell.createFilter( this.getViewCells() ) );
real.setInventorySlotContents( x, pulled );
}
}
final IRecipe rr = Platform.findMatchingRecipe( real, p.worldObj );
final IRecipe rr = Platform.findMatchingRecipe( real, p.world );
if( rr == r && Platform.itemComparisons().isSameItem( rr.getCraftingResult( real ), is ) )
{
final SlotCrafting sc = new SlotCrafting( p, real, this.cOut, 0, 0, 0 );
sc.onPickupFromSlot( p, is );
sc.onTake( p, is );
for( int x = 0; x < real.getSizeInventory(); x++ )
{
@@ -171,9 +171,9 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
final ItemStack item = this.toolInv.getItemStack();
item.damageItem( 1, this.getPlayerInv().player );
if( item.stackSize == 0 )
if( item.getCount() == 0 )
{
this.getPlayerInv().mainInventory[this.getPlayerInv().currentItem] = null;
this.getPlayerInv().mainInventory.add( this.getPlayerInv().currentItem, null );
MinecraftForge.EVENT_BUS.post( new PlayerDestroyItemEvent( this.getPlayerInv().player, item, null ) );
}
@@ -222,7 +222,7 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
}
@Override
public boolean isUseableByPlayer( final EntityPlayer var1 )
public boolean isUsableByPlayer( EntityPlayer player )
{
return false;
}
@@ -274,4 +274,11 @@ public class ContainerQuartzKnife extends AEBaseContainer implements IAEAppEngIn
{
this.inSlot.setInventorySlotContents( 0, null );
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -160,7 +160,7 @@ public class ContainerStorageBus extends ContainerUpgradeable
if( i.hasNext() && this.isSlotEnabled( ( x / 9 ) - 2 ) )
{
final ItemStack g = i.next().getItemStack();
g.stackSize = 1;
g.setCount( 1 );
inv.setInventorySlotContents( x, g );
}
else
@@ -51,7 +51,7 @@ public class ContainerWireless extends AEBaseContainer
@Override
public void detectAndSendChanges()
{
final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().stackSize;
final int boosters = this.boosterSlot.getStack() == null ? 0 : this.boosterSlot.getStack().getCount();
this.setRange( (long) ( 10 * AEConfig.instance().wireless_getMaxRange( boosters ) ) );
this.setDrain( (long) ( 100 * AEConfig.instance().wireless_getPowerDrain( boosters ) ) );
@@ -47,7 +47,7 @@ public class ContainerWirelessTerm extends ContainerMEPortableCell
{
if( Platform.isServer() && this.isValidContainer() )
{
this.getPlayerInv().player.addChatMessage( PlayerMessages.OutOfRange.get() );
this.getPlayerInv().player.sendMessage( PlayerMessages.OutOfRange.get() );
}
this.setValidContainer( false );