diff --git a/api/buildcraft/api/statements/IStatementParameter.java b/api/buildcraft/api/statements/IStatementParameter.java index 8e02ca3e..0bbc3dcb 100755 --- a/api/buildcraft/api/statements/IStatementParameter.java +++ b/api/buildcraft/api/statements/IStatementParameter.java @@ -46,7 +46,7 @@ public interface IStatementParameter { */ String getDescription(); - void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton); + void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse); void readFromNBT(NBTTagCompound compound); diff --git a/api/buildcraft/api/statements/StatementMouseClick.java b/api/buildcraft/api/statements/StatementMouseClick.java new file mode 100644 index 00000000..44953401 --- /dev/null +++ b/api/buildcraft/api/statements/StatementMouseClick.java @@ -0,0 +1,19 @@ +package buildcraft.api.statements; + +public final class StatementMouseClick { + private int button; + private boolean shift; + + public StatementMouseClick(int button, boolean shift) { + this.button = button; + this.shift = shift; + } + + public boolean isShift() { + return shift; + } + + public int getButton() { + return button; + } +} diff --git a/api/buildcraft/api/statements/StatementParameterItemStack.java b/api/buildcraft/api/statements/StatementParameterItemStack.java index aceba6ab..6faa103a 100755 --- a/api/buildcraft/api/statements/StatementParameterItemStack.java +++ b/api/buildcraft/api/statements/StatementParameterItemStack.java @@ -30,7 +30,7 @@ public class StatementParameterItemStack implements IStatementParameter { } @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton) { + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { if (stack != null) { this.stack = stack.copy(); this.stack.stackSize = 1; diff --git a/common/buildcraft/core/IMachine.java b/common/buildcraft/core/IMachine.java index 4ce89032..cc20cc85 100644 --- a/common/buildcraft/core/IMachine.java +++ b/common/buildcraft/core/IMachine.java @@ -8,8 +8,6 @@ */ package buildcraft.core; -import buildcraft.api.gates.IAction; - /** * Left only to stop certain mods depending on it from crashing. * Please move to the classes contained in builcraft.api.tiles diff --git a/common/buildcraft/core/blueprints/Blueprint.java b/common/buildcraft/core/blueprints/Blueprint.java index bb7257ac..ecaf9d6e 100644 --- a/common/buildcraft/core/blueprints/Blueprint.java +++ b/common/buildcraft/core/blueprints/Blueprint.java @@ -215,7 +215,8 @@ public class Blueprint extends BlueprintBase { } if (block != null) { - contents[x][y][z] = SchematicRegistry.INSTANCE.createSchematicBlock(block, cpt.getInteger("blockMeta")); + int meta = cpt.getInteger("blockMeta"); + contents[x][y][z] = SchematicRegistry.INSTANCE.createSchematicBlock(block, meta); if (contents[x][y][z] != null) { contents[x][y][z].readSchematicFromNBT(cpt, mapping); @@ -226,6 +227,9 @@ public class Blueprint extends BlueprintBase { case ALL: break; case CREATIVE_ONLY: + System.out.println("FOUND CREATIVE BUILDING PERMISSION"); + System.out.println("- block: " + Block.blockRegistry.getNameForObject(block)); + System.out.println("- meta: " + meta); if (buildingPermission == BuildingPermission.ALL) { buildingPermission = BuildingPermission.CREATIVE_ONLY; } diff --git a/common/buildcraft/core/statements/StatementParameterDirection.java b/common/buildcraft/core/statements/StatementParameterDirection.java index bf4bdfa2..e5c20837 100644 --- a/common/buildcraft/core/statements/StatementParameterDirection.java +++ b/common/buildcraft/core/statements/StatementParameterDirection.java @@ -18,6 +18,7 @@ import buildcraft.api.gates.IGate; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; +import buildcraft.api.statements.StatementMouseClick; import buildcraft.api.transport.IPipe; import buildcraft.core.utils.StringUtils; import buildcraft.transport.TileGenericPipe; @@ -48,10 +49,10 @@ public class StatementParameterDirection implements IStatementParameter { } @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton) { + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { if (source.getTile() instanceof TileGenericPipe) { do { - direction = ForgeDirection.getOrientation((direction.ordinal() + (mouseButton > 0 ? -1 : 1)) % 6); + direction = ForgeDirection.getOrientation((direction.ordinal() + (mouse.getButton() > 0 ? -1 : 1)) % 6); } while (((TileGenericPipe) source.getTile()).isPipeConnected(direction)); } } diff --git a/common/buildcraft/core/statements/StatementParameterRedstoneGateSideOnly.java b/common/buildcraft/core/statements/StatementParameterRedstoneGateSideOnly.java index 8796735f..33ed3cf9 100644 --- a/common/buildcraft/core/statements/StatementParameterRedstoneGateSideOnly.java +++ b/common/buildcraft/core/statements/StatementParameterRedstoneGateSideOnly.java @@ -8,6 +8,7 @@ import buildcraft.api.core.NetworkData; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; +import buildcraft.api.statements.StatementMouseClick; import buildcraft.core.utils.StringUtils; public class StatementParameterRedstoneGateSideOnly implements @@ -36,7 +37,7 @@ public class StatementParameterRedstoneGateSideOnly implements } @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton) { + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { isOn = !isOn; } diff --git a/common/buildcraft/transport/gui/GuiGateInterface.java b/common/buildcraft/transport/gui/GuiGateInterface.java index dbe31e01..d8172ca8 100644 --- a/common/buildcraft/transport/gui/GuiGateInterface.java +++ b/common/buildcraft/transport/gui/GuiGateInterface.java @@ -21,6 +21,7 @@ import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementParameter; +import buildcraft.api.statements.StatementMouseClick; import buildcraft.core.gui.AdvancedSlot; import buildcraft.core.gui.GuiAdvancedInterface; import buildcraft.core.utils.StringUtils; @@ -473,7 +474,8 @@ public class GuiGateInterface extends GuiAdvancedInterface { } if (param != null) { - param.onClick(gate, statement.getStatement(), mc.thePlayer.inventory.getItemStack(), k); + param.onClick(gate, statement.getStatement(), mc.thePlayer.inventory.getItemStack(), + new StatementMouseClick(k, isShiftKeyDown())); paramSlot.setParameter(param, true); } } diff --git a/common/buildcraft/transport/statements/ActionParameterSignal.java b/common/buildcraft/transport/statements/ActionParameterSignal.java index 397170db..a9efb60d 100644 --- a/common/buildcraft/transport/statements/ActionParameterSignal.java +++ b/common/buildcraft/transport/statements/ActionParameterSignal.java @@ -18,6 +18,7 @@ import buildcraft.api.core.NetworkData; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; +import buildcraft.api.statements.StatementMouseClick; import buildcraft.api.transport.PipeWire; import buildcraft.core.utils.StringUtils; @@ -41,13 +42,13 @@ public class ActionParameterSignal implements IStatementParameter { } @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton) { + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { if (color == null) { - color = mouseButton == 0 ? PipeWire.RED : PipeWire.YELLOW; - } else if (color == (mouseButton == 0 ? PipeWire.YELLOW : PipeWire.RED)) { + color = mouse.getButton() == 0 ? PipeWire.RED : PipeWire.YELLOW; + } else if (color == (mouse.getButton() == 0 ? PipeWire.YELLOW : PipeWire.RED)) { color = null; } else { - color = PipeWire.values()[mouseButton == 0 ? color.ordinal() + 1 : color.ordinal() - 1]; + color = PipeWire.values()[mouse.getButton() == 0 ? color.ordinal() + 1 : color.ordinal() - 1]; } } diff --git a/common/buildcraft/transport/statements/TriggerParameterSignal.java b/common/buildcraft/transport/statements/TriggerParameterSignal.java index fbbac34b..fed1cfad 100644 --- a/common/buildcraft/transport/statements/TriggerParameterSignal.java +++ b/common/buildcraft/transport/statements/TriggerParameterSignal.java @@ -18,6 +18,7 @@ import buildcraft.api.core.NetworkData; import buildcraft.api.statements.IStatement; import buildcraft.api.statements.IStatementContainer; import buildcraft.api.statements.IStatementParameter; +import buildcraft.api.statements.StatementMouseClick; import buildcraft.api.transport.PipeWire; import buildcraft.core.utils.StringUtils; import buildcraft.transport.Gate; @@ -54,8 +55,8 @@ public class TriggerParameterSignal implements IStatementParameter { } @Override - public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, int mouseButton) { - if (mouseButton == 0) { + public void onClick(IStatementContainer source, IStatement stmt, ItemStack stack, StatementMouseClick mouse) { + if (mouse.getButton() == 0) { if (color == null) { active = true; color = PipeWire.RED;