Fix shift-left clicking Lapis pipes

Unfortunately I need to fix a Forge bug to make them swing properly.
This commit is contained in:
CovertJaguar 2013-07-27 00:07:33 -07:00
parent 474d422bb6
commit d9636a7455
3 changed files with 12 additions and 6 deletions

View file

@ -31,6 +31,7 @@ public class ItemWrench extends ItemBuildCraft implements IToolWrench {
@Override
public void wrenchUsed(EntityPlayer player, int x, int y, int z) {
player.swingItem();
}
@Override

View file

@ -136,6 +136,11 @@ public enum EnumColor {
return next;
}
public EnumColor getPrevious() {
EnumColor previous = VALUES[(ordinal() + VALUES.length - 2) % (VALUES.length - 1)];
return previous;
}
public EnumColor inverse() {
return EnumColor.VALUES[15 - ordinal()];
}

View file

@ -54,16 +54,16 @@ public class PipeItemsLapis extends Pipe<PipeTransportItems> implements IItemTra
}
@Override
public boolean blockActivated(EntityPlayer entityplayer) {
Item equipped = entityplayer.getCurrentEquippedItem() != null ? entityplayer.getCurrentEquippedItem().getItem() : null;
if (equipped instanceof IToolWrench && ((IToolWrench) equipped).canWrench(entityplayer, container.xCoord, container.yCoord, container.zCoord)) {
if (entityplayer.isSneaking()) {
setColor(getColor().fromId(container.getBlockMetadata() - 1));
public boolean blockActivated(EntityPlayer player) {
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()) {
setColor(getColor().getPrevious());
} else {
setColor(getColor().getNext());
}
((IToolWrench) equipped).wrenchUsed(entityplayer, container.xCoord, container.yCoord, container.zCoord);
((IToolWrench) equipped).wrenchUsed(player, container.xCoord, container.yCoord, container.zCoord);
return true;
}