Second update pass (2/3) - 82 -> 0 errors

Second update pass which fixes all compile errors. Some parts may have
aftermath effect, hence why 3rd pass will check those maked with
"aftermath".
Errors: 82 -> 0. Mod can be launched.
This commit is contained in:
elix-x
2016-06-21 11:03:10 +02:00
parent 5498eb6d7c
commit 05aa6972c4
83 changed files with 564 additions and 405 deletions
+8 -7
View File
@@ -39,6 +39,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -493,39 +494,39 @@ public abstract class AEBasePart implements IPart, IGridProxyable, IActionHost,
}
@Override
public final boolean onActivate( final EntityPlayer player, final Vec3d pos )
public final boolean onActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( this.useMemoryCard( player ) )
{
return true;
}
return this.onPartActivate( player, pos );
return this.onPartActivate( player, hand, pos );
}
@Override
public final boolean onShiftActivate( final EntityPlayer player, final Vec3d pos )
public final boolean onShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( this.useMemoryCard( player ) )
{
return true;
}
return this.onPartShiftActivate( player, pos );
return this.onPartShiftActivate( player, hand, pos );
}
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
return false;
}
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
return false;
}
@Override
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
this.proxy.setOwner( player );
}
@@ -26,6 +26,8 @@ import java.util.List;
import java.util.Random;
import java.util.Set;
import javax.annotation.Nullable;
import io.netty.buffer.ByteBuf;
import net.minecraft.entity.Entity;
@@ -36,6 +38,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@@ -178,7 +181,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
@Override
public AEPartLocation addPart( ItemStack is, final AEPartLocation side, final EntityPlayer player )
public AEPartLocation addPart( ItemStack is, final AEPartLocation side, final @Nullable EntityPlayer player, final @Nullable EnumHand hand )
{
if( this.canAddPart( is, side ) )
{
@@ -216,7 +219,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( player != null )
{
bp.onPlacement( player, is, side );
bp.onPlacement( player, hand, is, side );
}
if( this.inWorld )
@@ -271,7 +274,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
if( player != null )
{
bp.onPlacement( player, is, side );
bp.onPlacement( player, hand, is, side );
}
if( this.inWorld )
@@ -802,12 +805,12 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
}
@Override
public boolean activate( final EntityPlayer player, final Vec3d pos )
public boolean activate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
final SelectedPart p = this.selectPart( pos );
if( p != null && p.part != null )
{
return p.part.onActivate( player, pos );
return p.part.onActivate( player, hand, pos );
}
return false;
}
@@ -972,7 +975,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
else
{
this.removePart( side, false );
side = this.addPart( new ItemStack( myItem, 1, dmgValue ), side, null );
side = this.addPart( new ItemStack( myItem, 1, dmgValue ), side, null, null );
if( side != null )
{
p = this.getPart( side );
@@ -1073,7 +1076,7 @@ public class CableBusContainer extends CableBusStorage implements AEMultiTile, I
else
{
this.removePart( side, true );
side = this.addPart( iss, side, null );
side = this.addPart( iss, side, null, null );
if( side != null )
{
p = this.getPart( side );
@@ -26,6 +26,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -47,7 +48,7 @@ public interface ICableBusContainer
void onEntityCollision( Entity e );
boolean activate( EntityPlayer player, Vec3d vecFromPool );
boolean activate( EntityPlayer player, EnumHand hand, Vec3d vecFromPool );
void onNeighborChanged();
@@ -26,6 +26,7 @@ import net.minecraft.entity.Entity;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -62,7 +63,7 @@ public class NullCableBusContainer implements ICableBusContainer
}
@Override
public boolean activate( final EntityPlayer player, final Vec3d vecFromPool )
public boolean activate( final EntityPlayer player, final EnumHand hand, final Vec3d vecFromPool )
{
return false;
}
+12 -14
View File
@@ -75,10 +75,8 @@ public class PartPlacement
private final ThreadLocal<Object> placing = new ThreadLocal<Object>();
private boolean wasCanceled = false;
public static boolean place( final ItemStack held, final BlockPos pos, EnumFacing side, final EntityPlayer player, final World world, PlaceType pass, final int depth )
public static boolean place( final ItemStack held, final BlockPos pos, EnumFacing side, final EntityPlayer player, final EnumHand hand, final World world, PlaceType pass, final int depth )
{
//TODO 1.9.4 - 2 hands! Just do something!
final EnumHand hand = EnumHand.MAIN_HAND;
if( depth > 3 )
{
return false;
@@ -140,7 +138,7 @@ public class PartPlacement
else
{
player.swingArm( hand );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ) ) );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ), hand ) );
}
return true;
}
@@ -191,7 +189,7 @@ public class PartPlacement
else
{
player.swingArm( hand );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ) ) );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ), hand ) );
return true;
}
}
@@ -229,11 +227,11 @@ public class PartPlacement
final SelectedPart sPart = selectPart( player, host, mop.hitVec );
if( sPart != null && sPart.part != null )
{
if( sPart.part.onShiftActivate( player, mop.hitVec ) )
if( sPart.part.onShiftActivate( player, hand, mop.hitVec ) )
{
if( world.isRemote )
{
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ) ) );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ), hand ) );
}
return true;
}
@@ -313,7 +311,7 @@ public class PartPlacement
else
{
player.swingArm( hand );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ) ) );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ), hand ) );
return true;
}
}
@@ -346,7 +344,7 @@ public class PartPlacement
// AEPartLocation.INTERNAL
// )
{
return place( held, te_pos, side.getOpposite(), player, world, pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS : PlaceType.PLACE_ITEM, depth + 1 );
return place( held, te_pos, side.getOpposite(), player, hand, world, pass == PlaceType.INTERACT_FIRST_PASS ? PlaceType.INTERACT_SECOND_PASS : PlaceType.PLACE_ITEM, depth + 1 );
}
}
return false;
@@ -364,7 +362,7 @@ public class PartPlacement
if( sp.part != null )
{
if( !player.isSneaking() && sp.part.onActivate( player, mop.hitVec ) )
if( !player.isSneaking() && sp.part.onActivate( player, hand, mop.hitVec ) )
{
return false;
}
@@ -377,7 +375,7 @@ public class PartPlacement
return false;
}
final AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player );
final AEPartLocation mySide = host.addPart( held, AEPartLocation.fromFacing( side ), player, hand );
if( mySide != null )
{
for( final Block multiPartBlock : multiPart.maybeBlock().asSet() )
@@ -401,7 +399,7 @@ public class PartPlacement
else
{
player.swingArm( hand );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ) ) );
NetworkHandler.instance.sendToServer( new PacketPartPlacement( pos, side, getEyeOffset( player ), hand ) );
}
return true;
}
@@ -482,7 +480,7 @@ public class PartPlacement
if( event.getEntityPlayer().isSneaking() && held != null && supportedItem )
{
NetworkHandler.instance.sendToServer( new PacketClick( event.getPos(), event.getFace(), 0, 0, 0 ) );
NetworkHandler.instance.sendToServer( new PacketClick( event.getPos(), event.getFace(), 0, 0, 0, event.getHand() ) );
}
}
}
@@ -496,7 +494,7 @@ public class PartPlacement
this.placing.set( event );
final ItemStack held = event.getEntityPlayer().getHeldItem( event.getHand() );
if( place( held, event.getPos(), event.getFace(), event.getEntityPlayer(), event.getEntityPlayer().worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) )
if( place( held, event.getPos(), event.getFace(), event.getEntityPlayer(), event.getHand(), event.getEntityPlayer().worldObj, PlaceType.INTERACT_FIRST_PASS, 0 ) )
{
event.setCanceled( true );
this.wasCanceled = true;
@@ -25,6 +25,7 @@ import com.google.common.collect.ImmutableSet;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
@@ -234,7 +235,7 @@ public class PartExportBus extends PartSharedItemBus implements ICraftingRequest
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !player.isSneaking() )
{
@@ -349,7 +349,7 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !player.isSneaking() )
{
@@ -410,9 +410,6 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
@Override
public IAEItemStack injectItems( final IAEItemStack input, final Actionable type, final BaseActionSource src )
{
//TODO 1.9.4 - 2 hands! Just do something!
final EnumHand hand = EnumHand.MAIN_HAND;
if( this.blocked || input == null || input.getStackSize() <= 0 )
{
return input;
@@ -466,29 +463,29 @@ public class PartFormationPlane extends PartUpgradeable implements ICellContaine
if( side.xOffset == 0 && side.zOffset == 0 )
{
Worked = i.onItemUse( is, player, w, tePos.offset( side.getFacing() ), hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
Worked = i.onItemUse( is, 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() ), hand, side.getFacing(), side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
Worked = i.onItemUse( is, 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 ), hand, EnumFacing.UP, side.xOffset, side.yOffset, side.zOffset ) == EnumActionResult.SUCCESS;
Worked = i.onItemUse( is, 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, hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
i.onItemUse( is, player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
}
maxStorage -= is.stackSize;
}
else
{
i.onItemUse( is, player, w, tePos, hand, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
i.onItemUse( is, player, w, tePos, null, side.getFacing().getOpposite(), side.xOffset, side.yOffset, side.zOffset );
maxStorage -= is.stackSize;
}
}
@@ -21,6 +21,7 @@ package appeng.parts.automation;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
@@ -144,7 +145,7 @@ public class PartImportBus extends PartSharedItemBus implements IInventoryDestin
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !player.isSneaking() )
{
@@ -22,6 +22,7 @@ package appeng.parts.automation;
import java.util.Collection;
import java.util.Random;
import net.minecraft.client.renderer.BlockModelRenderer;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
@@ -30,6 +31,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.EnumParticleTypes;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
@@ -595,8 +597,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
renderer.setRenderAllFaces( true );
//TODO 1.9.4 - getMixedBrightnessForBlock => ?
renderer.setBrightness( rh.getBlock().getMixedBrightnessForBlock( this.getHost().getTile().getWorld(), pos ) );
renderer.setBrightness( rh.getBlock().getPackedLightmapCoords( this.getHost().getTile().getWorld().getBlockState( pos ), this.getHost().getTile().getWorld(), pos ) );
renderer.setColorOpaque_F( 1.0F, 1.0F, 1.0F );
this.renderTorchAtAngle( pos.getX(), pos.getY(), pos.getZ(), renderer );
@@ -643,7 +644,7 @@ public class PartLevelEmitter extends PartUpgradeable implements IEnergyWatcherH
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !player.isSneaking() )
{
@@ -32,6 +32,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
@@ -232,13 +233,13 @@ public class PartCableAnchor implements IPart
}
@Override
public boolean onActivate( final EntityPlayer player, final Vec3d pos )
public boolean onActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
return false;
}
@Override
public boolean onShiftActivate( final EntityPlayer player, final Vec3d pos )
public boolean onShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
return false;
}
@@ -262,7 +263,7 @@ public class PartCableAnchor implements IPart
}
@Override
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
}
@@ -33,6 +33,7 @@ import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.text.ITextComponent;
@@ -200,7 +201,7 @@ public class PartInterface extends PartBasicState implements IGridTickable, ISto
}
@Override
public boolean onPartActivate( final EntityPlayer p, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer p, final EnumHand hand, final Vec3d pos )
{
if( p.isSneaking() )
{
@@ -28,6 +28,7 @@ import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
@@ -317,7 +318,7 @@ public class PartStorageBus extends PartUpgradeable implements IGridTickable, IC
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !player.isSneaking() )
{
@@ -30,6 +30,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -226,9 +227,9 @@ public class PartToggleBus extends PartBasicState
}
@Override
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
super.onPlacement( player, held, side );
super.onPlacement( player, hand, held, side );
this.getOuterProxy().setOwner( player );
}
@@ -145,7 +145,7 @@ public class PartCable extends AEBasePart implements IPartCable
}
this.getHost().removePart( AEPartLocation.INTERNAL, true );
this.getHost().addPart( newPart, AEPartLocation.INTERNAL, who );
this.getHost().addPart( newPart, AEPartLocation.INTERNAL, who, null );
return true;
}
}
@@ -28,6 +28,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@@ -146,9 +147,9 @@ public class PartQuartzFiber extends AEBasePart implements IEnergyGridProvider
}
@Override
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
super.onPlacement( player, held, side );
super.onPlacement( player, hand, held, side );
this.outerProxy.setOwner( player );
}
@@ -30,6 +30,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3d;
import net.minecraftforge.fml.relauncher.Side;
@@ -227,7 +228,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
final ItemStack is = player.inventory.getCurrentItem();
@@ -251,7 +252,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
if( testPart instanceof PartP2PTunnel )
{
this.getHost().removePart( this.getSide(), true );
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player );
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player, hand );
final IPart newBus = this.getHost().getPart( dir );
if( newBus instanceof PartP2PTunnel )
@@ -365,7 +366,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
final long myFreq = this.getFrequency();
this.getHost().removePart( this.getSide(), false );
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player );
final AEPartLocation dir = this.getHost().addPart( newType, this.getSide(), player, hand );
final IPart newBus = this.getHost().getPart( dir );
if( newBus instanceof PartP2PTunnel )
@@ -394,7 +395,7 @@ public abstract class PartP2PTunnel<T extends PartP2PTunnel> extends PartBasicSt
}
@Override
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
final ItemStack is = player.inventory.getCurrentItem();
if( is != null && is.getItem() instanceof IMemoryCard )
@@ -27,6 +27,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import appeng.api.AEApi;
import appeng.api.exceptions.FailedConnection;
@@ -125,9 +126,9 @@ public class PartP2PTunnelME extends PartP2PTunnel<PartP2PTunnelME> implements I
}
@Override
public void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
super.onPlacement( player, held, side );
super.onPlacement( player, hand, held, side );
this.outerProxy.setOwner( player );
}
@@ -160,11 +160,8 @@ public abstract class AbstractPartMonitor extends AbstractPartDisplay implements
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
{
//TODO 1.9.4 - 2 hands! Just do something!
final EnumHand hand = EnumHand.MAIN_HAND;
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( Platform.isClient() )
{
return true;
@@ -27,6 +27,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
@@ -189,7 +190,7 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
final TileEntity te = this.getTile();
@@ -225,14 +226,14 @@ public abstract class AbstractPartReporting extends AEBasePart implements IPartM
}
else
{
return super.onPartActivate( player, pos );
return super.onPartActivate( player, hand, pos );
}
}
@Override
public final void onPlacement( final EntityPlayer player, final ItemStack held, final AEPartLocation side )
public final void onPlacement( final EntityPlayer player, final EnumHand hand, final ItemStack held, final AEPartLocation side )
{
super.onPlacement( player, held, side );
super.onPlacement( player, hand, held, side );
final byte rotation = (byte) ( MathHelper.floor_double( ( player.rotationYaw * 4F ) / 360F + 2.5D ) & 3 );
if( side == AEPartLocation.UP )
@@ -25,6 +25,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
import appeng.api.config.Settings;
@@ -110,9 +111,9 @@ public abstract class AbstractPartTerminal extends AbstractPartDisplay implement
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !super.onPartActivate( player, pos ) )
if( !super.onPartActivate( player, hand, pos ) )
{
if( !player.isSneaking() )
{
@@ -55,11 +55,8 @@ public class PartConversionMonitor extends AbstractPartMonitor
}
@Override
public boolean onPartShiftActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartShiftActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
//TODO 1.9.4 - 2 hands! Just do something!
final EnumHand hand = EnumHand.MAIN_HAND;
if( Platform.isClient() )
{
return true;
@@ -21,6 +21,7 @@ package appeng.parts.reporting;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.Vec3d;
import appeng.client.texture.CableBusTextures;
@@ -40,9 +41,9 @@ public class PartInterfaceTerminal extends AbstractPartDisplay
}
@Override
public boolean onPartActivate( final EntityPlayer player, final Vec3d pos )
public boolean onPartActivate( final EntityPlayer player, final EnumHand hand, final Vec3d pos )
{
if( !super.onPartActivate( player, pos ) )
if( !super.onPartActivate( player, hand, pos ) )
{
if( !player.isSneaking() )
{