From a93144f4c0f087362bab9f639f58450eae62d058 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 29 Jun 2026 13:03:34 +0200 Subject: [PATCH 1/4] propane and propane accessories --- .../redstoneoverradio/IRORInteractive.java | 2 +- .../java/com/hbm/inventory/SlotPattern.java | 4 +- .../ContainerPneumoStorageExporter.java | 44 +++++++++++++ .../gui/GUIPneumoStorageExporter.java | 60 ++++++++++++++++++ .../gui/GUIPneumoStorageImporter.java | 2 +- .../TileEntityPneumoStorageExporter.java | 59 ++++++++++++++++- .../hbm/textures/blocks/hopper_turbo_side.png | Bin 0 -> 359 bytes .../blocks/pneumatic_storage_exporter.png | Bin 0 -> 502 bytes .../blocks/pneumatic_storage_importer.png | Bin 417 -> 500 bytes 9 files changed, 164 insertions(+), 7 deletions(-) create mode 100644 src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java create mode 100644 src/main/java/com/hbm/inventory/gui/GUIPneumoStorageExporter.java create mode 100644 src/main/resources/assets/hbm/textures/blocks/hopper_turbo_side.png create mode 100644 src/main/resources/assets/hbm/textures/blocks/pneumatic_storage_exporter.png diff --git a/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java b/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java index 86e5bb59f..518b23c87 100644 --- a/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java +++ b/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java @@ -9,7 +9,7 @@ public interface IRORInteractive extends IRORInfo { public static String EX_NAME = "Exception: Multiple Name Separators"; public static String EX_FORMAT = "Exception: Parameter in Invalid Format"; - /** Runs a function on the ROR component, usually causing the component to change or do something. Returns are optional. */ + /** Runs a function on the ROR component, usually causing the component to change or do something. Returns are unused for now. */ public String runRORFunction(String name, String[] params); /** Extracts the command name from a full command string */ diff --git a/src/main/java/com/hbm/inventory/SlotPattern.java b/src/main/java/com/hbm/inventory/SlotPattern.java index a6957c7ac..a1bdc6c67 100644 --- a/src/main/java/com/hbm/inventory/SlotPattern.java +++ b/src/main/java/com/hbm/inventory/SlotPattern.java @@ -29,7 +29,7 @@ public class SlotPattern extends Slot { @Override public int getSlotStackLimit() { - return 1; + return allowStackSize ? 64 : 1; } @Override @@ -37,7 +37,7 @@ public class SlotPattern extends Slot { if (stack != null) { stack = stack.copy(); - if (!allowStackSize) + if(!allowStackSize) stack.stackSize = 1; } super.putStack(stack); diff --git a/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java b/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java new file mode 100644 index 000000000..95776aa6d --- /dev/null +++ b/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java @@ -0,0 +1,44 @@ +package com.hbm.inventory.container; + +import com.hbm.inventory.SlotPattern; +import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageExporter; + +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; + +public class ContainerPneumoStorageExporter extends ContainerBase { + + public ContainerPneumoStorageExporter(InventoryPlayer invPlayer, TileEntityPneumoStorageExporter exporter) { + super(invPlayer, exporter); + + for(int i = 0; i < 9; i++) { + this.addSlotToContainer(new SlotPattern(exporter, i, 17 + (i % 3) * 18, 17 + (i / 3) * 18, true)); + } + + addSlots(exporter, 9, 80, 17, 3, 3); + playerInv(invPlayer, 103); + } + + @Override + public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) { + + //L/R: 0 + //M3: 3 + //SHIFT: 1 + //DRAG: 5 + + if(index < 0 || index >= 9) { + return super.slotClick(index, button, mode, player); + } + + Slot slot = this.getSlot(index); + ItemStack ret = null; + ItemStack held = player.inventory.getItemStack(); + + if(slot.getHasStack()) ret = slot.getStack().copy(); + slot.putStack(held); + return ret; + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageExporter.java b/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageExporter.java new file mode 100644 index 000000000..2f7001c41 --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageExporter.java @@ -0,0 +1,60 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.opengl.GL11; + +import com.hbm.inventory.container.ContainerPneumoStorageExporter; +import com.hbm.lib.RefStrings; +import com.hbm.tileentity.network.pneumatic.TileEntityPneumoStorageExporter; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.resources.I18n; +import net.minecraft.entity.player.InventoryPlayer; +import net.minecraft.util.ResourceLocation; + +public class GUIPneumoStorageExporter extends GuiInfoContainer { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_pneumatic_exporter.png"); + private TileEntityPneumoStorageExporter importer; + + public GUIPneumoStorageExporter(InventoryPlayer invPlayer, TileEntityPneumoStorageExporter importer) { + super(new ContainerPneumoStorageExporter(invPlayer, importer)); + this.importer = importer; + + this.xSize = 176; + this.ySize = 185; + } + + @Override + public void drawScreen(int x, int y, float interp) { + super.drawScreen(x, y, interp); + } + + @Override + protected void mouseClicked(int x, int y, int i) { + super.mouseClicked(x, y, i); + + clickSendFlag(importer, x, y, 142, 16, 18, 18, "continuous"); + clickSendFlag(importer, x, y, 142, 34, 18, 18, "request"); + clickSendFlag(importer, x, y, 142, 52, 18, 18, "ror"); + } + + @Override + protected void drawGuiContainerForegroundLayer(int i, int j) { + String name = this.importer.hasCustomInventoryName() ? this.importer.getInventoryName() : I18n.format(this.importer.getInventoryName()); + + this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 5, 4210752); + this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752); + } + + @Override + protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); + + if(!this.importer.continuousRequest) drawTexturedModalRect(guiLeft + 142, guiTop + 16, xSize, 0, 18, 18); + if(!this.importer.rorConfiguredMode) drawTexturedModalRect(guiLeft + 142, guiTop + 52, xSize, 18, 18, 18); + if(this.importer.requestMode == importer.MODE_FULL_STACK) drawTexturedModalRect(guiLeft + 142, guiTop + 34, xSize + 18, 0, 18, 18); + if(this.importer.requestMode == importer.MODE_FULL_REQUEST) drawTexturedModalRect(guiLeft + 142, guiTop + 34, xSize + 18, 18, 18, 18); + } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageImporter.java b/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageImporter.java index b55b30e4f..79f7fbcc1 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageImporter.java +++ b/src/main/java/com/hbm/inventory/gui/GUIPneumoStorageImporter.java @@ -22,7 +22,7 @@ public class GUIPneumoStorageImporter extends GuiContainer { this.importer = importer; this.xSize = 176; - this.ySize = 186; + this.ySize = 185; } @Override diff --git a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java index 0bd594d5f..2c01aff94 100644 --- a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java +++ b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java @@ -1,12 +1,18 @@ package com.hbm.tileentity.network.pneumatic; +import com.hbm.interfaces.IControlReceiver; +import com.hbm.inventory.container.ContainerPneumoStorageExporter; +import com.hbm.inventory.gui.GUIPneumoStorageExporter; + import api.hbm.redstoneoverradio.IRORInteractive; +import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; -public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineBase implements IRORInteractive { +public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineBase implements IRORInteractive, IControlReceiver { /** If requests should be pulled repeatedly every tick */ public boolean continuousRequest = false; @@ -14,6 +20,8 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB public boolean rorConfiguredMode = false; /** What strategy to use for handling request filters */ public int requestMode = 0; + /** Item ID and meta pairs for RoR controlled filters */ + public short[][] rorFilters = new short[9][2]; /** Each slot individually tries to pull as much as it can of the configured item */ public static final int MODE_AS_MUCH_AS_POSSIBLE = 0; @@ -34,10 +42,55 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB @Override public void updateEntity() { super.updateEntity(); + + if(!worldObj.isRemote) { + this.networkPackNT(15); + } } - @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } - @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return null; } + @Override + public void serialize(ByteBuf buf) { + super.serialize(buf); + buf.writeBoolean(continuousRequest); + buf.writeBoolean(rorConfiguredMode); + buf.writeByte((byte) requestMode); + for(int i = 0; i < 9; i++) { + buf.writeShort(rorFilters[i][0]); + buf.writeShort(rorFilters[i][1]); + } + } + + @Override + public void deserialize(ByteBuf buf) { + super.deserialize(buf); + this.continuousRequest = buf.readBoolean(); + this.rorConfiguredMode = buf.readBoolean(); + this.requestMode = buf.readByte(); + for(int i = 0; i < 9; i++) { + rorFilters[i][0] = buf.readShort(); + rorFilters[i][1] = buf.readShort(); + } + } + + @Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerPneumoStorageExporter(player.inventory, this); } + @Override public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIPneumoStorageExporter(player.inventory, this); } + + @Override public boolean hasPermission(EntityPlayer player) { return this.isUseableByPlayer(player); } + + @Override + public void receiveControl(NBTTagCompound data) { + if(data.hasKey("continuous")) { + this.continuousRequest = !this.continuousRequest; + } + if(data.hasKey("request")) { + this.requestMode++; + if(this.requestMode >= 3) this.requestMode = 0; + } + if(data.hasKey("ror")) { + this.rorConfiguredMode = !this.rorConfiguredMode; + } + this.markChanged(); + } @Override public String[] getFunctionInfo() { diff --git a/src/main/resources/assets/hbm/textures/blocks/hopper_turbo_side.png b/src/main/resources/assets/hbm/textures/blocks/hopper_turbo_side.png new file mode 100644 index 0000000000000000000000000000000000000000..0704d875bf9b1af94a11e5548646d39624fea56f GIT binary patch literal 359 zcmV-t0hs=YP)!xeV}9xfB*;w zha|I%vzseAfe*kkofq#aU2qT_u}T*JB(n_Hb5JtJHkD5=k9V$aG_L1h@6~q$Y%|N# z{oBqWqfs))YHOlZ4a8wz4@N^efzL9X7bbqGH2@dMXGtTXURUo^Jr4VNvkT#R4kyv1 zAiRuk|4mTk3V`3~Ly444AL&f|(w~w!uIJRaLdhJSKT5>GXjrRk4yVeknYe8$#`W>{ zPfgQ^IP7crdZ*v7&-JEpRkXjvwh6?xfRcH!QZs)O{s3EVdHZP9fI9#H002ovPDHLk FV1i+7nAQLQ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/pneumatic_storage_exporter.png b/src/main/resources/assets/hbm/textures/blocks/pneumatic_storage_exporter.png new file mode 100644 index 0000000000000000000000000000000000000000..90013ac567ac2a6d3c7ac1e50dd4daf28a8757fd GIT binary patch literal 502 zcmVCM&Hq zT5CrAg6)?t_@6D4ITwRnTu$T;T5HP1O%OajodR$=-t)dPNzt8k&X$NAyPvnM7CY5H zZu4u7&(3|)`Nu!J`_bVxza}#kzqfYQ6O8%=<>H3Sb~)=jg&ahL@4r5=Oy<7pVcr8k z2EzVgMrJF_>W;{9eohKGXsuC7u}oshBn>DztZR!p9*CL&B7#y1tu+Vw3g|t+Hm&Ur zC({|@56>9dn5MAq6A^|sW@uwCt}oym%VZvm?UI}3@RR8*oZzw6hV`B|MH3N3BRXIwV zn2R@;1<}P|x4zp?H2aGgU0VPItEzQ+4Ys~qe?Ncql-kW*XQrY|QpzOtB00gFKQmQu sKZ4h2R(Ck07*qoM6N<$f~UpZhX4Qo literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/blocks/pneumatic_storage_importer.png b/src/main/resources/assets/hbm/textures/blocks/pneumatic_storage_importer.png index d9c89f32363be438fbb5ee1e5ba6ac8b1a31ca3a..f6ce9b8c21405f02f881420d1e7a52c907ec2f83 100644 GIT binary patch delta 458 zcmV;*0X6=i1M~xsG=Hl}L_t(Ijir;nYTHm0#(z#kz#)ZfA)Zc$+GHt)4uR0&K0rDI z$=U9`;$OCirrdOov7EpjRFz`>;DE0`ef5a9mw%@K6j6+BJ#jWgoXf3eJF%ue32_w5G&qp;61o3YGhBx%X_&7G$T2A!N@{y zNm?RZe^j=mb)UtjcR9gL_qg8e7s}auOuNcmfWzx?eM1QQ3_3Yf^>Y1u_x|sXDXB`g zVUGOgJPL8uG&x>?boJ;+$z>%07*qoM6N<$f(>8f AxBvhE delta 374 zcmV-+0g3+f1EB+uG=Er0L_t(Ijg^znYQjJe#(ynANkPc1n9~Mqe2skod+1wuv$+X< zlHPnHJ$PtP$Xp~B140%h0kMa4(T>NFdaQfRFa5oWRn zysKIlwSYSw{ls1~lRYBRYSdcuR<7?0K=njbY_E=N-ER#P;PFcGpQsabmAlTiCrJx} zVgFhH8c%g&U~eMAJo8YYBJxdb*b=af-GQCrE%VH)Ycy((9bA$YsIcv9UAi^fpY9CK zGMrSqJrJh(3b!;@vj~QLBHut+E!WrU`@O$V)Em}CGfk7z5=bxSo8%_aooNYt1JywS U#S;p04FCWD07*qoM6N<$f+otRv;Y7A From 97b20770384a6082f20af63dde2eeb094314062e Mon Sep 17 00:00:00 2001 From: Boblet Date: Tue, 30 Jun 2026 15:18:41 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=E3=80=8C=20PETAL=20DANCE=20=E3=80=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- changelog | 12 ++++ src/main/java/api/hbm/ntl/StackCache.java | 6 +- .../java/com/hbm/inventory/SlotPattern.java | 8 +-- .../container/ContainerAutocrafter.java | 2 +- .../ContainerPneumoStorageExporter.java | 2 +- .../com/hbm/inventory/gui/GUIFusionTorus.java | 6 +- .../gui/GUIMachineAssemblyFactory.java | 10 +-- .../gui/GUIMachineAssemblyMachine.java | 10 +-- .../gui/GUIMachineChemicalFactory.java | 10 +-- .../gui/GUIMachineChemicalPlant.java | 8 +-- .../hbm/inventory/gui/GUIMachinePUREX.java | 8 +-- .../inventory/gui/GUIMachinePlasmaForge.java | 10 +-- .../hbm/inventory/gui/GUIMachinePrecAss.java | 8 +-- .../hbm/inventory/recipes/CrucibleRecipe.java | 2 +- .../inventory/recipes/PlasmaForgeRecipe.java | 2 +- .../recipes/loader/GenericRecipe.java | 9 ++- .../java/com/hbm/module/ParseMSES1Ext1.java | 6 ++ .../hbm/module/machine/ModuleMachineBase.java | 17 ++++- .../tileentity/RenderAssemblyFactory.java | 3 +- .../tileentity/RenderAssemblyMachine.java | 3 +- .../tileentity/RenderChemicalPlant.java | 3 +- .../tileentity/RenderFusionPlasmaForge.java | 3 +- .../hbm/render/tileentity/RenderPrecAss.java | 3 +- .../TileEntityMachineAssemblyFactory.java | 5 +- .../TileEntityMachineAssemblyMachine.java | 39 ++++++++-- .../TileEntityMachineChemicalFactory.java | 5 +- .../TileEntityMachineChemicalPlant.java | 5 +- .../machine/TileEntityMachinePUREX.java | 5 +- .../machine/TileEntityMachinePrecAss.java | 5 +- .../fusion/TileEntityFusionPlasmaForge.java | 5 +- .../machine/fusion/TileEntityFusionTorus.java | 2 +- .../TileEntityPneumoStorageExporter.java | 68 +++++++++++++++++- .../textures/gui/processing/gui_chemplant.png | Bin 3594 -> 3643 bytes 33 files changed, 208 insertions(+), 82 deletions(-) diff --git a/changelog b/changelog index b5b39f0d4..0e1a5cf5a 100644 --- a/changelog +++ b/changelog @@ -29,6 +29,18 @@ * Increased the blast furnace's fuel buffer by 50%, allowing coke blocks to be used * If an RoR controller tries to parse an integer, but the supplied string represents a decimal, instead of canceling the operation, the system will now interpret decimals and round them to be integers * This means that the AUTOCAL can now send RoR commands using calculated values directly without the use of `round` or `evalr` +* Assembly machines now support Redstone-over-Radio + * Active state (0 or 1), progress (0-100) and current recipe (internal name) can now be read + * The recipe can be set using a controller + * Do note that setting a recipe that needs a blueprint without that blueprint will not work + * RoR set recipes cause the assembler to go into low power mode, making it run at only 25% speed (visible through the blue progress bar) + * The speed penalty is removed as soon as a recipe is assigned manually again +* The AUTOCAL's script interpreter now runs MS-ES v1.1 (First Extended Instruction Set) + * Allows the use of a global stack, similar to the buffer which can hold 256 values + * Allows splitting of strings and counting of string fragments + * Adds substring operations + * Polling for receiving only fresh RoR signals + * A command for writing the world time to the buffer, allowing for more precise timers ## Fixed * Fixed AUTOCAL's number comparison functions not working with variable substitution as advertised diff --git a/src/main/java/api/hbm/ntl/StackCache.java b/src/main/java/api/hbm/ntl/StackCache.java index 004ead61a..7d941d73c 100644 --- a/src/main/java/api/hbm/ntl/StackCache.java +++ b/src/main/java/api/hbm/ntl/StackCache.java @@ -197,7 +197,11 @@ public class StackCache { public static long getStackIdentity(Item item, int meta, NBTTagCompound nbt) { if(item == null) return getNullIdentity(); - long identity = Item.getIdFromItem(item) * 27644437; + return getStackIdentity(Item.getIdFromItem(item), meta, nbt); + } + + public static long getStackIdentity(int item, int meta, NBTTagCompound nbt) { + long identity = item * 27644437; identity += meta; identity *= 27644437; if(nbt != null) identity += nbt.hashCode(); diff --git a/src/main/java/com/hbm/inventory/SlotPattern.java b/src/main/java/com/hbm/inventory/SlotPattern.java index a1bdc6c67..317424214 100644 --- a/src/main/java/com/hbm/inventory/SlotPattern.java +++ b/src/main/java/com/hbm/inventory/SlotPattern.java @@ -16,10 +16,10 @@ public class SlotPattern extends Slot { public SlotPattern(IInventory inv, int index, int x, int y) { super(inv, index, x, y); } - - public SlotPattern(IInventory inv, int index, int x, int y, boolean allowStackSize) { - super(inv, index, x, y); - this.allowStackSize = allowStackSize; + + public SlotPattern allowStackSize() { + this.allowStackSize = true; + return this; } @Override diff --git a/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java b/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java index 2c8b0438b..8dc57f397 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java +++ b/src/main/java/com/hbm/inventory/container/ContainerAutocrafter.java @@ -24,7 +24,7 @@ public class ContainerAutocrafter extends ContainerBase { this.addSlotToContainer(new SlotPattern(tedf, j + i * 3, 44 + j * 18, 22 + i * 18)); } } - this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40, true)); + this.addSlotToContainer(new SlotPattern(tedf, 9, 116, 40).allowStackSize()); /* RECIPE */ addSlots(tedf,10, 44, 86, 3, 3); diff --git a/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java b/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java index 95776aa6d..4928ba349 100644 --- a/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java +++ b/src/main/java/com/hbm/inventory/container/ContainerPneumoStorageExporter.java @@ -14,7 +14,7 @@ public class ContainerPneumoStorageExporter extends ContainerBase { super(invPlayer, exporter); for(int i = 0; i < 9; i++) { - this.addSlotToContainer(new SlotPattern(exporter, i, 17 + (i % 3) * 18, 17 + (i / 3) * 18, true)); + this.addSlotToContainer(new SlotPattern(exporter, i, 17 + (i % 3) * 18, 17 + (i / 3) * 18).allowStackSize()); } addSlots(exporter, 9, 80, 17, 3, 3); diff --git a/src/main/java/com/hbm/inventory/gui/GUIFusionTorus.java b/src/main/java/com/hbm/inventory/gui/GUIFusionTorus.java index 98e11de61..9e7160305 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIFusionTorus.java +++ b/src/main/java/com/hbm/inventory/gui/GUIFusionTorus.java @@ -41,7 +41,7 @@ public class GUIFusionTorus extends GuiInfoContainer { torus.coolantTanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 188, guiTop + 46, 16, 52); torus.coolantTanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 206, guiTop + 46, 16, 52); - FusionRecipe recipe = (FusionRecipe) FusionRecipes.INSTANCE.recipeNameMap.get(this.torus.fusionModule.recipe); + FusionRecipe recipe = (FusionRecipe) this.torus.fusionModule.getRecipe(); if(recipe != null) { drawCustomInfoStat(mouseX, mouseY, guiLeft + 43, guiTop + 115, 18, 18, mouseX, mouseY, EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(torus.klystronEnergy) + "KyU / " + BobMathUtil.getShortNumber(recipe.ignitionTemp) + "KyU"); @@ -70,7 +70,7 @@ public class GUIFusionTorus extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 43, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(FusionRecipes.INSTANCE, torus, torus.fusionModule.recipe, 0, ItemBlueprints.grabPool(torus.slots[1]), this); + if(this.checkClick(x, y, 43, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(FusionRecipes.INSTANCE, torus, torus.fusionModule.getRecipeName(), 0, ItemBlueprints.grabPool(torus.slots[1]), this); } @Override @@ -103,7 +103,7 @@ public class GUIFusionTorus extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 98, guiTop + 91, 0, 250, j, 6); } - FusionRecipe recipe = FusionRecipes.INSTANCE.recipeNameMap.get(torus.fusionModule.recipe); + FusionRecipe recipe = (FusionRecipe) torus.fusionModule.getRecipe(); // power LED if(recipe != null && torus.power >= recipe.power) drawTexturedModalRect(guiLeft + 160, guiTop + 115, 246, 14, 8, 8); diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyFactory.java b/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyFactory.java index 11f7db844..d08490d19 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyFactory.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyFactory.java @@ -47,8 +47,8 @@ public class GUIMachineAssemblyFactory extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 234, guiTop + 18, 16, 92, assembler.power, assembler.maxPower); for(int i = 0; i < 4; i++) if(guiLeft + 6 + (i % 2) * 109 <= mouseX && guiLeft + 6 + (i % 2) * 109 + 18 > mouseX && guiTop + 53 + (i / 2) * 56 < mouseY && guiTop + 53 + (i / 2) * 56 + 18 >= mouseY) { - if(this.assembler.assemblerModule[i].recipe != null && AssemblyMachineRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule[i].recipe)) { - GenericRecipe recipe = (GenericRecipe) AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(this.assembler.assemblerModule[i].recipe); + if(this.assembler.assemblerModule[i].getRecipeName() != null && AssemblyMachineRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule[i].getRecipeName())) { + GenericRecipe recipe = this.assembler.assemblerModule[i].getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -60,7 +60,7 @@ public class GUIMachineAssemblyFactory extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - for(int i = 0; i < 4; i++) if(this.checkClick(x, y, 6 + (i % 2) * 109, 53 + (i / 2) * 56, 18, 18)) GUIScreenRecipeSelector.openSelector(AssemblyMachineRecipes.INSTANCE, assembler, assembler.assemblerModule[i].recipe, i, ItemBlueprints.grabPool(assembler.slots[4 + i * 14]), this); + for(int i = 0; i < 4; i++) if(this.checkClick(x, y, 6 + (i % 2) * 109, 53 + (i / 2) * 56, 18, 18)) GUIScreenRecipeSelector.openSelector(AssemblyMachineRecipes.INSTANCE, assembler, assembler.assemblerModule[i].getRecipeName(), i, ItemBlueprints.grabPool(assembler.slots[4 + i * 14]), this); } @Override @@ -87,7 +87,7 @@ public class GUIMachineAssemblyFactory extends GuiInfoContainer { } for(int g = 0; g < 4; g++) { - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule[g].recipe); + GenericRecipe recipe = assembler.assemblerModule[g].getRecipe(); /// LEFT LED if(assembler.didProcess[g]) { @@ -105,7 +105,7 @@ public class GUIMachineAssemblyFactory extends GuiInfoContainer { } for(int g = 0; g < 4; g++) { - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule[g].recipe); + GenericRecipe recipe = assembler.assemblerModule[g].getRecipe(); this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 7 + (g % 2) * 109, 54 + (g / 2) * 56); diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyMachine.java b/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyMachine.java index 0e5f8184c..bcb51491b 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyMachine.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineAssemblyMachine.java @@ -42,8 +42,8 @@ public class GUIMachineAssemblyMachine extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 61, assembler.power, assembler.maxPower); if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 125 < mouseY && guiTop + 125 + 18 >= mouseY) { - if(this.assembler.assemblerModule.recipe != null && AssemblyMachineRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule.recipe)) { - GenericRecipe recipe = (GenericRecipe) AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(this.assembler.assemblerModule.recipe); + if(this.assembler.assemblerModule.getRecipeName() != null && AssemblyMachineRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule.getRecipeName())) { + GenericRecipe recipe = this.assembler.assemblerModule.getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -55,7 +55,7 @@ public class GUIMachineAssemblyMachine extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(AssemblyMachineRecipes.INSTANCE, assembler, assembler.assemblerModule.recipe, 0, ItemBlueprints.grabPool(assembler.slots[1]), this); + if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(AssemblyMachineRecipes.INSTANCE, assembler, assembler.assemblerModule.getRecipeName(), 0, ItemBlueprints.grabPool(assembler.slots[1]), this); } @Override @@ -77,10 +77,10 @@ public class GUIMachineAssemblyMachine extends GuiInfoContainer { if(assembler.assemblerModule.progress > 0) { int j = (int) Math.ceil(70 * assembler.assemblerModule.progress); - drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); + drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61 + (assembler.assemblerModule.restrictedMode ? 16 : 0), j, 16); } - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe); + GenericRecipe recipe = assembler.assemblerModule.getRecipe(); /// LEFT LED if(assembler.didProcess) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalFactory.java b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalFactory.java index 885411e82..e20b94d4f 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalFactory.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalFactory.java @@ -47,8 +47,8 @@ public class GUIMachineChemicalFactory extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 224, guiTop + 18, 16, 68, chemplant.power, chemplant.maxPower); for(int i = 0; i < 4; i++) if(guiLeft + 74 <= mouseX && guiLeft + 74 + 18 > mouseX && guiTop + 19 + i * 22 < mouseY && guiTop + 19 + i * 22 + 18 >= mouseY) { - if(this.chemplant.chemplantModule[i].recipe != null && ChemicalPlantRecipes.INSTANCE.recipeNameMap.containsKey(this.chemplant.chemplantModule[i].recipe)) { - GenericRecipe recipe = (GenericRecipe) ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(this.chemplant.chemplantModule[i].recipe); + if(this.chemplant.chemplantModule[i].getRecipeName() != null && ChemicalPlantRecipes.INSTANCE.recipeNameMap.containsKey(this.chemplant.chemplantModule[i].getRecipeName())) { + GenericRecipe recipe = this.chemplant.chemplantModule[i].getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -60,7 +60,7 @@ public class GUIMachineChemicalFactory extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - for(int i = 0; i < 4; i++) if(this.checkClick(x, y, 74, 19 + i * 22, 18, 18)) GUIScreenRecipeSelector.openSelector(ChemicalPlantRecipes.INSTANCE, chemplant, chemplant.chemplantModule[i].recipe, i, ItemBlueprints.grabPool(chemplant.slots[4 + i * 7]), this); + for(int i = 0; i < 4; i++) if(this.checkClick(x, y, 74, 19 + i * 22, 18, 18)) GUIScreenRecipeSelector.openSelector(ChemicalPlantRecipes.INSTANCE, chemplant, chemplant.chemplantModule[i].getRecipeName(), i, ItemBlueprints.grabPool(chemplant.slots[4 + i * 7]), this); } @Override @@ -87,7 +87,7 @@ public class GUIMachineChemicalFactory extends GuiInfoContainer { } for(int g = 0; g < 4; g++) { - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplant.chemplantModule[g].recipe); + GenericRecipe recipe = chemplant.chemplantModule[g].getRecipe(); /// LEFT LED if(chemplant.didProcess[g]) { @@ -105,7 +105,7 @@ public class GUIMachineChemicalFactory extends GuiInfoContainer { } for(int g = 0; g < 4; g++) { // not a great way of doing it but at least we eliminate state leak bullshit - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplant.chemplantModule[g].recipe); + GenericRecipe recipe = chemplant.chemplantModule[g].getRecipe(); this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 75, 20 + g * 22); diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java index bc63a81b5..0f42776f1 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java @@ -43,8 +43,8 @@ public class GUIMachineChemicalPlant extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 61, chemplant.power, chemplant.maxPower); if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 125 < mouseY && guiTop + 125 + 18 >= mouseY) { - if(this.chemplant.chemplantModule.recipe != null && ChemicalPlantRecipes.INSTANCE.recipeNameMap.containsKey(this.chemplant.chemplantModule.recipe)) { - GenericRecipe recipe = (GenericRecipe) ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(this.chemplant.chemplantModule.recipe); + if(this.chemplant.chemplantModule.getRecipe() != null && ChemicalPlantRecipes.INSTANCE.recipeNameMap.containsKey(this.chemplant.chemplantModule.getRecipeName())) { + GenericRecipe recipe = this.chemplant.chemplantModule.getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -56,7 +56,7 @@ public class GUIMachineChemicalPlant extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(ChemicalPlantRecipes.INSTANCE, chemplant, chemplant.chemplantModule.recipe, 0, ItemBlueprints.grabPool(chemplant.slots[1]), this); + if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(ChemicalPlantRecipes.INSTANCE, chemplant, chemplant.chemplantModule.getRecipeName(), 0, ItemBlueprints.grabPool(chemplant.slots[1]), this); } @Override @@ -81,7 +81,7 @@ public class GUIMachineChemicalPlant extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); } - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplant.chemplantModule.recipe); + GenericRecipe recipe = chemplant.chemplantModule.getRecipe(); /// LEFT LED if(chemplant.didProcess) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachinePUREX.java b/src/main/java/com/hbm/inventory/gui/GUIMachinePUREX.java index 2ae922c50..b6f48cbeb 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachinePUREX.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachinePUREX.java @@ -44,8 +44,8 @@ public class GUIMachinePUREX extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 61, purex.power, purex.maxPower); if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 125 < mouseY && guiTop + 125 + 18 >= mouseY) { - if(this.purex.purexModule.recipe != null && PUREXRecipes.INSTANCE.recipeNameMap.containsKey(this.purex.purexModule.recipe)) { - GenericRecipe recipe = (GenericRecipe) PUREXRecipes.INSTANCE.recipeNameMap.get(this.purex.purexModule.recipe); + if(this.purex.purexModule.getRecipe() != null && PUREXRecipes.INSTANCE.recipeNameMap.containsKey(this.purex.purexModule.getRecipe())) { + GenericRecipe recipe = this.purex.purexModule.getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -57,7 +57,7 @@ public class GUIMachinePUREX extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(PUREXRecipes.INSTANCE, purex, purex.purexModule.recipe, 0, ItemBlueprints.grabPool(purex.slots[1]), this); + if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(PUREXRecipes.INSTANCE, purex, purex.purexModule.getRecipeName(), 0, ItemBlueprints.grabPool(purex.slots[1]), this); } @Override @@ -82,7 +82,7 @@ public class GUIMachinePUREX extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); } - GenericRecipe recipe = PUREXRecipes.INSTANCE.recipeNameMap.get(purex.purexModule.recipe); + GenericRecipe recipe = purex.purexModule.getRecipe(); /// LEFT LED if(purex.didProcess) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java b/src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java index 2516072f7..98b9f663c 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java @@ -47,15 +47,15 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 62, forge.power, forge.maxPower); if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 80 < mouseY && guiTop + 80 + 18 >= mouseY) { - if(this.forge.plasmaModule.recipe != null && PlasmaForgeRecipes.INSTANCE.recipeNameMap.containsKey(this.forge.plasmaModule.recipe)) { - GenericRecipe recipe = (GenericRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(this.forge.plasmaModule.recipe); + if(this.forge.plasmaModule.getRecipeName() != null && PlasmaForgeRecipes.INSTANCE.recipeNameMap.containsKey(this.forge.plasmaModule.getRecipeName())) { + GenericRecipe recipe = this.forge.plasmaModule.getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); } } - PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(forge.plasmaModule.recipe); + PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) forge.plasmaModule.getRecipe(); if(recipe != null) { drawCustomInfoStat(mouseX, mouseY, guiLeft + 25, guiTop + 115, 18, 18, mouseX, mouseY, EnumChatFormatting.GREEN + "-> " + EnumChatFormatting.RESET + BobMathUtil.getShortNumber(forge.plasmaEnergySync) + "TU / " + BobMathUtil.getShortNumber(recipe.ignitionTemp) + "TU"); @@ -102,7 +102,7 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 7, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(PlasmaForgeRecipes.INSTANCE, forge, forge.plasmaModule.recipe, 0, ItemBlueprints.grabPool(forge.slots[1]), this); + if(this.checkClick(x, y, 7, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(PlasmaForgeRecipes.INSTANCE, forge, forge.plasmaModule.getRecipeName(), 0, ItemBlueprints.grabPool(forge.slots[1]), this); } @Override @@ -127,7 +127,7 @@ public class GUIMachinePlasmaForge extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 62, guiTop + 81, 176, 62, j, 16); } - PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(forge.plasmaModule.recipe); + PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) forge.plasmaModule.getRecipe(); /// LEFT LED if(forge.didProcess) { diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java b/src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java index 53d04d6f7..aa5a400cf 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java @@ -42,8 +42,8 @@ public class GUIMachinePrecAss extends GuiInfoContainer { this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 61, assembler.power, assembler.maxPower); if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 125 < mouseY && guiTop + 125 + 18 >= mouseY) { - if(this.assembler.assemblerModule.recipe != null && PrecAssRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule.recipe)) { - GenericRecipe recipe = (GenericRecipe) PrecAssRecipes.INSTANCE.recipeNameMap.get(this.assembler.assemblerModule.recipe); + if(this.assembler.assemblerModule.getRecipeName() != null && PrecAssRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule.getRecipeName())) { + GenericRecipe recipe = this.assembler.assemblerModule.getRecipe(); GUIElements.drawHoveringTextRecipe(recipe.print(), mouseX, mouseY, this.fontRendererObj, itemRender, this.width, this.height); } else { this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY); @@ -55,7 +55,7 @@ public class GUIMachinePrecAss extends GuiInfoContainer { protected void mouseClicked(int x, int y, int button) { super.mouseClicked(x, y, button); - if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(PrecAssRecipes.INSTANCE, assembler, assembler.assemblerModule.recipe, 0, ItemBlueprints.grabPool(assembler.slots[1]), this); + if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(PrecAssRecipes.INSTANCE, assembler, assembler.assemblerModule.getRecipeName(), 0, ItemBlueprints.grabPool(assembler.slots[1]), this); } @Override @@ -80,7 +80,7 @@ public class GUIMachinePrecAss extends GuiInfoContainer { drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); } - GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe); + GenericRecipe recipe = assembler.assemblerModule.getRecipe(); /// LEFT LED if(assembler.didProcess) { diff --git a/src/main/java/com/hbm/inventory/recipes/CrucibleRecipe.java b/src/main/java/com/hbm/inventory/recipes/CrucibleRecipe.java index 65d4fa4b4..4c73a4289 100644 --- a/src/main/java/com/hbm/inventory/recipes/CrucibleRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/CrucibleRecipe.java @@ -41,8 +41,8 @@ public class CrucibleRecipe extends GenericRecipe { @Override public List print() { List list = new ArrayList(); - list.add(EnumChatFormatting.YELLOW + this.getLocalizedName()); + header(list); input(list); output(list); diff --git a/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipe.java b/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipe.java index 4637b8bd0..8183f941c 100644 --- a/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/PlasmaForgeRecipe.java @@ -23,8 +23,8 @@ public class PlasmaForgeRecipe extends GenericRecipe { public List print() { List list = new ArrayList(); - list.add(EnumChatFormatting.YELLOW + this.getLocalizedName()); + header(list); autoSwitch(list); duration(list); power(list); diff --git a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java index 40ee9bf27..4f8a49eb5 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipe.java @@ -4,6 +4,8 @@ import java.util.ArrayList; import java.util.List; import java.util.Locale; +import org.lwjgl.input.Keyboard; + import com.hbm.config.GeneralConfig; import com.hbm.inventory.FluidStack; import com.hbm.inventory.RecipesCommon.AStack; @@ -148,8 +150,8 @@ public class GenericRecipe { public List print() { List list = new ArrayList(); - list.add(EnumChatFormatting.YELLOW + this.getLocalizedName()); + header(list); autoSwitch(list); duration(list); power(list); @@ -159,6 +161,11 @@ public class GenericRecipe { return list; } + protected void header(List list) { + list.add(EnumChatFormatting.YELLOW + this.getLocalizedName()); + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) list.add(EnumChatFormatting.DARK_GRAY + "Internal: " + this.getInternalName()); + } + protected void autoSwitch(List list) { if(this.autoSwitchGroup != null) { String[] lines = I18nUtil.resolveKeyArray("autoswitch", I18nUtil.resolveKey(this.autoSwitchGroup)); diff --git a/src/main/java/com/hbm/module/ParseMSES1Ext1.java b/src/main/java/com/hbm/module/ParseMSES1Ext1.java index db4a3bc48..875c136b0 100644 --- a/src/main/java/com/hbm/module/ParseMSES1Ext1.java +++ b/src/main/java/com/hbm/module/ParseMSES1Ext1.java @@ -120,6 +120,12 @@ public class ParseMSES1Ext1 extends ParseMSES1 { return EnumStatementReturn.OK; } + // writes the total world time to the buffer + if(lower.equals("worldtime")) { + ctx.writeBuffer("" + ctx.world.getTotalWorldTime()); + return EnumStatementReturn.OK; + } + return super.eval(ctx, line); } } diff --git a/src/main/java/com/hbm/module/machine/ModuleMachineBase.java b/src/main/java/com/hbm/module/machine/ModuleMachineBase.java index 311a236fa..d75608786 100644 --- a/src/main/java/com/hbm/module/machine/ModuleMachineBase.java +++ b/src/main/java/com/hbm/module/machine/ModuleMachineBase.java @@ -25,11 +25,12 @@ public abstract class ModuleMachineBase { public FluidTank[] inputTanks; public FluidTank[] outputTanks; // running vars - public String recipe = "null"; + protected String recipe = "null"; public double progress; // return signals public boolean didProcess = false; public boolean markDirty = false; + public boolean restrictedMode = false; public ModuleMachineBase(int index, IEnergyHandlerMK2 battery, ItemStack[] slots) { this.index = index; @@ -114,6 +115,7 @@ public abstract class ModuleMachineBase { } public void process(GenericRecipe recipe, double speed, double power) { + if(this.restrictedMode) speed *= 0.25; // RoR controlled machines have a speed penalty this.battery.setPower(this.battery.getPower() - (power == 1 ? recipe.power : (long) (recipe.power * power))); double step = Math.min(speed / recipe.duration, 1D); // can't do more than one recipe per tick, might look into that later @@ -167,11 +169,20 @@ public abstract class ModuleMachineBase { this.markDirty = true; } + + public String getRecipeName() { + return this.recipe; + } public GenericRecipe getRecipe() { return (GenericRecipe) getRecipeSet().recipeNameMap.get(this.recipe); } + public void setRecipe(String name, boolean ror) { + this.recipe = name; + this.restrictedMode = ror; + } + public abstract GenericRecipes getRecipeSet(); public void update(double speed, double power, boolean extraCondition, ItemStack blueprint) { @@ -232,21 +243,25 @@ public abstract class ModuleMachineBase { public void serialize(ByteBuf buf) { buf.writeDouble(progress); + buf.writeBoolean(restrictedMode); ByteBufUtils.writeUTF8String(buf, recipe); } public void deserialize(ByteBuf buf) { this.progress = buf.readDouble(); + this.restrictedMode = buf.readBoolean(); this.recipe = ByteBufUtils.readUTF8String(buf); } public void readFromNBT(NBTTagCompound nbt) { this.progress = nbt.getDouble("progress" + index); this.recipe = nbt.getString("recipe" + index); + this.restrictedMode = nbt.getBoolean("restrictedMode"); } public void writeToNBT(NBTTagCompound nbt) { nbt.setDouble("progress" + index, progress); nbt.setString("recipe" + index, recipe); + nbt.setBoolean("restrictedMode", restrictedMode); } } diff --git a/src/main/java/com/hbm/render/tileentity/RenderAssemblyFactory.java b/src/main/java/com/hbm/render/tileentity/RenderAssemblyFactory.java index 06cdbf265..1bb80d9f0 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderAssemblyFactory.java +++ b/src/main/java/com/hbm/render/tileentity/RenderAssemblyFactory.java @@ -4,7 +4,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; -import com.hbm.inventory.recipes.AssemblyMachineRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.main.MainRegistry; import com.hbm.main.ResourceManager; @@ -162,7 +161,7 @@ public class RenderAssemblyFactory extends TileEntitySpecialRenderer implements GL11.glRotated(90, 0, 1, 0); GL11.glTranslated(0, 1.0625, 0); - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assemfac.assemblerModule[i].recipe); + GenericRecipe recipe = assemfac.assemblerModule[i].getRecipe(); if(recipe != null) { ItemStack stack = recipe.getIcon(); stack.stackSize = 1; diff --git a/src/main/java/com/hbm/render/tileentity/RenderAssemblyMachine.java b/src/main/java/com/hbm/render/tileentity/RenderAssemblyMachine.java index 17eba939c..9b7407644 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderAssemblyMachine.java +++ b/src/main/java/com/hbm/render/tileentity/RenderAssemblyMachine.java @@ -4,7 +4,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; -import com.hbm.inventory.recipes.AssemblyMachineRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.main.MainRegistry; import com.hbm.main.ResourceManager; @@ -99,7 +98,7 @@ public class RenderAssemblyMachine extends TileEntitySpecialRenderer implements GL11.glShadeModel(GL11.GL_FLAT); - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe); + GenericRecipe recipe = assembler.assemblerModule.getRecipe(); if(recipe != null && MainRegistry.proxy.me().getDistanceSq(tileEntity.xCoord + 0.5, tileEntity.yCoord + 1, tileEntity.zCoord + 0.5) < 35 * 35) { GL11.glRotated(90, 0, 1, 0); diff --git a/src/main/java/com/hbm/render/tileentity/RenderChemicalPlant.java b/src/main/java/com/hbm/render/tileentity/RenderChemicalPlant.java index bd7657a69..4581d0475 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderChemicalPlant.java +++ b/src/main/java/com/hbm/render/tileentity/RenderChemicalPlant.java @@ -7,7 +7,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.inventory.FluidStack; -import com.hbm.inventory.recipes.ChemicalPlantRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.main.ResourceManager; import com.hbm.render.item.ItemRenderBase; @@ -39,7 +38,7 @@ public class RenderChemicalPlant extends TileEntitySpecialRenderer implements II TileEntityMachineChemicalPlant chemplant = (TileEntityMachineChemicalPlant) tileEntity; float anim = chemplant.prevAnim + (chemplant.anim - chemplant.prevAnim) * interp; - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplant.chemplantModule.recipe); + GenericRecipe recipe = chemplant.chemplantModule.getRecipe(); bindTexture(ResourceManager.chemical_plant_tex); ResourceManager.chemical_plant.renderPart("Base"); diff --git a/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java b/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java index 53cceadc8..9f50fc801 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java +++ b/src/main/java/com/hbm/render/tileentity/RenderFusionPlasmaForge.java @@ -5,7 +5,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; import com.hbm.inventory.fluid.Fluids; -import com.hbm.inventory.recipes.PlasmaForgeRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.main.MainRegistry; import com.hbm.main.ResourceManager; @@ -62,7 +61,7 @@ public class RenderFusionPlasmaForge extends TileEntitySpecialRenderer implement bindTexture(ResourceManager.fusion_plasma_forge_tex); ResourceManager.fusion_plasma_forge.renderPart("Body"); - GenericRecipe recipe = PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(forge.plasmaModule.recipe); + GenericRecipe recipe = forge.plasmaModule.getRecipe(); renderPlasma(forge); renderItem(forge, recipe, interp); diff --git a/src/main/java/com/hbm/render/tileentity/RenderPrecAss.java b/src/main/java/com/hbm/render/tileentity/RenderPrecAss.java index de84b54a4..e7a6cc2b3 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderPrecAss.java +++ b/src/main/java/com/hbm/render/tileentity/RenderPrecAss.java @@ -4,7 +4,6 @@ import org.lwjgl.opengl.GL11; import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.ModBlocks; -import com.hbm.inventory.recipes.PrecAssRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.main.MainRegistry; import com.hbm.main.ResourceManager; @@ -71,7 +70,7 @@ public class RenderPrecAss extends TileEntitySpecialRenderer implements IItemRen GL11.glShadeModel(GL11.GL_FLAT); - GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe); + GenericRecipe recipe = assembler.assemblerModule.getRecipe(); if(recipe != null && MainRegistry.proxy.me().getDistanceSq(tileEntity.xCoord + 0.5, tileEntity.yCoord + 1, tileEntity.zCoord + 0.5) < 35 * 35) { GL11.glRotated(90, 0, 1, 0); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java index 20b1e4a33..2324ba300 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java @@ -12,7 +12,6 @@ import com.hbm.inventory.container.ContainerMachineAssemblyFactory; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachineAssemblyFactory; -import com.hbm.inventory.recipes.AssemblyMachineRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -158,7 +157,7 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl long nextMaxPower = 0; for(int i = 0; i < 4; i++) { - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assemblerModule[i].recipe); + GenericRecipe recipe = assemblerModule[i].getRecipe(); if(recipe != null) { nextMaxPower += recipe.power * 100; } @@ -374,7 +373,7 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl int index = data.getInteger("index"); String selection = data.getString("selection"); if(index >= 0 && index < 4) { - this.assemblerModule[index].recipe = selection; + this.assemblerModule[index].setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java index 721cd9031..0592ad79e 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java @@ -11,7 +11,6 @@ import com.hbm.inventory.container.ContainerMachineAssemblyMachine; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachineAssemblyMachine; -import com.hbm.inventory.recipes.AssemblyMachineRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -30,6 +29,8 @@ import com.hbm.util.i18n.I18nUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORInteractive; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -41,7 +42,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider { +public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IRORValueProvider, IRORInteractive { public FluidTank inputTank; public FluidTank outputTank; @@ -88,7 +89,7 @@ public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase impl if(!worldObj.isRemote) { - GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assemblerModule.recipe); + GenericRecipe recipe = assemblerModule.getRecipe(); if(recipe != null) { this.maxPower = recipe.power * 100; } @@ -303,7 +304,7 @@ public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase impl int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.assemblerModule.recipe = selection; + this.assemblerModule.setRecipe(selection, false); this.markChanged(); } } @@ -482,4 +483,34 @@ public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase impl }; } } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress", + PREFIX_VALUE + "recipe", + PREFIX_VALUE + "active", + PREFIX_FUNCTION + "setrecipe" + NAME_SEPARATOR + "name", + }; + } + + @Override + public String provideRORValue(String name) { + if("progress".equals(name)) return "" + (int) Math.round(this.assemblerModule.progress * 100); + if("recipe".equals(name)) return this.assemblerModule.getRecipeName(); + if("active".equals(name)) return "" + (this.didProcess ? 1 : 0); + return null; + } + + @Override + public String runRORFunction(String name, String[] params) { + + if("setrecipe".equals(name) && params.length == 1) { + this.assemblerModule.setRecipe(params[0], true); + this.markChanged(); + return null; + } + + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java index 8f0e8a905..2f1c80eb4 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java @@ -10,7 +10,6 @@ import com.hbm.inventory.container.ContainerMachineChemicalFactory; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachineChemicalFactory; -import com.hbm.inventory.recipes.ChemicalPlantRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -158,7 +157,7 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl long nextMaxPower = 0; for(int i = 0; i < 4; i++) { - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplantModule[i].recipe); + GenericRecipe recipe = chemplantModule[i].getRecipe(); if(recipe != null) { nextMaxPower += recipe.power * 100; } @@ -400,7 +399,7 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl int index = data.getInteger("index"); String selection = data.getString("selection"); if(index >= 0 && index < 4) { - this.chemplantModule[index].recipe = selection; + this.chemplantModule[index].setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java index b4c730928..50e779f1c 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java @@ -10,7 +10,6 @@ import com.hbm.inventory.container.ContainerMachineChemicalPlant; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachineChemicalPlant; -import com.hbm.inventory.recipes.ChemicalPlantRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -86,7 +85,7 @@ public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implem if(!worldObj.isRemote) { - GenericRecipe recipe = ChemicalPlantRecipes.INSTANCE.recipeNameMap.get(chemplantModule.recipe); + GenericRecipe recipe = chemplantModule.getRecipe(); if(recipe != null) { this.maxPower = recipe.power * 100; } @@ -278,7 +277,7 @@ public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implem int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.chemplantModule.recipe = selection; + this.chemplantModule.setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java index 0aca4f5b6..6f20e2e69 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java @@ -10,7 +10,6 @@ import com.hbm.inventory.container.ContainerMachinePUREX; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachinePUREX; -import com.hbm.inventory.recipes.PUREXRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -80,7 +79,7 @@ public class TileEntityMachinePUREX extends TileEntityMachineBase implements IEn if(!worldObj.isRemote) { - GenericRecipe recipe = PUREXRecipes.INSTANCE.recipeNameMap.get(purexModule.recipe); + GenericRecipe recipe = purexModule.getRecipe(); if(recipe != null) { this.maxPower = recipe.power * 100; } @@ -235,7 +234,7 @@ public class TileEntityMachinePUREX extends TileEntityMachineBase implements IEn int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.purexModule.recipe = selection; + this.purexModule.setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePrecAss.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePrecAss.java index b8429c2e5..c441bff3e 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePrecAss.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePrecAss.java @@ -10,7 +10,6 @@ import com.hbm.inventory.container.ContainerMachinePrecAss; import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachinePrecAss; -import com.hbm.inventory.recipes.PrecAssRecipes; import com.hbm.inventory.recipes.loader.GenericRecipe; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemMachineUpgrade; @@ -93,7 +92,7 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I if(!worldObj.isRemote) { - GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assemblerModule.recipe); + GenericRecipe recipe = assemblerModule.getRecipe(); if(recipe != null) { this.maxPower = recipe.power * 100; } @@ -352,7 +351,7 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.assemblerModule.recipe = selection; + this.assemblerModule.setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java index 9d8cf978c..3ac9468d1 100644 --- a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java @@ -16,7 +16,6 @@ import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.tank.FluidTank; import com.hbm.inventory.gui.GUIMachinePlasmaForge; import com.hbm.inventory.recipes.PlasmaForgeRecipe; -import com.hbm.inventory.recipes.PlasmaForgeRecipes; import com.hbm.items.ModItems; import com.hbm.lib.Library; import com.hbm.main.MainRegistry; @@ -156,7 +155,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement if(receiverNode != null && receiverNode.hasValidNet()) receiverNode.net.addReceiver(this); if(providerNode != null && providerNode.hasValidNet()) providerNode.net.addProvider(this); // technically unused, but good to have when we do something else with the plasma nets - PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(plasmaModule.recipe); + PlasmaForgeRecipe recipe = (PlasmaForgeRecipe) plasmaModule.getRecipe(); if(recipe != null) this.maxPower = recipe.power * 100; this.maxPower = BobMathUtil.max(this.power, this.maxPower, 100_000); @@ -364,7 +363,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.plasmaModule.recipe = selection; + this.plasmaModule.setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java index 9208fab1f..b278623fe 100644 --- a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java @@ -473,7 +473,7 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP int index = data.getInteger("index"); String selection = data.getString("selection"); if(index == 0) { - this.fusionModule.recipe = selection; + this.fusionModule.setRecipe(selection, false); this.markChanged(); } } diff --git a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java index 2c01aff94..b639fbb56 100644 --- a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java +++ b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java @@ -4,7 +4,9 @@ package com.hbm.tileentity.network.pneumatic; import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.container.ContainerPneumoStorageExporter; import com.hbm.inventory.gui.GUIPneumoStorageExporter; +import com.hbm.tileentity.network.RTTYSystem; +import api.hbm.ntl.StackCache.CacheSlot; import api.hbm.redstoneoverradio.IRORInteractive; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; @@ -20,8 +22,8 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB public boolean rorConfiguredMode = false; /** What strategy to use for handling request filters */ public int requestMode = 0; - /** Item ID and meta pairs for RoR controlled filters */ - public short[][] rorFilters = new short[9][2]; + /** Item ID and meta pairs with amount for RoR controlled filters */ + public short[][] rorFilters = new short[9][3]; /** Each slot individually tries to pull as much as it can of the configured item */ public static final int MODE_AS_MUCH_AS_POSSIBLE = 0; @@ -47,6 +49,23 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB this.networkPackNT(15); } } + + public void doRequest(boolean force) { + + } + + public void requestSlot(int slot, boolean force) { + + } + + public long getAvailability(int item, int meta) { + if(this.cache == null || this.cache.hasExpired) return 0; + long hash = this.cache.getStackIdentity(item, meta, null); + if(hash == this.cache.getNullIdentity()) return 0; + CacheSlot slot = this.cache.cacheSlots.get(hash); + if(slot == null) return 0; + return slot.stacksize; + } @Override public void serialize(ByteBuf buf) { @@ -57,6 +76,7 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB for(int i = 0; i < 9; i++) { buf.writeShort(rorFilters[i][0]); buf.writeShort(rorFilters[i][1]); + buf.writeShort(rorFilters[i][2]); } } @@ -69,6 +89,7 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB for(int i = 0; i < 9; i++) { rorFilters[i][0] = buf.readShort(); rorFilters[i][1] = buf.readShort(); + rorFilters[i][2] = buf.readShort(); } } @@ -96,7 +117,7 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB public String[] getFunctionInfo() { return new String[] { PREFIX_FUNCTION + "setfilter" + NAME_SEPARATOR + "slot" + PARAM_SEPARATOR + "itemid" + PARAM_SEPARATOR + "itemmeta" + PARAM_SEPARATOR + "amount", - PREFIX_FUNCTION + "setcontinuous" + NAME_SEPARATOR + "slot" + PARAM_SEPARATOR + "itemid" + PARAM_SEPARATOR + "itemmeta" + PARAM_SEPARATOR + "amount", + PREFIX_FUNCTION + "setcontinuous" + NAME_SEPARATOR + "on/off", PREFIX_FUNCTION + "request", PREFIX_FUNCTION + "requestslot" + NAME_SEPARATOR + "slot", PREFIX_FUNCTION + "checkavailability" + NAME_SEPARATOR + "itemid" + PARAM_SEPARATOR + "itemmeta" + PARAM_SEPARATOR + "returnchannel", @@ -105,6 +126,47 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB @Override public String runRORFunction(String name, String[] params) { + + if("setfilter".equals(name) && params.length == 4) { + int slot = IRORInteractive.parseInt(params[0], 1, 9) - 1; + int itemId = IRORInteractive.parseInt(params[1], 0, Short.MAX_VALUE); + int meta = IRORInteractive.parseInt(params[2], 0, Short.MAX_VALUE); + int amount = IRORInteractive.parseInt(params[3], 1, 64); + + this.rorFilters[slot][0] = (short) itemId; + this.rorFilters[slot][1] = (short) meta; + this.rorFilters[slot][2] = (short) amount; + this.markChanged(); + return null; + } + + if("setcontinuous".equals(name) && params.length == 1) { + if("on".equals(params[0])) this.continuousRequest = true; + if("off".equals(params[0])) this.continuousRequest = false; + this.markChanged(); + return null; + } + + if("request".equals(name)) { + this.doRequest(true); + return null; + } + + if("requestslot".equals(name) && params.length == 1) { + int slot = IRORInteractive.parseInt(params[0], 1, 9) - 1; + this.requestSlot(slot, true); + return null; + } + + if("checkavailability".equals(name) && params.length == 3) { + int itemId = IRORInteractive.parseInt(params[0], 0, Short.MAX_VALUE); + int meta = IRORInteractive.parseInt(params[1], 0, Short.MAX_VALUE); + String ret = params[2]; + long availability = this.getAvailability(itemId, meta); + RTTYSystem.broadcast(worldObj, ret, availability + ""); + return null; + } + return null; } } diff --git a/src/main/resources/assets/hbm/textures/gui/processing/gui_chemplant.png b/src/main/resources/assets/hbm/textures/gui/processing/gui_chemplant.png index 3ce1bc32c7c7bc336caa829c6559d5caf3a9c325..b5435bfee38adf0d566ca4428fd6868d169fc1a0 100644 GIT binary patch literal 3643 zcmbtXXH-+!7QP83AVX+2YCto9B7HHWB_kOJe=!Je{Z{4|>z$3Brc}nF*>L8tkBU^fDad3#fO&_crs|>Tg$Zh6sIC92) zUX4Uu3!0&qhpuf!kQ!?k)c%ICgz$@g^AzEQol7}Vw!Re-ooA}IoLwfc;;JetZmvFa zBlQvBs>KaqVH--Fb^_0iUF@M)+s^_u-oc}{yBII)XqnojpI5%m`R zv@trO8;2NN)Jw;NWOg;Rw!RzlqNat@dBwdodGxz+QPmp6I>&N}Hpgnq4{Au@^-Xj# zo8o$M7t2?z<>B%1IltcIqFagp_{w*N!T2;uTN@4N#rflz6Mck>xOyA%XMs9w=mq6z$TOibsxIti22RJC7<6D~4E3-hkJdIzt&t6G?Q~ z+}xMfG@7Z=1QHSQX6^R_yy@O+a+}>H(-pvNfPlWR@Ud4aD|DyBgHW=(VUWJ%HBC?7 znosa2Y+rny5;ta+g)8Ah^v(h^?emW4OYl>yUyJ2&4Wilevpvn6S_L*Pi_Su-fLe@} zhnIc%SlQ<|3&o6QJ-V{zjOAg&IWJjxXPTav=u5k-7?BK&e}ZhX#@cx4nbRY`PsYlC zpYfZv0X6cezx|cG1PitOnG5cPitAnIUi3P;+4{P<9w$qU1YWvz9!NdSKmHZ0wZBwJ9{ zKMUA#3`>1hBr2(+2qm}`0-T7&$XUS*`Lqd_z%V09#Jk@}^b-BwSX!7YAxu-){>IW9 zI1{qyWhR-=pTLGA6p4>=nOjo$jm-aV%@rX^YHD(6z|@Teo*&q`t-#GjK~mCdUV&n> zK@=7HTq#U39GctZ{c|mEZO6O6sB>SeRDPMaTB|822A3xO8 zydt2yu>Tp_JgZbAk4am#*p9oMr2{Gb{Jhu0sj}AhLJPSoWu=3(ZIAHdi?oYC#=AI| ziCeqkBL|m60Bc91IxcG!h=@y;1Osb}nH~3b2j?XrkmdWmympRL*>t^E7K#`>7bznC zY=7Bo;Z-=Vz-<8YHboMW=ldd0B;QE;$Td{!Pd?An(iA> z_K&f+x8EoB<)UrBe+7n12FjMrOa=_8*SVJWhJM2yz)n>Y)_r=+v<*ABumVJrbh`&~ zyZ17Aab>*y#%bY1clRXjXtnSI9S62cSGI+hExBu?Hu{dQS@zL{)nw?K9}QYpWn^Ks z(HM6_rpP))O;}wLEhwMw7{nvdVzHJRDsOIRk=b*5@~Di~DW8o^S_h?BC;sj2`fFra zb-tD-Xrx;8s-SD$!!Z|>P!J_lMXcXfiTm{#=_3%7rhC>=6TLr_xt12|cK?9|TeIwIJ~ zsH}^|Kz4VYJ2Jd-E<1U%yhv+^)N^A78t$w0b1LPLzG zqy@7mF~Fi^-gl^i>sIFp9N;uiF$;8_;|G+^hxcNjm>Xt%I=0{I?XC4y^CoZgf%Ry{ z17Uc?iAjm}>5q1P`4zt!_fDYvT#J+ngYo2;VsNi@e%OJwp(-j)fHN++ay42o`IL zMnk%_#sbP_W@|o7zg`Z)L8;;p1@dBV*}Q}Jtc|V#Su}<1S>(F~@Z^#eov%;*Usnjhem=Ldx9&4CaZDF~e>t&}2q{%Lt* zc>GjRA9&oKZ$6gB<|zpGJV*{Q<*(hYyP~Y3GI!mwN-yV1aj5kPf|~N?ebwOAxn`f7 zoE&R6n}s=q%1@72O|1LV)hb?qm@O{?A?}-8IWi70rm7J!tE;PSJHyU5RKw;Ji}TL1 zPc#jsy`Kfvml5*GZF30!a)H#ev_gELf#1w~H*_(T>fWyw=t7?#;4+%5P=q*aR2HKl zdO07&caAkSHljt~lork?TFdOu*!Q1yOt&kDqtTeWG;JE1AlO8YR7~#(ry5Em+`Sn8 zHo&JaYhYmDLNGR;<7w8RA@)`wLUq@{#u)G}v5gN6y6)WL)^9W?vzJOW>5jafrP#CLT#j{|QS@XZ%7$CrMyFekH{t%~9KH zc$**vKoxY;ehw?r?@0r+xn%K&FzI?ccK45~LQo#KC9Un*18DI6wKi+cr(+?91CqcO zK+j4xEbdP_Yv;LypBwR#j^$!x(Nn6#E+_lS%1UbwcIX(mX}MyxzDgwn1J=st&iUhP zA1NF@jb7Nj-VljT`H4xE{Nxc=TKSXMqoK;<{KURVr034|R>N#(;h*+KR%XYn*Z!b` zS&?iHJ!zTBsxV3yV4}VRI3!@jca$q8aH6%NA^9B0TognEfe0Wp7eu8>VENk>e2E9b zmci5<@suumY`{@J5|^nL^@>KXE)%mn6tJyU@$vzXhERRA6&_JqR@QiSj>us(4XM(F z8n_1sSCXhE~Fk#tg`iojG#7a&k0x;*td{LL>gj>5#0gR4_zMiAivwlE^Jc`@Z z3s!L5lt=opo}@$GLeV3Cc@JMNua`H24KJSybbcm`8D2l;yqWa6E$FCF=;2iVsZJSV zAQFSsZYbz7M9v&u$6_1q7T+DQAZ*On?>m|E< zkveoZxX&=a*Vo?RVWIw8c3nCfd6C8IUb#F6arGWRjQpqea8Q&nJY2iMGCxRhm9wcL zi!|q2w-;EJRkhT)WO3Hc4TKV7VLW1=NQdO4BfMP_>dUSs*Yg6AhdKY9nN8z>fQ7*l zFlJyV$Alpq#oc=1(ueNW!a=c=17XtI87W{!XlrXbIG~gCS_i51&!U*q)gs`j0QdP( z%Xvgio!L{mb2G^Xtu{NJJ3WkCjd`7U13Nq;&TLp%Z= zh!GOIMT%LdcwfH9VocbwMSk~=&VwEmVRqNN6H{)&H30GJ$bV`1`}7o-Cdi8U`|b>0 zGamLl3>d dAON)uZ1b2l$|_N+G-H|S!)obk7OLC*_8-!_kp2Jw literal 3594 zcmb7GdpMNa8eiX-T*9c0Qm&ztsEAS%#w~Q2Fer48dz4GNRKiTn-kYRmu+x^?ghEmn z6D5}lC6^gBXvnq8h#5qhX&BBo0RX{M2uO;Dh}y*uM6TcI{mAq8 zuJT9oEf3kN&%YZNHjnpbn$CR;>u*u3<+zMYbyf-A%zx*9y@K6|eEf%c^q)NfZL+$m zDvh@58~@9D*0)){kSqJ3Z=kv;4qtL8faKMkAHfa1+|&4!B%7sfUP^qPUzCg~lBi8% z&CS)sOm`f9lr}x7t|?zPS`=3sd5S@=T2=j^_WQ#tTtdm4sd3IzqQs81S9e@Rp4g+d zv&J-~sXj6?k~2AJNcXh`_<0^@5I?`>(J_ypbx|s_Z~dYL4bL(z@SoZq?w2;<>!dVs zB2xW3$9W+q>7@Qz+$ej()lYyNQI-)82-u;53L&ZF>K8ewBk*JiL{U#bQtF&TOke=}YeQS{8n7c-_k& zBV8|XnaA>BvHY+A*yU;zpRozT5lpP*ieHtr{PBG7*{=T-Hr@dd1(35*jBrC!)d!}4Rvb9@jFbp+ z9K9-FY7LRysW`ECOIeK-T97`BwXzsG;8k1L;rWGnCZ+CSeV~T}GLdQ!)fGuj zo=o%YNV8sod&f~MJ|)_MYZJrt|+}F|e@a4R%tcJKT0aKVj2o`pC zCW)vI4FPBJO!yrF+O#o9AUIaaQ8e3TZ^En%nk_{ip^i}r2C54*-}PC(B5p0Fd66SH zHV3hwG!aMg2}L4Yr>%>2yW0x#}&MC|>RBmR^A(FI<#7I<-aCn4IgT}+!2 z^b@ZO?Elao(#2%Z+IxDdeP`5b)P?(*-S##jm&e6;P`z6^*s{fw)zDB>;8jv}!S;Tp z^Ed}5Dv$0u1&y}GVeVL8n(3DDqf`AJ{`1dy+@YcC&S)?E6t}U<TnGch zifG4#?N^=9g$wyBj8N3ThJSV9+68m-7K$LRF$P5Bybdh=)n$!)DDH>cCiu|dE-d$s zq*-;aN|z$D7n$@Zl~q7HI{sd>>4$~-SNKZRX?oQ#5*FWn`|YmlKY(0L!p~!w=Hody zihJq4lX0%1@O@$?E3$eG(}kn0ruQdj^{G!9=}dvAhxybSUX;tw>g&L%bzR2~3l_ZK zL(nI>wn3mGEfO3GCV@|El0o1q(ND4h1f9q)*i<(*mN~qy%pFb8p~=_HZbL^7-)Eu* zq;R0Fl%nZI3&5xES(JG#xS(1D6n8G;>8JP(0H~E!K zoZ;9((_q?-tp!)QH)~?w zOm6^9NdQ4chQA>LL=rMQrLubE#!r~6n%ESM`!2@%3Ms%%ubs!wxemC{bI*s$V-~tb z9jmrx2yDfF=(@{p*Q=1CY(dS1H}}n<)ks}tbUTWwHUX&2P8SQdkzF46Yco*y5zh5b z)k9$dGd^0?cp6(`+_iyG@Z1~x$gEzNPUtEeD8G{-xg+N4Cj$h=*QagZ`5>8!m%e1a z_8w}fiMQN8JiW7Zlx+(sKNEAQ?djlqKYMRhwQwqsC!#`H%G*P3E{(e0<-I@sSgueQgEooo zerrcL*TxY@5Knyyqj%4Mho9vP(hhLcBWd!PnVI@Aq3HtV?Iu4T*lJ`rpQ*Oz967Jm z#TdFP>~%{6jqf9p&0jS&U7ns14o5l-2_}QxQjNdyZq{z4Jkey7vD=?q4HHi=^~L7D z@k2Ymx}965ccnK&`FL2^gLcPXHY1L+63&XPl9-#d@W|SU5*M49dfxEtbs3uhAIaD2 zGeN2<|98D+T}6_~uyKhdc|()(#aBG?q5Lfpdki7U9{f9pFm4ozlBw(kujA@)}4+T&$<3XEbU%SqV;? z{Z*KPQZARvYHG4)&=oHeclk~&zF5d)XT&z?{RkC)x6jz{`<8yxBc%7kT~d3Z`QhJo zmxmawy}sJ@)s317oqLjb2MwXW^ba92zEsG=p(Y;$0f+6q=R!_z{%S^G(P5N%G^v3P zAM&R5haTj}xTQuk+!BM;0#71_c{8VqzUMKx$s;5n0zc|Dh zm?-6rk58e{br(al2o?4Ngn2cbDmL!dx4JHAl#EN^<(C!D6ELl}#Qz(>|M0i8y&2JdEgBsJUo4{Wo+MMn z6`7;@J@UxPf?dpi>(GB2`jV-inDn*L=uQfgXmzX7TtSIfy!iUqPu;j!A5o^eZ2^&@ z(&rL*`m(|*;_8R@2+1ZQ% zL>v4x?dz>Ni|$>afm~K+^a^T0vzBY9NZ=9k5|?PYkc+__UQ~7VHdyQXmfn~C3F=yt AKmY&$ From 2cef5bf006c1effee74319d295fce1a99cdca137 Mon Sep 17 00:00:00 2001 From: Boblet Date: Wed, 1 Jul 2026 10:16:09 +0200 Subject: [PATCH 3/4] 3 hours of sleep let's fucking go --- changelog | 5 +-- .../gui/GUIMachineChemicalPlant.java | 2 +- .../TileEntityMachineAssemblyFactory.java | 33 +++++++++++++++++- .../TileEntityMachineChemicalFactory.java | 33 +++++++++++++++++- .../TileEntityMachineChemicalPlant.java | 34 ++++++++++++++++++- 5 files changed, 101 insertions(+), 6 deletions(-) diff --git a/changelog b/changelog index 0e1a5cf5a..9ca5b6b0c 100644 --- a/changelog +++ b/changelog @@ -29,13 +29,14 @@ * Increased the blast furnace's fuel buffer by 50%, allowing coke blocks to be used * If an RoR controller tries to parse an integer, but the supplied string represents a decimal, instead of canceling the operation, the system will now interpret decimals and round them to be integers * This means that the AUTOCAL can now send RoR commands using calculated values directly without the use of `round` or `evalr` -* Assembly machines now support Redstone-over-Radio +* Assembly machines and chemical plants now support Redstone-over-Radio * Active state (0 or 1), progress (0-100) and current recipe (internal name) can now be read * The recipe can be set using a controller * Do note that setting a recipe that needs a blueprint without that blueprint will not work * RoR set recipes cause the assembler to go into low power mode, making it run at only 25% speed (visible through the blue progress bar) * The speed penalty is removed as soon as a recipe is assigned manually again -* The AUTOCAL's script interpreter now runs MS-ES v1.1 (First Extended Instruction Set) +* Assembly recipes and chemical factories can now be read (but not configured) using Redstone-over-Radio +* The factories script interpreter now runs MS-ES v1.1 (First Extended Instruction Set) * Allows the use of a global stack, similar to the buffer which can hold 256 values * Allows splitting of strings and counting of string fragments * Adds substring operations diff --git a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java index 0f42776f1..018e780f0 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java +++ b/src/main/java/com/hbm/inventory/gui/GUIMachineChemicalPlant.java @@ -78,7 +78,7 @@ public class GUIMachineChemicalPlant extends GuiInfoContainer { if(chemplant.chemplantModule.progress > 0) { int j = (int) Math.ceil(70 * chemplant.chemplantModule.progress); - drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16); + drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61 + (chemplant.chemplantModule.restrictedMode ? 16 : 0), j, 16); } GenericRecipe recipe = chemplant.chemplantModule.getRecipe(); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java index 2324ba300..e171deb1a 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java @@ -32,6 +32,7 @@ import com.hbm.util.i18n.I18nUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -46,7 +47,7 @@ import net.minecraftforge.common.util.ForgeDirection; // TODO: make a base class because 90% of this is just copy pasted from the chemfac @NotableComments -public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess { +public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess, IRORValueProvider { public FluidTank[] allTanks; public FluidTank[] inputTanks; @@ -721,4 +722,34 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl RETIRE, // return to null position for carriage transit WAIT // either waiting for or in the middle of carriage transit } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress1", + PREFIX_VALUE + "progress2", + PREFIX_VALUE + "progress3", + PREFIX_VALUE + "progress4", + PREFIX_VALUE + "recipe1", + PREFIX_VALUE + "recipe2", + PREFIX_VALUE + "recipe3", + PREFIX_VALUE + "recipe4", + PREFIX_VALUE + "anyactive", + PREFIX_VALUE + "active1", + PREFIX_VALUE + "active2", + PREFIX_VALUE + "active3", + PREFIX_VALUE + "active4", + }; + } + + @Override + public String provideRORValue(String name) { + if("anyactive".equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); + for(int i = 0; i < 4; i++) { + if(("progress" + i).equals(name)) return "" + (int) Math.round(this.assemblerModule[i].progress * 100); + if(("recipe" + i).equals(name)) return this.assemblerModule[i].getRecipeName(); + if(("active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); + } + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java index 2f1c80eb4..2042d0615 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java @@ -30,6 +30,7 @@ import com.hbm.util.i18n.I18nUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -42,7 +43,7 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess { +public class TileEntityMachineChemicalFactory extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IProxyDelegateProvider, IConditionalInvAccess, IRORValueProvider { public FluidTank[] allTanks; public FluidTank[] inputTanks; @@ -479,4 +480,34 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl @Override public FluidTank[] getAllTanks() { return TileEntityMachineChemicalFactory.this.getAllTanks(); } } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress1", + PREFIX_VALUE + "progress2", + PREFIX_VALUE + "progress3", + PREFIX_VALUE + "progress4", + PREFIX_VALUE + "recipe1", + PREFIX_VALUE + "recipe2", + PREFIX_VALUE + "recipe3", + PREFIX_VALUE + "recipe4", + PREFIX_VALUE + "anyactive", + PREFIX_VALUE + "active1", + PREFIX_VALUE + "active2", + PREFIX_VALUE + "active3", + PREFIX_VALUE + "active4", + }; + } + + @Override + public String provideRORValue(String name) { + if("anyactive".equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); + for(int i = 0; i < 4; i++) { + if(("progress" + i).equals(name)) return "" + (int) Math.round(this.chemplantModule[i].progress * 100); + if(("recipe" + i).equals(name)) return this.chemplantModule[i].getRecipeName(); + if(("active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); + } + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java index 50e779f1c..d40881054 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java @@ -28,6 +28,8 @@ import com.hbm.util.i18n.I18nUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORInteractive; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -39,7 +41,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider { +public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IRORValueProvider, IRORInteractive { public FluidTank[] inputTanks; public FluidTank[] outputTanks; @@ -325,4 +327,34 @@ public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implem upgrades.put(UpgradeType.OVERDRIVE, 3); return upgrades; } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress", + PREFIX_VALUE + "recipe", + PREFIX_VALUE + "active", + PREFIX_FUNCTION + "setrecipe" + NAME_SEPARATOR + "name", + }; + } + + @Override + public String provideRORValue(String name) { + if("progress".equals(name)) return "" + (int) Math.round(this.chemplantModule.progress * 100); + if("recipe".equals(name)) return this.chemplantModule.getRecipeName(); + if("active".equals(name)) return "" + (this.didProcess ? 1 : 0); + return null; + } + + @Override + public String runRORFunction(String name, String[] params) { + + if("setrecipe".equals(name) && params.length == 1) { + this.chemplantModule.setRecipe(params[0], true); + this.markChanged(); + return null; + } + + return null; + } } From 1c46bfed92004190fbbfddcc73baead1f4a5ac4b Mon Sep 17 00:00:00 2001 From: Boblet Date: Wed, 1 Jul 2026 14:18:06 +0200 Subject: [PATCH 4/4] Redstone 3.0 + 1.0 Thrice Upon A Time --- changelog | 11 +- .../redstoneoverradio/IRORInteractive.java | 4 +- .../recipes/loader/GenericRecipes.java | 6 +- .../com/hbm/items/machine/ItemBlueprints.java | 2 +- .../machine/TileEntityHeaterOilburner.java | 24 +-- .../TileEntityMachineAssemblyFactory.java | 8 +- .../TileEntityMachineAssemblyMachine.java | 10 +- .../TileEntityMachineChemicalFactory.java | 8 +- .../TileEntityMachineChemicalPlant.java | 10 +- .../TileEntityMachineCombustionEngine.java | 8 +- .../machine/TileEntityMachinePUREX.java | 20 ++- .../machine/TileEntityMachineTurbineGas.java | 16 +- .../machine/TileEntityReactorZirnox.java | 8 +- .../fusion/TileEntityFusionPlasmaForge.java | 24 ++- .../machine/fusion/TileEntityFusionTorus.java | 25 ++- .../network/TileEntityFluidCounterValve.java | 4 +- .../network/TileEntityRadioTorchReader.java | 4 +- .../TileEntityPneumoStorageExporter.java | 158 +++++++++++++++++- .../turret/TileEntityTurretBaseArtillery.java | 14 +- .../turret/TileEntityTurretBaseNT.java | 28 ++-- .../textures/gui/machine/gui_rtty_autocal.png | Bin 2420 -> 2430 bytes .../hbm/textures/items/plate_dura_steel.png | Bin 274 -> 312 bytes 22 files changed, 299 insertions(+), 93 deletions(-) diff --git a/changelog b/changelog index 9ca5b6b0c..d1aa96597 100644 --- a/changelog +++ b/changelog @@ -24,7 +24,7 @@ * Added an alternate chemical plant recipe that uses a smaller selection of items and ICs instead of ACs * Flashgold and flashlead are now made in the PUREX instead of the crafting table * The flashgold recipe now yields two billets instead of one -* Slightly changed the HSS ingot texture to not look identical to steel except slightly greenish +* Slightly changed the HSS ingot and plate textures to not look identical to steel except slightly greenish * The AUTOCAL's buffer is now limited to 256 characters instead of being infinite * Increased the blast furnace's fuel buffer by 50%, allowing coke blocks to be used * If an RoR controller tries to parse an integer, but the supplied string represents a decimal, instead of canceling the operation, the system will now interpret decimals and round them to be integers @@ -35,13 +35,16 @@ * Do note that setting a recipe that needs a blueprint without that blueprint will not work * RoR set recipes cause the assembler to go into low power mode, making it run at only 25% speed (visible through the blue progress bar) * The speed penalty is removed as soon as a recipe is assigned manually again -* Assembly recipes and chemical factories can now be read (but not configured) using Redstone-over-Radio -* The factories script interpreter now runs MS-ES v1.1 (First Extended Instruction Set) +* Assembly factories, chemical factories, PUREX and plasma forges can now be read (but not configured) using Redstone-over-Radio +* Fusion reactor vessels can now be read and configured using RoR + * Unlike assemblers and chemplants, remote recipe configuration does not cause a speed penalty +* The AUTOCAL's script interpreter now runs MS-ES v1.1 (First Extended Instruction Set) * Allows the use of a global stack, similar to the buffer which can hold 256 values * Allows splitting of strings and counting of string fragments * Adds substring operations * Polling for receiving only fresh RoR signals * A command for writing the world time to the buffer, allowing for more precise timers +* All RoR values/commands are now case-insensitive ## Fixed * Fixed AUTOCAL's number comparison functions not working with variable substitution as advertised @@ -52,4 +55,4 @@ * Fixed some recipes not using ore dict when they should * Fixed `anyBismoid` group not being a proper group, causing other mods' bismuth and arsenic to not be included * Fixed RoR gauge not using SI suffixes on values below 0 -* Fixed AUTOCAL units not closing their GUI when the unit is destroyed \ No newline at end of file +* Fixed AUTOCAL units not closing their GUI when the unit is destroyed diff --git a/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java b/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java index 518b23c87..37819b5df 100644 --- a/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java +++ b/src/main/java/api/hbm/redstoneoverradio/IRORInteractive.java @@ -1,5 +1,7 @@ package api.hbm.redstoneoverradio; +import java.util.Locale; + public interface IRORInteractive extends IRORInfo { public static String NAME_SEPARATOR = "!"; @@ -18,7 +20,7 @@ public interface IRORInteractive extends IRORInfo { String[] parts = input.split(NAME_SEPARATOR); if(parts.length <= 0 || parts.length > 2) throw new RORFunctionException(EX_NAME); if(parts[0].isEmpty()) throw new RORFunctionException(EX_NULL); - return parts[0]; + return parts[0].toLowerCase(Locale.US); } /** Extracts the param list from a full command string */ diff --git a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipes.java b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipes.java index 6bc4d93e1..6fee43971 100644 --- a/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/loader/GenericRecipes.java @@ -48,7 +48,7 @@ public abstract class GenericRecipes extends Serializab /** Blueprint pool name to list of recipe names that are part of this pool */ public static HashMap> blueprintPools = new HashMap(); /** Name to recipe map for all recipes that are part of pools for lookup */ - public static HashMap pooledBlueprints = new HashMap(); + public static HashMap nameToRecipeGlobal = new HashMap(); /** Groups for auto switch functionality (changes recipe automatically based on first solid input) */ public HashMap> autoSwitchGroups = new HashMap(); @@ -68,7 +68,6 @@ public abstract class GenericRecipes extends Serializab blueprintPools.put(pool, list); } list.add(recipe.name); - pooledBlueprints.put(recipe.name, recipe); } /** Adds a recipe to an auto switch group (recipe can switch based on first solid input) */ @@ -81,7 +80,7 @@ public abstract class GenericRecipes extends Serializab public static void clearPools() { blueprintPools.clear(); - pooledBlueprints.clear(); + nameToRecipeGlobal.clear(); } @Override @@ -100,6 +99,7 @@ public abstract class GenericRecipes extends Serializab this.recipeOrderedList.add(recipe); if(recipeNameMap.containsKey(recipe.name)) throw new IllegalStateException("Recipe " + recipe.name + " has been registered with a duplicate ID!"); this.recipeNameMap.put(recipe.name, recipe); + nameToRecipeGlobal.put(recipe.name, recipe); } @Override diff --git a/src/main/java/com/hbm/items/machine/ItemBlueprints.java b/src/main/java/com/hbm/items/machine/ItemBlueprints.java index fc6c960ac..07be9a219 100644 --- a/src/main/java/com/hbm/items/machine/ItemBlueprints.java +++ b/src/main/java/com/hbm/items/machine/ItemBlueprints.java @@ -121,7 +121,7 @@ public class ItemBlueprints extends Item { } for(String name : pool) { - GenericRecipe recipe = GenericRecipes.pooledBlueprints.get(name); + GenericRecipe recipe = GenericRecipes.nameToRecipeGlobal.get(name); if(recipe != null) { list.add(recipe.getLocalizedName()); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityHeaterOilburner.java b/src/main/java/com/hbm/tileentity/machine/TileEntityHeaterOilburner.java index bdeb8bedd..4706bae84 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityHeaterOilburner.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityHeaterOilburner.java @@ -244,8 +244,8 @@ public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implem PREFIX_VALUE + "fuel", PREFIX_VALUE + "burnRate", PREFIX_VALUE + "state", - PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "active", - PREFIX_FUNCTION + "setBurnRate" + NAME_SEPARATOR + "rate" + PREFIX_FUNCTION + "setstate" + NAME_SEPARATOR + "active", + PREFIX_FUNCTION + "setburnrate" + NAME_SEPARATOR + "rate" }; } @@ -253,29 +253,23 @@ public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implem public String provideRORValue(String name) { if((PREFIX_VALUE + "heat").equals(name)) return "" + heatEnergy; if((PREFIX_VALUE + "fuel").equals(name)) return "" + tank.getFill(); - if((PREFIX_VALUE + "burnRate").equals(name)) return "" + setting; + if((PREFIX_VALUE + "burnrate").equals(name)) return "" + setting; if((PREFIX_VALUE + "state").equals(name)) return isOn ? "1" : "0"; return null; } @Override public String runRORFunction(String name, String[] params) { - if((PREFIX_FUNCTION + "setState").equals(name)) { + if((PREFIX_FUNCTION + "setstate").equals(name)) { this.isOn = params[0].equals("1"); this.markChanged(); return null; } - if((PREFIX_FUNCTION + "setBurnRate").equals(name)) { - try { - int rate = Integer.parseInt(params[0]); - if(rate < 1) rate = 1; - if(rate > 10) rate = 10; - this.setting = rate; - this.markChanged(); - return null; - } catch (NumberFormatException e) { - return "Invalid number"; - } + if((PREFIX_FUNCTION + "setburnrate").equals(name)) { + int rate = IRORInteractive.parseInt(params[0], 1, 10); + this.setting = rate; + this.markChanged(); + return null; } return null; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java index e171deb1a..c7010af97 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyFactory.java @@ -744,11 +744,11 @@ public class TileEntityMachineAssemblyFactory extends TileEntityMachineBase impl @Override public String provideRORValue(String name) { - if("anyactive".equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); + if((PREFIX_VALUE + "anyactive").equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); for(int i = 0; i < 4; i++) { - if(("progress" + i).equals(name)) return "" + (int) Math.round(this.assemblerModule[i].progress * 100); - if(("recipe" + i).equals(name)) return this.assemblerModule[i].getRecipeName(); - if(("active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); + if((PREFIX_VALUE + "progress" + i).equals(name)) return "" + (int) Math.round(this.assemblerModule[i].progress * 100); + if((PREFIX_VALUE + "recipe" + i).equals(name)) return this.assemblerModule[i].getRecipeName(); + if((PREFIX_VALUE + "active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); } return null; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java index 0592ad79e..486dbe8c4 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineAssemblyMachine.java @@ -496,16 +496,16 @@ public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase impl @Override public String provideRORValue(String name) { - if("progress".equals(name)) return "" + (int) Math.round(this.assemblerModule.progress * 100); - if("recipe".equals(name)) return this.assemblerModule.getRecipeName(); - if("active".equals(name)) return "" + (this.didProcess ? 1 : 0); + if((PREFIX_VALUE + "progress").equals(name)) return "" + (int) Math.round(this.assemblerModule.progress * 100); + if((PREFIX_VALUE + "recipe").equals(name)) return this.assemblerModule.getRecipeName(); + if((PREFIX_VALUE + "active").equals(name)) return "" + (this.didProcess ? 1 : 0); return null; } @Override public String runRORFunction(String name, String[] params) { - - if("setrecipe".equals(name) && params.length == 1) { + + if((PREFIX_FUNCTION + "setrecipe").equals(name) && params.length == 1) { this.assemblerModule.setRecipe(params[0], true); this.markChanged(); return null; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java index 2042d0615..7e2a170b8 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalFactory.java @@ -502,11 +502,11 @@ public class TileEntityMachineChemicalFactory extends TileEntityMachineBase impl @Override public String provideRORValue(String name) { - if("anyactive".equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); + if((PREFIX_VALUE + "anyactive").equals(name)) return "" + ((this.didProcess[0] || this.didProcess[1] || this.didProcess[2] || this.didProcess[3]) ? 1 : 0); for(int i = 0; i < 4; i++) { - if(("progress" + i).equals(name)) return "" + (int) Math.round(this.chemplantModule[i].progress * 100); - if(("recipe" + i).equals(name)) return this.chemplantModule[i].getRecipeName(); - if(("active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); + if((PREFIX_VALUE + "progress" + i).equals(name)) return "" + (int) Math.round(this.chemplantModule[i].progress * 100); + if((PREFIX_VALUE + "recipe" + i).equals(name)) return this.chemplantModule[i].getRecipeName(); + if((PREFIX_VALUE + "active" + i).equals(name)) return "" + (this.didProcess[i] ? 1 : 0); } return null; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java index d40881054..8c52695e9 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineChemicalPlant.java @@ -340,16 +340,16 @@ public class TileEntityMachineChemicalPlant extends TileEntityMachineBase implem @Override public String provideRORValue(String name) { - if("progress".equals(name)) return "" + (int) Math.round(this.chemplantModule.progress * 100); - if("recipe".equals(name)) return this.chemplantModule.getRecipeName(); - if("active".equals(name)) return "" + (this.didProcess ? 1 : 0); + if((PREFIX_VALUE + "progress").equals(name)) return "" + (int) Math.round(this.chemplantModule.progress * 100); + if((PREFIX_VALUE + "recipe").equals(name)) return this.chemplantModule.getRecipeName(); + if((PREFIX_VALUE + "active").equals(name)) return "" + (this.didProcess ? 1 : 0); return null; } @Override public String runRORFunction(String name, String[] params) { - - if("setrecipe".equals(name) && params.length == 1) { + + if((PREFIX_FUNCTION + "setrecipe").equals(name) && params.length == 1) { this.chemplantModule.setRecipe(params[0], true); this.markChanged(); return null; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java index edad59cd9..e6214bb64 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineCombustionEngine.java @@ -484,8 +484,8 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachinePollutin PREFIX_VALUE + "power", PREFIX_VALUE + "fuel", PREFIX_VALUE + "efficiency", - PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "state", - PREFIX_FUNCTION + "setThrottle" + NAME_SEPARATOR + "throttle" + PREFIX_FUNCTION + "setstate" + NAME_SEPARATOR + "state", + PREFIX_FUNCTION + "setthrottle" + NAME_SEPARATOR + "throttle" }; } @@ -509,7 +509,7 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachinePollutin @Override public String runRORFunction(String name, String[] params) { - if ((PREFIX_FUNCTION + "setState").equals(name) && params.length > 0) { + if ((PREFIX_FUNCTION + "setstate").equals(name) && params.length > 0) { try { int val = Integer.parseInt(params[0]); this.isOn = (val == 1); @@ -517,7 +517,7 @@ public class TileEntityMachineCombustionEngine extends TileEntityMachinePollutin } catch (NumberFormatException e) {} return null; } - if ((PREFIX_FUNCTION + "setThrottle").equals(name) && params.length > 0) { + if ((PREFIX_FUNCTION + "setthrottle").equals(name) && params.length > 0) { try { int val = Integer.parseInt(params[0]); if (val < 0) val = 0; diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java index 6f20e2e69..0181ac59a 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachinePUREX.java @@ -25,6 +25,7 @@ import com.hbm.util.i18n.I18nUtil; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -36,7 +37,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.EnumChatFormatting; import net.minecraft.world.World; -public class TileEntityMachinePUREX extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider { +public class TileEntityMachinePUREX extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider, IRORValueProvider { public FluidTank[] inputTanks; public FluidTank[] outputTanks; @@ -282,4 +283,21 @@ public class TileEntityMachinePUREX extends TileEntityMachineBase implements IEn upgrades.put(UpgradeType.OVERDRIVE, 3); return upgrades; } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress", + PREFIX_VALUE + "recipe", + PREFIX_VALUE + "active", + }; + } + + @Override + public String provideRORValue(String name) { + if((PREFIX_VALUE + "progress").equals(name)) return "" + (int) Math.round(this.purexModule.progress * 100); + if((PREFIX_VALUE + "recipe").equals(name)) return this.purexModule.getRecipeName(); + if((PREFIX_VALUE + "active").equals(name)) return "" + (this.didProcess ? 1 : 0); + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java index 47040e264..51c726fd5 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbineGas.java @@ -737,16 +737,16 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement PREFIX_VALUE + "turbinespeed", PREFIX_VALUE + "output", PREFIX_VALUE + "state", - PREFIX_VALUE + "autoMode", + PREFIX_VALUE + "automode", PREFIX_VALUE + "temp", PREFIX_VALUE + "power", PREFIX_VALUE + "fuel", PREFIX_VALUE + "lubricant", PREFIX_VALUE + "water", PREFIX_VALUE + "steam", - PREFIX_FUNCTION + "setAuto" + NAME_SEPARATOR + "auto", - PREFIX_FUNCTION + "setThrottle" + NAME_SEPARATOR + "percent", - PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "state" + PREFIX_FUNCTION + "setauto" + NAME_SEPARATOR + "auto", + PREFIX_FUNCTION + "setthrottle" + NAME_SEPARATOR + "percent", + PREFIX_FUNCTION + "setstate" + NAME_SEPARATOR + "state" }; } @@ -756,7 +756,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement if((PREFIX_VALUE + "turbinespeed").equals(name)) return "" + this.rpm; if((PREFIX_VALUE + "output").equals(name)) return "" + (int) (this.instantPowerOutput * 20); if((PREFIX_VALUE + "state").equals(name)) return "" + this.state; - if((PREFIX_VALUE + "autoMode").equals(name)) return "" + (this.autoMode ? 1 : 0); + if((PREFIX_VALUE + "automode").equals(name)) return "" + (this.autoMode ? 1 : 0); if((PREFIX_VALUE + "temp").equals(name)) return "" + this.temp; if((PREFIX_VALUE + "power").equals(name)) return "" + this.power; if((PREFIX_VALUE + "fuel").equals(name)) return "" + tanks[0].getFill(); @@ -768,7 +768,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement @Override public String runRORFunction(String name, String[] params) { - if((PREFIX_FUNCTION + "setAuto").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "setauto").equals(name) && params.length > 0) { try { int val = Integer.parseInt(params[0]); this.autoMode = (val == 1); @@ -776,7 +776,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } catch(NumberFormatException e) {} return null; } - if((PREFIX_FUNCTION + "setThrottle").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "setthrottle").equals(name) && params.length > 0) { try { int percent = Integer.parseInt(params[0]); if(percent < 0) percent = 0; @@ -786,7 +786,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement } catch(NumberFormatException e) {} return null; } - if((PREFIX_FUNCTION + "setState").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "setstate").equals(name) && params.length > 0) { try { int newState = Integer.parseInt(params[0]); if(newState == 1) { diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java b/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java index 30a686426..93293c4d9 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java @@ -616,8 +616,8 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IC PREFIX_VALUE + "steam", PREFIX_VALUE + "co2", PREFIX_VALUE + "state", - PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "active (0 or 1)", - PREFIX_FUNCTION + "ventCO2" + PREFIX_FUNCTION + "setstate" + NAME_SEPARATOR + "active (0 or 1)", + PREFIX_FUNCTION + "ventco2" }; } @@ -634,7 +634,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IC @Override public String runRORFunction(String name, String[] params) { - if((PREFIX_FUNCTION + "setState").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "setstate").equals(name) && params.length > 0) { if(redstonePowered) return null; try { int val = Integer.parseInt(params[0]); @@ -643,7 +643,7 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IC } catch(NumberFormatException e) {} return null; } - if ((PREFIX_FUNCTION + "ventCO2").equals(name)) { + if ((PREFIX_FUNCTION + "ventco2").equals(name)) { int fill = this.carbonDioxide.getFill(); this.carbonDioxide.setFill(Math.max(fill - 1000, 0)); this.markDirty(); diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java index 3ac9468d1..1b49f2dc4 100644 --- a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionPlasmaForge.java @@ -33,6 +33,7 @@ import com.hbm.util.fauxpointtwelve.DirPos; import api.hbm.energymk2.IEnergyReceiverMK2; import api.hbm.fluidmk2.IFluidStandardReceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; @@ -44,7 +45,7 @@ import net.minecraft.util.AxisAlignedBB; import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; -public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IFusionPowerReceiver, IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider { +public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IFusionPowerReceiver, IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider, IRORValueProvider { public FluidTank inputTank; @@ -592,4 +593,25 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement double[] newPos = positions[rand.nextInt(positions.length)]; for(int i = 0; i < newPos.length; i++) arm.targetAngles[i] = newPos[i]; } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "progress", + PREFIX_VALUE + "recipe", + PREFIX_VALUE + "active", + PREFIX_VALUE + "booster", + PREFIX_VALUE + "plasma", + }; + } + + @Override + public String provideRORValue(String name) { + if((PREFIX_VALUE + "progress").equals(name)) return "" + (int) Math.round(this.plasmaModule.progress * 100); + if((PREFIX_VALUE + "recipe").equals(name)) return this.plasmaModule.getRecipeName(); + if((PREFIX_VALUE + "active").equals(name)) return "" + (this.didProcess ? 1 : 0); + if((PREFIX_VALUE + "booster").equals(name)) return "" + this.booster; + if((PREFIX_VALUE + "plasma").equals(name)) return "" + this.plasmaEnergy; + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java index b278623fe..08992ef16 100644 --- a/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java +++ b/src/main/java/com/hbm/tileentity/machine/fusion/TileEntityFusionTorus.java @@ -27,6 +27,7 @@ import com.hbm.util.BobMathUtil; import com.hbm.util.fauxpointtwelve.BlockPos; import com.hbm.util.fauxpointtwelve.DirPos; +import api.hbm.redstoneoverradio.IRORInteractive; import api.hbm.redstoneoverradio.IRORValueProvider; import cpw.mods.fml.common.Optional; import cpw.mods.fml.relauncher.Side; @@ -46,7 +47,7 @@ import net.minecraft.world.World; import net.minecraftforge.common.util.ForgeDirection; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) -public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, SimpleComponent, CompatHandler.OCComponent, IRORValueProvider { +public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, SimpleComponent, CompatHandler.OCComponent, IRORValueProvider, IRORInteractive { public boolean didProcess = false; @@ -589,7 +590,11 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP public String[] getFunctionInfo() { return new String[] { PREFIX_VALUE + "plasma", - PREFIX_VALUE + "consumption" + PREFIX_VALUE + "consumption", + PREFIX_VALUE + "progress", + PREFIX_VALUE + "recipe", + PREFIX_VALUE + "active", + PREFIX_VALUE + "temp", }; } @@ -597,6 +602,22 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP public String provideRORValue(String name) { if((PREFIX_VALUE + "plasma").equals(name)) return "" + this.plasmaEnergy; if((PREFIX_VALUE + "consumption").equals(name)) return "" + (int) (this.fuelConsumption * 100); + if((PREFIX_VALUE + "progress").equals(name)) return "" + (int) Math.round(this.fusionModule.progress * 100); + if((PREFIX_VALUE + "recipe").equals(name)) return this.fusionModule.getRecipeName(); + if((PREFIX_VALUE + "active").equals(name)) return "" + (this.didProcess ? 1 : 0); + if((PREFIX_VALUE + "temp").equals(name)) return "" + (int) this.temperature; + return null; + } + + @Override + public String runRORFunction(String name, String[] params) { + + if((PREFIX_FUNCTION + "setrecipe").equals(name) && params.length == 1) { + this.fusionModule.setRecipe(params[0], false); + this.markChanged(); + return null; + } + return null; } } diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityFluidCounterValve.java b/src/main/java/com/hbm/tileentity/network/TileEntityFluidCounterValve.java index 285b49ce0..9ccbc2508 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityFluidCounterValve.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityFluidCounterValve.java @@ -140,7 +140,7 @@ public class TileEntityFluidCounterValve extends TileEntityPipeBaseNT implements PREFIX_VALUE + "value", PREFIX_VALUE + "state", PREFIX_FUNCTION + "reset", - PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "state", + PREFIX_FUNCTION + "setstate" + NAME_SEPARATOR + "state", }; } @@ -149,7 +149,7 @@ public class TileEntityFluidCounterValve extends TileEntityPipeBaseNT implements if(name.equals(PREFIX_FUNCTION + "reset")) { counter = 0; markDirty(); - } else if(name.equals(PREFIX_FUNCTION + "setState")) { + } else if(name.equals(PREFIX_FUNCTION + "setstate")) { setState(IRORInteractive.parseInt(params[0], 0, 1)); } return null; diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchReader.java b/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchReader.java index 15e0465e9..2a4f9453b 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchReader.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityRadioTorchReader.java @@ -1,5 +1,7 @@ package com.hbm.tileentity.network; +import java.util.Locale; + import com.hbm.interfaces.IControlReceiver; import com.hbm.tileentity.TileEntityLoadedBase; import com.hbm.util.BufferUtil; @@ -44,7 +46,7 @@ public class TileEntityRadioTorchReader extends TileEntityLoadedBase implements if(channel == null || channel.isEmpty()) continue; if(name == null || name.isEmpty()) continue; - String value = prov.provideRORValue(IRORValueProvider.PREFIX_VALUE + name); + String value = prov.provideRORValue(IRORValueProvider.PREFIX_VALUE + name.toLowerCase(Locale.US)); if(value == null) continue; if(polling || !value.equals(previous)) { diff --git a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java index b639fbb56..8aa8b0df5 100644 --- a/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java +++ b/src/main/java/com/hbm/tileentity/network/pneumatic/TileEntityPneumoStorageExporter.java @@ -5,12 +5,16 @@ import com.hbm.interfaces.IControlReceiver; import com.hbm.inventory.container.ContainerPneumoStorageExporter; import com.hbm.inventory.gui.GUIPneumoStorageExporter; import com.hbm.tileentity.network.RTTYSystem; +import com.hbm.util.BobMathUtil; +import api.hbm.ntl.StackCache; import api.hbm.ntl.StackCache.CacheSlot; import api.hbm.redstoneoverradio.IRORInteractive; import io.netty.buffer.ByteBuf; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.inventory.Container; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @@ -24,6 +28,9 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB public int requestMode = 0; /** Item ID and meta pairs with amount for RoR controlled filters */ public short[][] rorFilters = new short[9][3]; + /** Delay for non-forced (i.e. continuous request) grabs, if not successful */ + public int slotDelay[] = new int[9]; + public static final int SLOT_DELAY = 10; /** Each slot individually tries to pull as much as it can of the configured item */ public static final int MODE_AS_MUCH_AS_POSSIBLE = 0; @@ -46,16 +53,153 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB super.updateEntity(); if(!worldObj.isRemote) { + + for(int i = 0; i < 9; i++) { + if(slotDelay[i] > 0) slotDelay[i]--; + } + + if(continuousRequest) { + this.doRequest(false); + } + this.networkPackNT(15); } } public void doRequest(boolean force) { + if(this.requestMode != MODE_FULL_REQUEST) { + // handle all filters individually + for(int i = 0; i < 9; i++) if(!requestSlot(i, force)) this.slotDelay[i] = SLOT_DELAY; + } else { + + // check filter delay if forced pulls aren't active + if(!force) for(int i = 0; i < 9; i++) { + short[] filter = this.getFilter(i); + if(filter != null && slotDelay[i] > 0) return; + } + + // check if filter demands are met and space is free + for(int i = 0; i < 9; i++) { + short[] filter = this.getFilter(i); + if(filter == null) continue; + + int itemId = filter[0]; + Item item = Item.getItemById(itemId); + int meta = filter[1]; + int requestSize = filter[2]; + + int existingSize = 0; + ItemStack existingStack = slots[i]; + + if(existingStack != null) { + if(existingStack.getItem() == item && existingStack.getItemDamage() == meta && !existingStack.hasTagCompound()) { + existingSize = existingStack.stackSize; + } else { + this.slotDelay[i] = SLOT_DELAY; + return; + } + } + + ItemStack newStack = new ItemStack(item, 1, meta); + int capacityLeft = newStack.getMaxStackSize() - existingSize; + + if(capacityLeft < requestSize || getAvailability(itemId, meta) < requestSize) { + this.slotDelay[i] = SLOT_DELAY; + return; + } + } + + // everything is good, pull items. continues should not happen, but are in place nonetheless + for(int i = 0; i < 9; i++) { + short[] filter = this.getFilter(i); + if(filter == null) continue; + + int itemId = filter[0]; + Item item = Item.getItemById(itemId); + int meta = filter[1]; + int requestSize = filter[2]; + + int existingSize = 0; + ItemStack existingStack = slots[i]; + if(existingStack != null) existingSize = existingStack.stackSize; + + ItemStack newStack = new ItemStack(item, 1, meta); + + long hash = StackCache.getStackIdentity(itemId, meta, null); + if(hash == this.cache.getNullIdentity()) continue; // safeguard + + CacheSlot cacheSlot = this.cache.cacheSlots.get(hash); + if(cacheSlot == null) continue; // safeguard + + slots[i] = newStack; + slots[i].stackSize = existingSize + (int) this.cache.consumeItemsAndReturnQuantity(newStack, requestSize); + } + + this.markChanged(); + } } - public void requestSlot(int slot, boolean force) { + /** Returns false if the slot delay should be reset (unsuccessful) or true of not (successful or delay still active) */ + public boolean requestSlot(int slot, boolean force) { + if(!force && slotDelay[slot] > 0) return true; + if(this.cache == null || this.cache.hasExpired) return false; + + short[] filter = this.getFilter(slot); + if(filter == null) return false; + + int itemId = filter[0]; + Item item = Item.getItemById(itemId); + int meta = filter[1]; + int requestSize = filter[2]; + + int existingSize = 0; + ItemStack existingStack = slots[slot]; + + if(existingStack != null) { + if(existingStack.getItem() == item && existingStack.getItemDamage() == meta && !existingStack.hasTagCompound()) { + existingSize = existingStack.stackSize; + } else { + return false; + } + } + + ItemStack newStack = new ItemStack(item, 1, meta); + int capacityLeft = newStack.getMaxStackSize() - existingSize; + + // any non-AMAP mode will fail if it can't insert that much before we even check availability from the pneumo sys + if(capacityLeft < requestSize && this.requestMode != MODE_AS_MUCH_AS_POSSIBLE) return false; + long hash = StackCache.getStackIdentity(itemId, meta, null); + if(hash == this.cache.getNullIdentity()) return false; + + CacheSlot cacheSlot = this.cache.cacheSlots.get(hash); + if(cacheSlot == null) return false; + + // any non-AMAP mode will fail if the system doesn't have the requested amount + if(cacheSlot.stacksize < requestSize && this.requestMode != MODE_AS_MUCH_AS_POSSIBLE) return false; + if(cacheSlot.stacksize <= 0) return false; + + int toPull = (int) BobMathUtil.min(requestSize, cacheSlot.stacksize, capacityLeft); + slots[slot] = newStack; + slots[slot].stackSize = existingSize + (int) this.cache.consumeItemsAndReturnQuantity(newStack, toPull); + this.markChanged(); + + return true; + } + + /** Returns item id, meta and request size for the given filter. Returns null if no filter is specified */ + public short[] getFilter(int slot) { + if(rorConfiguredMode) { + if(Item.getItemById(rorFilters[slot][0]) == null) return null; + return rorFilters[slot]; + } else { + if(slots[slot] != null) { + ItemStack stack = slots[slot]; + return new short[] {(short) Item.getIdFromItem(stack.getItem()), (short) stack.getItemDamage(), (short) stack.stackSize}; + } + return null; + } } public long getAvailability(int item, int meta) { @@ -127,7 +271,7 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB @Override public String runRORFunction(String name, String[] params) { - if("setfilter".equals(name) && params.length == 4) { + if((PREFIX_FUNCTION + "setfilter").equals(name) && params.length == 4) { int slot = IRORInteractive.parseInt(params[0], 1, 9) - 1; int itemId = IRORInteractive.parseInt(params[1], 0, Short.MAX_VALUE); int meta = IRORInteractive.parseInt(params[2], 0, Short.MAX_VALUE); @@ -140,25 +284,25 @@ public class TileEntityPneumoStorageExporter extends TileEntityPneumaticMachineB return null; } - if("setcontinuous".equals(name) && params.length == 1) { + if((PREFIX_FUNCTION + "setcontinuous").equals(name) && params.length == 1) { if("on".equals(params[0])) this.continuousRequest = true; if("off".equals(params[0])) this.continuousRequest = false; this.markChanged(); return null; } - if("request".equals(name)) { + if((PREFIX_FUNCTION + "request").equals(name)) { this.doRequest(true); return null; } - if("requestslot".equals(name) && params.length == 1) { + if((PREFIX_FUNCTION + "requestslot").equals(name) && params.length == 1) { int slot = IRORInteractive.parseInt(params[0], 1, 9) - 1; - this.requestSlot(slot, true); + if(!this.requestSlot(slot, true)) this.slotDelay[slot] = SLOT_DELAY; return null; } - if("checkavailability".equals(name) && params.length == 3) { + if((PREFIX_FUNCTION + "checkavailability").equals(name) && params.length == 3) { int itemId = IRORInteractive.parseInt(params[0], 0, Short.MAX_VALUE); int meta = IRORInteractive.parseInt(params[1], 0, Short.MAX_VALUE); String ret = params[2]; diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java index e971b8e6f..863f298e7 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseArtillery.java @@ -96,13 +96,13 @@ public abstract class TileEntityTurretBaseArtillery extends TileEntityTurretBase @Override public String[] getFunctionInfo() { return new String[] { - PREFIX_FUNCTION + "setActive" + NAME_SEPARATOR + "active (0 or 1)", - PREFIX_FUNCTION + "targetPlayers" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetAnimals" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetMobs" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetMachines" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "addWhitelist" + NAME_SEPARATOR + "name", - PREFIX_FUNCTION + "removeWhitelist" + NAME_SEPARATOR + "name", + PREFIX_FUNCTION + "setactive" + NAME_SEPARATOR + "active (0 or 1)", + PREFIX_FUNCTION + "targetplayers" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetanimals" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetmobs" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetmachines" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "addwhitelist" + NAME_SEPARATOR + "name", + PREFIX_FUNCTION + "removewhitelist" + NAME_SEPARATOR + "name", PREFIX_FUNCTION + "enqueue" + NAME_SEPARATOR + "x" + PARAM_SEPARATOR + "y" + PARAM_SEPARATOR + "z", }; } diff --git a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java index 1d75b1679..c9e5e2c8c 100644 --- a/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java +++ b/src/main/java/com/hbm/tileentity/turret/TileEntityTurretBaseNT.java @@ -1062,40 +1062,40 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple @Override public String[] getFunctionInfo() { return new String[] { - PREFIX_FUNCTION + "setActive" + NAME_SEPARATOR + "active (0 or 1)", - PREFIX_FUNCTION + "targetPlayers" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetAnimals" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetMobs" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "targetMachines" + NAME_SEPARATOR + "enabled (0 or 1)", - PREFIX_FUNCTION + "addWhitelist" + NAME_SEPARATOR + "name", - PREFIX_FUNCTION + "removeWhitelist" + NAME_SEPARATOR + "name", + PREFIX_FUNCTION + "setactive" + NAME_SEPARATOR + "active (0 or 1)", + PREFIX_FUNCTION + "targetplayers" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetanimals" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetmobs" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "targetmachines" + NAME_SEPARATOR + "enabled (0 or 1)", + PREFIX_FUNCTION + "addwhitelist" + NAME_SEPARATOR + "name", + PREFIX_FUNCTION + "removewhitelist" + NAME_SEPARATOR + "name", }; } @Override public String runRORFunction(String name, String[] params) { - if((PREFIX_FUNCTION + "setActive").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "setactive").equals(name) && params.length > 0) { try { this.isOn = (Integer.parseInt(params[0]) == 1); this.markChanged(); } catch(NumberFormatException e) {} } - if((PREFIX_FUNCTION + "targetPlayers").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "targetplayers").equals(name) && params.length > 0) { try { this.targetPlayers = (Integer.parseInt(params[0]) == 1); this.markChanged(); } catch(NumberFormatException e) {} } - if((PREFIX_FUNCTION + "targetAnimals").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "targetanimals").equals(name) && params.length > 0) { try { this.targetAnimals = (Integer.parseInt(params[0]) == 1); this.markChanged(); } catch(NumberFormatException e) {} } - if((PREFIX_FUNCTION + "targetMobs").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "targetmobs").equals(name) && params.length > 0) { try { this.targetMobs = (Integer.parseInt(params[0]) == 1); this.markChanged(); } catch(NumberFormatException e) {} } - if((PREFIX_FUNCTION + "targetMachines").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "targetmachines").equals(name) && params.length > 0) { try { this.targetMachines = (Integer.parseInt(params[0]) == 1); this.markChanged(); } catch(NumberFormatException e) {} } - if((PREFIX_FUNCTION + "addWhitelist").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "addwhitelist").equals(name) && params.length > 0) { String playerName = params[0]; List whitelist = this.getWhitelist(); if(!whitelist.contains(playerName)) this.addName(playerName); this.markChanged(); } - if((PREFIX_FUNCTION + "removeWhitelist").equals(name) && params.length > 0) { + if((PREFIX_FUNCTION + "removewhitelist").equals(name) && params.length > 0) { String playerName = params[0]; List whitelist = this.getWhitelist(); if(whitelist.contains(playerName)) this.removeName(whitelist.indexOf(playerName)); diff --git a/src/main/resources/assets/hbm/textures/gui/machine/gui_rtty_autocal.png b/src/main/resources/assets/hbm/textures/gui/machine/gui_rtty_autocal.png index 9f4121524c1b40b011ce38dcfdaf906b9e06105f..cb5fa04e3b41a87e4d64302e002e37e55572324e 100644 GIT binary patch delta 1875 zcmb`Hc{JOJ7RQr_)>4|+Qd`GTb1?xEI{(iL++u0JV}>f2nCnf%^tTotBKPu!5=0C@mFX- zqQL?&E7}ZnEdOfy-XRhtfy{iZV$ydvY7zRT6XZSQ(&qFE7alm*+)~{bp`kS7FBtNU zq8h$wqbqE>e1y7c7+>0V$>1Nl)?FhN8CO*-B*Q9XUAQ>80~EYO7jex zq`7~)0x&JtIgU69jtNSB1~QHc-O{+Re3Le{&9k0(U=7W*VOrcz;+n&TXpa>ixG=o@ zS5i*KQICN1lfU-9aAQPHw3m_ZsSPX!T$(0Ju51}Z{v}K4pI+*PRDfK%=dPpPeWtGF zsN$$D&*}#dYtEm#@d#bl$3A<)s<9%R4T>lKbdBrc;)a&Sn)|Db9pjeHYzH4Xdck7Pw0IRu~LZxnQaTX{I zFN>KxWYlA}MOawaulNh0*E^)80lTa_1ulb=K*R@0yl&FZoe*OyX}Y-SsvpNbRAf6& z-+VbsuujHe&k%-JHfQO#-7ckmjz(2Wbae3j??pl(ufU~1FLyNqtOazF3c;)gz)b3b ze~NvPdOxo_GVra~)jEXn03p&GGvvOLovxl^9wd0|V4uQ*LI?lVFBS#wpiq274iMYh zYp3AB;T#x;-&fp)WNh9XRj@C!?{Re83eec4#RLGl6bx(n;`07h?C z@A#3&>k?>_H?Q5(FFx~OQN6P;wQ2~NNI+1$5l$M#)rYqwbRU&y!QNQ3F?%HM>FQ;@ zSKrr`LIS?vbkC#V{ge_8Fb_Nzuhh8#>&*n0(`nx%cu7Mlv~k#p;nYp%6HjpvO4{XQ zu)Z*K+~)1Ea)(?&bxU2d))m=gFv!x;bK}WE7JAzMRmE5EXU!JSQ8i`)Y;0c`>v{cn zWtYEsq`aoTkp=`CUHvSzO77++=xhHfxFc5CiQ*k|-Ey@7Z+a6@*er9=(-+_4B3jt$ zxeNXqH^+3CkAV)l=BPJmiqtY?eSWJRLL_UK>IOKVq{^S=&&wbdUAs1sB-1Q13L2=l z)vRwZe>{KJ2nG+q&R&3TBM;%L6)t9)_v`u4Kzg))*#RD09@?y2rk%cQt*jX(>;q;h zuGO9gb0=efktp_aDPn@0sH!DvWjtJ^W>Md$1bDPrLGQ47XfRBe>Rc?6upPMQBTT-v zvTt=*Whc5~9Yi*GeL|`A6l8d%z0(Z8T&Sp8U9=S z+}`KURmf!WUEdV;r_RHlF>U2~xgj0e%NhslHNad%&tNTH{QZYjEMBNQR;i_R%IxUM zlW`ynHU})TJq^kqH15lgH8tbFm*QKM-}(%eY2rX-?VBG`c&!6vjolqH2R%6jU2z1$ z$B!R%MS`5~KsPEuIrmjTH|97iQ~AVj0o2mA)@PWE#y#<^Q|6lJN@&YJ`ge{1Uw}T3 zf9L7q;f2=4Fa6lI|@59zr~G4~|2K0EYbGxojD%@Y z4O2R;2MCxE^@gc99SJyP;J3YGA!-SHKEG9@^k_#V{-LU>Ze4>yDMt6}v^%m}hM=SH MaPzs=>Kd8%Z~3N_4gdfE delta 1862 zcmcJPYc$&l8pacsO0lY)nAqwRtJ8KE6UVJnt^8AEwxd&}hO{K17G>NoY1#;Xx5_C~ zOx;FNLEC8&Az9**qS6*y5k}M{sSMf)f<}erZq1(kuwVA$ykDO4zVA7|^FHr~M|(ha zpx7B|*XHs73f{SeR$~>l1u*#3VkJJsI(oPf1l`BDbz}AZ!i{k6tp@W_Nr*ztLS!4 zL_musL{uZuJ+3_aB*pK-UQ#Elj}cR@h(fU{N%f;#H%uOT((o zyO{*J?6-ex*A+-466w-L$=iFZF9Tm2w63aw;1hj5WvHz2D0m^By#E7O0icv2Hnrj% zRl&|Z(<6U}jGgj=N~b17uSHS{r*+E;mRa3}%A8MJnz$^Rpm2ir0qKIV455t^)WIAy z9;lk4ch4do|9%EGk28`SjcU;kJ+Ozgc4l3|7{Euo@!a~s+_ap8h%{8mqB6=flr92e z&^Id0t>&IlanI)n9Tm^W1HFOi(7eNh@MQTf8+4k!8-+<`XJ#sww*b}ef=*V(w${uK zmPv9fNJ;{lL{BYk ze9QuXZScWz-;e%~^+$}lUg5_i5oA+nQH&4zTFs8F2D&c~wL{*4yOX&qHxl|A5eitA z_kTKhG{3pE2`;mh9QC$@5P7!xG&v&K+LXwloW*Rlhekuxt3B_30EShIi&7pB*k_$9 zmE`Pk6mzc1IU=8+nK`$TIxH3|%n&_Slf_~&Ya-%d$J0xI!hd=vf_tp-WZh8u_fJT3 zmX=c>>23uEGyjW1|H8=X2hMf}@%r^ZMH^?{0gK0v%BuKJk!Y;xlQ??mU$YL1;Z)Db z!m;tF?{C1dtm7a2e`H0Ms1O$$@Kw88e>(^skK?MlA1}YJJ7@}eTJWYufx-B-<$A6Bv{b`lfPpYmGvB-s5OzJf%pUWNxI_ua z4x1?PglpR96Yv(26Ms1T*X8JQLOxPZLGZ9jtG#wq_crR&YO}s!^rwL% zi^BDB52eeLQJv5kKevR*IaPhRN5_a?9nQ@qj#rda0Xu6d<| ztvsHPA#F+GTioG%ce|zGa7U-G{U^38qLmcIoVLF3%==9+><%8rFLz4_>y>||DJUcO zMmAQrgx6$TNkW+2U^hoSr#5yiAeYQX))DBgG77Zm&`b~eZ>|4I44Fg^qs&WpGJVGx zJ@I~7^j|UiS$d91R&d<0*1MmVWIz9CL=^_vXEyh%GQLQJF~ypujw37Bz0-NFr%Vc7 zzMHz)OFj=$mx%3U@ExHl_8Y1v~zwQ`+NYhgquj!#v0eZ2Xs zTX-(gJh9Bw+=N1N*-)X>Q+#c^(hUJmjfVL~MMKyCD!zkBU#`R*oSS>`!mE?b#-`O5 zJfcrtj7xhs0^{e?pNZt!~HZiIom8P>KM|IE4n0kzlx3fWsF(T!s28ZT8; zLd=c#%yT6e+?rAA)f9UO(J(J{NjEb$?&2^0MEyKZ?j738Dg7_m7o42KuU#AL1P!Wn z&;xpqBi}*L105!{hsmp?W1&ASrylH8uf(M5*iV~0n+7zIrH$@BP^+s>7#;5*B{(46 zj2yuklDD}m+^WII*JRRf{8ZilA^jKlCkgn+v40Z#|DroK0pmS6iE*eFw;t`ttZ!zMC Ax&QzG diff --git a/src/main/resources/assets/hbm/textures/items/plate_dura_steel.png b/src/main/resources/assets/hbm/textures/items/plate_dura_steel.png index a33109cafc6ddba07e8882e93894748f0ea1ecbe..68b0b8330aadf398a3f01d9af437f84c3e772014 100644 GIT binary patch delta 269 zcmV+o0rLKm0=NQ@G=J|&L_t(Ijn&dIP69y`#_|6QW{+THb_-0T-ezMZyT>4OFL(+y zW{+W*4$c9V+yMxLfC(`nHpW=^tag=kAV_0;)nwlMzPy|kF~L|38lmR>u149V=KXHD4jQ2np6b5;P=*xvcd!zYUAK>bm5}4$U(_d{8HGR$ T3aW$v0000q(`t4v#5j{G+k-u7-H9O3M_gI zbcbV5OLx$P2sYLt7JXJUYFgEenC;8&pEr{M{^O8fkYL?N6oJyUpn4tXB9sXMNY{ed zFkeQ?$pYZ`>8L2oiqJPu7pZ^*`?E2^byx^GZ3h4lZ6oYf8($`nV53>XU^vQ+JYWz6 zI2{kTU9Q0XoLoV=7Cg^;i)29n0LPR(Vrr95P`@V$mda*-K4qzFHd=K?y~=qXNgGl9 gZV8x*l!L!GcYtkaDLmJl>h($