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
@@ -56,13 +56,13 @@ import appeng.api.parts.IPartModel;
import appeng.api.storage.data.IAEItemStack;
import appeng.api.util.AECableType;
import appeng.api.util.AEPartLocation;
import appeng.core.AppEng;
import appeng.core.settings.TickRates;
import appeng.core.sync.packets.PacketTransitionEffect;
import appeng.hooks.TickHandler;
import appeng.items.parts.PartModels;
import appeng.me.GridAccessException;
import appeng.parts.PartBasicState;
import appeng.server.ServerHelper;
import appeng.util.IWorldCallable;
import appeng.util.Platform;
import appeng.util.item.AEItemStack;
@@ -292,8 +292,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
if( changed )
{
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(),
new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, this.getTile().getWorld(), new PacketTransitionEffect( entity.posX, entity.posY, entity.posZ, this.getSide(), false ) );
}
}
}
@@ -368,11 +367,11 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
return true;
}
final int oldStackSize = entityItem.getEntityItem().stackSize;
final int oldStackSize = entityItem.getEntityItem().getCount();
final int newStackSize = (int) overflow.getStackSize();
final boolean changed = oldStackSize != newStackSize;
entityItem.getEntityItem().stackSize = newStackSize;
entityItem.getEntityItem().setCount( newStackSize );
return changed;
}
@@ -402,7 +401,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
overflowEntity.motionY = 0;
overflowEntity.motionZ = 0;
w.spawnEntityInWorld( overflowEntity );
w.spawnEntity( overflowEntity );
}
protected boolean isAnnihilationPlane( final TileEntity blockTileEntity, final AEPartLocation side )
@@ -457,8 +456,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
{
energy.extractAEPower( requiredPower, Actionable.MODULATE, PowerMultiplier.CONFIG );
this.breakBlockAndStoreItems( w, pos, items );
ServerHelper.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w,
new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
AppEng.proxy.sendToAllNearExcept( null, pos.getX(), pos.getY(), pos.getZ(), 64, w, new PacketTransitionEffect( pos.getX(), pos.getY(), pos.getZ(), this.getSide(), true ) );
}
else
{
@@ -531,7 +529,7 @@ public class PartAnnihilationPlane extends PartBasicState implements IGridTickab
float requiredEnergy = 1 + hardness;
for( final ItemStack is : items )
{
requiredEnergy += is.stackSize;
requiredEnergy += is.getCount();
}
return requiredEnergy;
@@ -305,10 +305,10 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
private void pushItemIntoTarget( final InventoryAdaptor d, final IEnergyGrid energy, final IMEInventory<IAEItemStack> inv, IAEItemStack ais )
{
final ItemStack is = ais.getItemStack();
is.stackSize = (int) this.itemToSend;
is.setCount( (int) this.itemToSend );
final ItemStack o = d.simulateAdd( is );
final long canFit = o == null ? this.itemToSend : this.itemToSend - o.stackSize;
final long canFit = o == null ? this.itemToSend : this.itemToSend - o.getCount();
if( canFit > 0 )
{
@@ -323,7 +323,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
final ItemStack failed = d.addItems( itemsToAdd.getItemStack() );
if( failed != null )
{
ais.setStackSize( failed.stackSize );
ais.setStackSize( failed.getCount() );
inv.injectItems( ais, Actionable.MODULATE, this.mySrc );
}
else
@@ -471,7 +471,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
* }
*/
maxStorage = is.stackSize;
maxStorage = is.getCount();
worked = true;
if( type == Actionable.MODULATE )
{
@@ -481,33 +481,33 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
if( side.xOffset == 0 && side.zOffset == 0 )
{
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing() ), null, side.getFacing().getOpposite(), side.xOffset,
Worked = i.onItemUse( player, w, tePos.offset( side.getFacing() ), null, side.getFacing().getOpposite(), side.xOffset,
side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
}
if( !Worked && side.xOffset == 0 && side.zOffset == 0 )
{
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing().getOpposite() ), null, side.getFacing(), side.xOffset,
Worked = i.onItemUse( player, w, tePos.offset( side.getFacing().getOpposite() ), null, side.getFacing(), side.xOffset,
side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
}
if( !Worked && side.yOffset == 0 )
{
Worked = i.onItemUse( is, player, w, tePos.offset( EnumFacing.DOWN ), null, EnumFacing.UP, side.xOffset, side.yOffset,
Worked = i.onItemUse( player, w, tePos.offset( EnumFacing.DOWN ), null, EnumFacing.UP, side.xOffset, side.yOffset,
side.zOffset ) == EnumActionResult.SUCCESS;
}
if( !Worked )
{
i.onItemUse( is, player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
i.onItemUse( player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
}
maxStorage -= is.stackSize;
maxStorage -= is.getCount();
}
else
{
i.onItemUse( is, player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
maxStorage -= is.stackSize;
i.onItemUse( player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
maxStorage -= is.getCount();
}
}
else
@@ -534,7 +534,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
{
if( type == Actionable.MODULATE )
{
is.stackSize = (int) maxStorage;
is.setCount( (int) maxStorage );
final double x = ( side.xOffset != 0 ? 0 : .7 * ( Platform.getRandomFloat() - .5 ) ) + side.xOffset + .5 + te.getPos().getX();
final double y = ( side.yOffset != 0 ? 0 : .7 * ( Platform.getRandomFloat() - .5 ) ) + side.yOffset + .5 + te.getPos().getY();
final double z = ( side.zOffset != 0 ? 0 : .7 * ( Platform.getRandomFloat() - .5 ) ) + side.zOffset + .5 + te.getPos().getZ();
@@ -560,7 +560,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
}
}
if( !w.spawnEntityInWorld( result ) )
if( !w.spawnEntity( result ) )
{
result.setDead();
worked = false;
@@ -99,7 +99,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
{
return true;
}
return out.getStackSize() != stack.stackSize;
return out.getStackSize() != stack.getCount();
}
@Override
@@ -226,9 +226,9 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if( newItems != null )
{
newItems.stackSize = (int) ( Math.min( newItems.stackSize,
energy.extractAEPower( newItems.stackSize, Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01 );
this.itemToSend -= newItems.stackSize;
newItems.setCount( (int) ( Math.min( newItems.getCount(),
energy.extractAEPower( newItems.getCount(), Actionable.SIMULATE, PowerMultiplier.CONFIG ) ) + 0.01 ) );
this.itemToSend -= newItems.getCount();
if( this.lastItemChecked == null || !this.lastItemChecked.isSameType( newItems ) )
{
@@ -236,7 +236,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
}
else
{
this.lastItemChecked.setStackSize( newItems.stackSize );
this.lastItemChecked.setStackSize( newItems.getCount() );
}
final IAEItemStack failed = Platform.poweredInsert( energy, this.destination, this.lastItemChecked, this.source );
@@ -288,7 +288,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
if( itemAmountNotStorable != null )
{
return (int) Math.min( simResult.stackSize - itemAmountNotStorable.getStackSize(), toSend );
return (int) Math.min( simResult.getCount() - itemAmountNotStorable.getStackSize(), toSend );
}
return toSend;