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
@@ -142,7 +142,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
{
this.extractAEPower( this.getInternalMaxPower(), Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500
materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).ifPresent( charged -> this.setInventorySlotContents( 0, charged ) );
materials.certusQuartzCrystalCharged().maybeStack( myItem.getCount() ).ifPresent( charged -> this.setInventorySlotContents( 0, charged ) );
}
}
}
@@ -232,7 +232,7 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
final List<ItemStack> drops = new ArrayList<ItemStack>();
drops.add( myItem );
this.setInventorySlotContents( 0, null );
Platform.spawnDrops( this.worldObj, this.pos.offset( this.getForward() ), drops );
Platform.spawnDrops( this.world, this.pos.offset( this.getForward() ), drops );
}
}
@@ -296,10 +296,17 @@ public class TileCharger extends AENetworkPowerTile implements ICrankable, IGrid
{
this.extractAEPower( this.getInternalMaxPower(), Actionable.MODULATE, PowerMultiplier.CONFIG );// 1500
materials.certusQuartzCrystalCharged().maybeStack( myItem.stackSize ).ifPresent( charged -> this.setInventorySlotContents( 0, charged ) );
materials.certusQuartzCrystalCharged().maybeStack( myItem.getCount() ).ifPresent( charged -> this.setInventorySlotContents( 0, charged ) );
}
}
return true;
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -135,7 +135,8 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
private boolean canAddOutput( final ItemStack output )
{
final ItemStack outputStack = this.getStackInSlot( 1 );
return outputStack == null || ( Platform.itemComparisons().isEqualItem( outputStack, output ) && outputStack.stackSize < outputStack.getMaxStackSize() );
return outputStack == null || ( Platform.itemComparisons().isEqualItem( outputStack,
output ) && outputStack.getCount() < outputStack.getMaxStackSize() );
}
/**
@@ -152,7 +153,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
}
else
{
outputStack.stackSize++;
outputStack.grow( 1 );
this.setInventorySlotContents( 1, outputStack );
}
}
@@ -193,7 +194,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
{
if( itemstack != null )
{
this.addPower( itemstack.stackSize );
this.addPower( itemstack.getCount() );
}
}
else
@@ -216,7 +217,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
final ItemStack is = inv.getStackInSlot( 0 );
if( is != null )
{
this.addPower( is.stackSize );
this.addPower( is.getCount() );
inv.setInventorySlotContents( 0, null );
}
}
@@ -325,7 +326,7 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
}
if( !simulate && stack != null )
{
addPower( stack.stackSize );
addPower( stack.getCount() );
}
return null;
}
@@ -335,12 +336,16 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
{
return null;
}
@Override
public int getSlotLimit( int slot )
{
return 0;
}
}
private static final IFluidTankProperties[] EMPTY = { new FluidTankProperties( null, 10, true, false ) };
/**
* A fluid handler that exposes a 10 bucket tank that can only be filled, and - when filled - will add power
* to this condenser.
@@ -380,10 +385,11 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
}
}
/**
* This is used to expose a fake ME subnetwork that is only composed of this condenser tile. The purpose of this is to enable the condenser to
* override the {@link appeng.api.storage.IMEInventoryHandler#validForPass(int)} method to make sure a condenser is only ever used if an item
* This is used to expose a fake ME subnetwork that is only composed of this condenser tile. The purpose of this is
* to enable the condenser to
* override the {@link appeng.api.storage.IMEInventoryHandler#validForPass(int)} method to make sure a condenser is
* only ever used if an item
* can't go anywhere else.
*/
private class MEHandler implements IStorageMonitorableAccessor, IStorageMonitorable
@@ -411,4 +417,11 @@ public class TileCondenser extends AEBaseInvTile implements IConfigManagerHost,
return fluidInventory;
}
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -344,17 +344,17 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
final ItemStack plateB = this.getStackInSlot( 1 );
ItemStack renamedItem = this.getStackInSlot( 2 );
if( plateA != null && plateA.stackSize > 1 )
if( plateA != null && plateA.getCount() > 1 )
{
return null;
}
if( plateB != null && plateB.stackSize > 1 )
if( plateB != null && plateB.getCount() > 1 )
{
return null;
}
if( renamedItem != null && renamedItem.stackSize > 1 )
if( renamedItem != null && renamedItem.getCount() > 1 )
{
return null;
}
@@ -723,6 +723,20 @@ public class TileInscriber extends AENetworkPowerTile implements IGridTickable,
}
}
@Override
public int getSlotLimit( int slot )
{
// TODO Auto-generated method stub
return 0;
}
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -361,4 +361,11 @@ public class TileInterface extends AENetworkInvTile implements IGridTickable, II
}
return super.getCapability( capability, facing );
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}
@@ -49,12 +49,12 @@ public class TileLightDetector extends AEBaseTile implements ITickable
public void updateLight()
{
final int val = this.worldObj.getLight( this.pos );
final int val = this.world.getLight( this.pos );
if( this.lastLight != val )
{
this.lastLight = val;
Platform.notifyBlocksOfNeighbors( this.worldObj, this.pos );
Platform.notifyBlocksOfNeighbors( this.world, this.pos );
}
}
@@ -130,9 +130,9 @@ public class TilePaint extends AEBaseTile
this.isLit = 14;
}
if( this.worldObj != null )
if( this.world != null )
{
this.worldObj.getLightFor( EnumSkyBlock.BLOCK, this.pos );
this.world.getLightFor( EnumSkyBlock.BLOCK, this.pos );
}
}
@@ -170,8 +170,8 @@ public class TilePaint extends AEBaseTile
public boolean isSideValid( final EnumFacing side )
{
final BlockPos p = this.pos.offset( side );
final IBlockState blk = this.worldObj.getBlockState( p );
return blk.getBlock().isSideSolid( this.worldObj.getBlockState( p ), this.worldObj, p, side.getOpposite() );
final IBlockState blk = this.world.getBlockState( p );
return blk.getBlock().isSideSolid( this.world.getBlockState( p ), this.world, p, side.getOpposite() );
}
private void removeSide( final EnumFacing side )
@@ -210,7 +210,7 @@ public class TilePaint extends AEBaseTile
if( this.dots == null )
{
this.worldObj.setBlockToAir( this.pos );
this.world.setBlockToAir( this.pos );
}
}
@@ -235,8 +235,8 @@ public class TilePaint extends AEBaseTile
{
final BlockPos p = this.pos.offset( side );
final IBlockState blk = this.worldObj.getBlockState( p );
if( blk.getBlock().isSideSolid( this.worldObj.getBlockState( p ), this.worldObj, p, side.getOpposite() ) )
final IBlockState blk = this.world.getBlockState( p );
if( blk.getBlock().isSideSolid( this.world.getBlockState( p ), this.world, p, side.getOpposite() ) )
{
final ItemPaintBall ipb = (ItemPaintBall) type.getItem();
@@ -194,7 +194,7 @@ public class TileSecurityStation extends AENetworkTile implements ITerminalHost,
final NBTBase obj = storedItems.getTag( (String) key );
if( obj instanceof NBTTagCompound )
{
this.inventory.getStoredItems().add( AEItemStack.create( ItemStack.loadItemStackFromNBT( (NBTTagCompound) obj ) ) );
this.inventory.getStoredItems().add( AEItemStack.create( new ItemStack( (NBTTagCompound) obj ) ) );
}
}
}
@@ -160,7 +160,7 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
if( is != null )
{
final int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
if( newBurnTime > 0 && is.stackSize > 0 )
if( newBurnTime > 0 && is.getCount() > 0 )
{
return true;
}
@@ -247,12 +247,12 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
if( is != null )
{
final int newBurnTime = TileEntityFurnace.getItemBurnTime( is );
if( newBurnTime > 0 && is.stackSize > 0 )
if( newBurnTime > 0 && is.getCount() > 0 )
{
this.setBurnTime( this.getBurnTime() + newBurnTime );
this.setMaxBurnTime( this.getBurnTime() );
is.stackSize--;
if( is.stackSize <= 0 )
is.grow( -1 );
if( is.getCount() <= 0 )
{
ItemStack container = null;
@@ -290,9 +290,9 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
this.isOn = this.getBurnTime() > 0;
this.markForUpdate();
if( this.hasWorldObj() )
if( this.hasWorld() )
{
Platform.notifyBlocksOfNeighbors( this.worldObj, this.pos );
Platform.notifyBlocksOfNeighbors( this.world, this.pos );
}
}
}
@@ -326,4 +326,11 @@ public class TileVibrationChamber extends AENetworkInvTile implements IGridTicka
{
this.burnTime = burnTime;
}
@Override
public boolean isEmpty()
{
// TODO Auto-generated method stub
return false;
}
}