This commit is contained in:
asiekierka 2015-09-22 15:52:31 +02:00
parent c9dbe14765
commit 6ed71b4f16
6 changed files with 5 additions and 14 deletions

View file

@ -633,16 +633,12 @@ public class BlockGenericPipe extends BlockBuildCraft implements IColorRemovable
} else if (currentItem.getItem() instanceof IToolWrench) {
// Only check the instance at this point. Call the IToolWrench
// interface callbacks for the individual pipe/logic calls
if (pipe.blockActivated(player, ForgeDirection.getOrientation(side))) {
return true;
}
RaytraceResult rayTraceResult = doRayTrace(world, x, y, z, player);
if (rayTraceResult != null) {
ForgeDirection hitSide = rayTraceResult.hitPart == Part.Pipe ? rayTraceResult.sideHit : ForgeDirection.UNKNOWN;
return pipe.blockActivated(player, hitSide);
} else {
return false;
return pipe.blockActivated(player, ForgeDirection.UNKNOWN);
}
} else if (currentItem.getItem() instanceof IMapLocation) {
// We want to be able to record pipe locations

View file

@ -82,11 +82,6 @@ public abstract class Pipe<T extends PipeTransport> implements IDropControlInven
return false;
}
@Deprecated
public boolean blockActivated(EntityPlayer entityplayer) {
return false;
}
public void onBlockPlaced() {
transport.onBlockPlaced();
}

View file

@ -116,7 +116,7 @@ public class PipeFluidsDiamond extends Pipe<PipeTransportFluids> implements IDia
}
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
public boolean blockActivated(EntityPlayer entityplayer, ForgeDirection direction) {
if (entityplayer.getCurrentEquippedItem() != null) {
if (Block.getBlockFromItem(entityplayer.getCurrentEquippedItem().getItem()) instanceof BlockGenericPipe) {
return false;

View file

@ -106,7 +106,7 @@ public class PipeItemsDiamond extends Pipe<PipeTransportItems> implements IDiamo
}
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
public boolean blockActivated(EntityPlayer entityplayer, ForgeDirection direction) {
if (entityplayer.getCurrentEquippedItem() != null) {
if (Block.getBlockFromItem(entityplayer.getCurrentEquippedItem().getItem()) instanceof BlockGenericPipe) {
return false;

View file

@ -55,7 +55,7 @@ public class PipeItemsLapis extends Pipe<PipeTransportItems> {
}
@Override
public boolean blockActivated(EntityPlayer player) {
public boolean blockActivated(EntityPlayer player, ForgeDirection direction) {
Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(player, container.xCoord, container.yCoord, container.zCoord)) {
if (player.isSneaking()) {

View file

@ -49,7 +49,7 @@ public class PipePowerIron extends Pipe<PipeTransportPower> {
}
@Override
public boolean blockActivated(EntityPlayer player) {
public boolean blockActivated(EntityPlayer player, ForgeDirection direction) {
Item equipped = player.getCurrentEquippedItem() != null ? player.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(player, container.xCoord, container.yCoord, container.zCoord)) {
if (player.isSneaking()) {