diff --git a/meta/update.json b/meta/update.json index 7b8e006..0fc6c27 100644 --- a/meta/update.json +++ b/meta/update.json @@ -1,6 +1,7 @@ { "homepage": "https://www.curseforge.com/minecraft/mc-mods/engineers-decor/", "1.16.4": { + "1.1.4-b2": "[A] Steel Catwalks added (top and bottom aligned).\n[A] Steel Railings added.\n[F] Fixed Empty Fluid Barrel crafting crash (ty inflamedsebi).\n[A] Added Solar Panel power balancing.\n[M] GUI Button tooltip delay reduced to 800ms.\n[M] Hopper and Placer: Added \"Redstone ignored\" mode, changed icons from signal-like to Redstone-Torch-like.", "1.1.4-b1": "[U] Ported to 1.16.4.", "1.1.3": "[R] Release build v1.1.3.", "1.1.3-b3": "[A] Metal Sliding Door added (double door wing style).\n[A] Doors implicitly open/close adjacent wings of double doors.\n[A] Disabled injected buttons from other mods in container GUIs.\n[A] Mob spawning on Rebar/Gas Concrete inhibited (IE Concrete Compliancy).\n[M] Small Tree Cutter chopping improved (loosened tree volume search restrictions).", @@ -18,6 +19,6 @@ }, "promos": { "1.16.4-recommended": "1.1.3", - "1.16.4-latest": "1.1.4-b1" + "1.16.4-latest": "1.1.4-b2" } } \ No newline at end of file diff --git a/readme.md b/readme.md index b3a9c42..20ed613 100644 --- a/readme.md +++ b/readme.md @@ -11,11 +11,12 @@ Mod sources for Minecraft version 1.16.x. ## Version history - ~ v1.1.4-b2 [A] Steel Catwalks added (top and bottom aligned). + - v1.1.4-b2 [A] Steel Catwalks added (top and bottom aligned). [A] Steel Railings added. [F] Fixed Empty Fluid Barrel crafting crash (ty inflamedsebi). [A] Added Solar Panel power balancing. [M] GUI Button tooltip delay reduced to 800ms. + [M] Hopper and Placer: Added "Redstone ignored" mode, changed icons from signal-like to Redstone-Torch-like. - v1.1.4-b1 [U] Ported to 1.16.4. diff --git a/src/main/java/wile/engineersdecor/blocks/EdHopper.java b/src/main/java/wile/engineersdecor/blocks/EdHopper.java index 7307946..edb4d74 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdHopper.java +++ b/src/main/java/wile/engineersdecor/blocks/EdHopper.java @@ -209,8 +209,10 @@ public class EdHopper public static final int MAX_COLLECTION_RANGE = 4; public static final int PERIOD_OFFSET = 10; /// - public static final int LOGIC_INVERTED = 0x01; - public static final int LOGIC_CONTINUOUS = 0x02; + public static final int LOGIC_NOT_INVERTED = 0x00; + public static final int LOGIC_INVERTED = 0x01; + public static final int LOGIC_CONTINUOUS = 0x02; + public static final int LOGIC_IGNORE_EXT = 0x04; /// private boolean block_power_signal_ = false; private boolean block_power_updated_ = false; @@ -644,9 +646,9 @@ public class EdHopper tick_timer_ = TICK_INTERVAL; // Cycle init boolean dirty = block_power_updated_; - final boolean rssignal = ((logic_ & LOGIC_INVERTED)!=0)==(!block_power_signal_); - final boolean pulse_mode = ((logic_ & LOGIC_CONTINUOUS)==0); - boolean trigger = (rssignal && ((block_power_updated_) || (!pulse_mode))); + final boolean rssignal = ((logic_ & LOGIC_IGNORE_EXT)!=0) || ((logic_ & LOGIC_INVERTED)!=0)==(!block_power_signal_); + final boolean pulse_mode = ((logic_ & (LOGIC_CONTINUOUS|LOGIC_IGNORE_EXT))==0); + boolean trigger = ((logic_ & LOGIC_IGNORE_EXT)!=0) || (rssignal && ((block_power_updated_) || (!pulse_mode))); final BlockState state = world.getBlockState(pos); if(!(state.getBlock() instanceof HopperBlock)) { block_power_signal_= false; return; } final Direction hopper_facing = state.get(HopperBlock.FACING); @@ -932,7 +934,15 @@ public class EdHopper } else if(isPointInRegion(133, 49, 9, 9, mouseX, mouseY)) { container.onGuiAction("manual_trigger", 1); } else if(isPointInRegion(145, 49, 9, 9, mouseX, mouseY)) { - container.onGuiAction("logic", container.field(2) ^ HopperTileEntity.LOGIC_INVERTED); + final int mask = (HopperTileEntity.LOGIC_INVERTED|HopperTileEntity.LOGIC_IGNORE_EXT|HopperTileEntity.LOGIC_NOT_INVERTED); + int logic = (container.field(2) & mask); + switch(logic) { + case HopperTileEntity.LOGIC_NOT_INVERTED: logic = HopperTileEntity.LOGIC_INVERTED; break; + case HopperTileEntity.LOGIC_INVERTED: logic = HopperTileEntity.LOGIC_IGNORE_EXT; break; + case HopperTileEntity.LOGIC_IGNORE_EXT: logic = HopperTileEntity.LOGIC_NOT_INVERTED; break; + default: logic = HopperTileEntity.LOGIC_IGNORE_EXT; + } + container.onGuiAction("logic", (container.field(2) & (~mask)) | logic); } else if(isPointInRegion(159, 49, 7, 9, mouseX, mouseY)) { container.onGuiAction("logic", container.field(2) ^ HopperTileEntity.LOGIC_CONTINUOUS); } @@ -986,8 +996,9 @@ public class EdHopper } // trigger logic { - int inverter_offset = ((container.field(2) & HopperTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0; - blit(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9); + int inverter_offset_x = ((container.field(2) & HopperTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0; + int inverter_offset_y = ((container.field(2) & HopperTileEntity.LOGIC_IGNORE_EXT) != 0) ? 10 : 0; + blit(mx, x0+145, y0+49, 177+inverter_offset_x, 49+inverter_offset_y, 9, 9); int pulse_mode_offset = ((container.field(2) & HopperTileEntity.LOGIC_CONTINUOUS ) != 0) ? 9 : 0; blit(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9); } diff --git a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java index 854045d..371955b 100644 --- a/src/main/java/wile/engineersdecor/blocks/EdPlacer.java +++ b/src/main/java/wile/engineersdecor/blocks/EdPlacer.java @@ -187,12 +187,14 @@ public class EdPlacer public static final int NUM_OF_SLOTS = 18; public static final int NUM_OF_FIELDS = 3; /// - public static final int LOGIC_INVERTED = 0x01; - public static final int LOGIC_CONTINUOUS = 0x02; + public static final int LOGIC_NOT_INVERTED = 0x00; + public static final int LOGIC_INVERTED = 0x01; + public static final int LOGIC_CONTINUOUS = 0x02; + public static final int LOGIC_IGNORE_EXT = 0x04; /// private boolean block_power_signal_ = false; private boolean block_power_updated_ = false; - private int logic_ = LOGIC_INVERTED|LOGIC_CONTINUOUS; + private int logic_ = LOGIC_IGNORE_EXT|LOGIC_CONTINUOUS; private int current_slot_index_ = 0; private int tick_timer_ = 0; protected NonNullList stacks_; @@ -579,8 +581,8 @@ public class EdPlacer final BlockState state = world.getBlockState(pos); if(!(state.getBlock() instanceof PlacerBlock)) { block_power_signal_= false; return; } final boolean updated = block_power_updated_; - final boolean rssignal = ((logic_ & LOGIC_INVERTED)!=0)==(!block_power_signal_); - final boolean trigger = (rssignal && ((updated) || ((logic_ & LOGIC_CONTINUOUS)!=0))); + final boolean rssignal = ((logic_ & LOGIC_IGNORE_EXT)!=0) || ((logic_ & LOGIC_INVERTED)!=0)==(!block_power_signal_); + final boolean trigger = ((logic_ & LOGIC_IGNORE_EXT)!=0) || (rssignal && ((updated) || ((logic_ & LOGIC_CONTINUOUS)!=0))); final Direction placer_facing = state.get(PlacerBlock.FACING); boolean dirty = updated; // Trigger edge detection for next cycle @@ -762,9 +764,9 @@ public class EdPlacer } @Override - public void render/*render*/(MatrixStack mx, int mouseX, int mouseY, float partialTicks) + public void render(MatrixStack mx, int mouseX, int mouseY, float partialTicks) { - renderBackground/*renderBackground*/(mx); + renderBackground(mx); super.render(mx, mouseX, mouseY, partialTicks); if(!tooltip_.render(mx, this, mouseX, mouseY)) renderHoveredTooltip(mx, mouseX, mouseY); } @@ -774,7 +776,7 @@ public class EdPlacer {} @Override - public boolean mouseClicked/*mouseClicked*/(double mouseX, double mouseY, int mouseButton) + public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) { tooltip_.resetTimer(); PlacerContainer container = (PlacerContainer)getContainer(); @@ -784,7 +786,15 @@ public class EdPlacer } else if(isPointInRegion(133, 49, 9, 9, mouseX, mouseY)) { container.onGuiAction("manual_trigger", 1); } else if(isPointInRegion(145, 49, 9, 9, mouseX, mouseY)) { - container.onGuiAction("logic", container.field(0) ^ PlacerTileEntity.LOGIC_INVERTED); + final int mask = (PlacerTileEntity.LOGIC_INVERTED|PlacerTileEntity.LOGIC_IGNORE_EXT|PlacerTileEntity.LOGIC_NOT_INVERTED); + int logic = (container.field(0) & mask); + switch(logic) { + case PlacerTileEntity.LOGIC_NOT_INVERTED: logic = PlacerTileEntity.LOGIC_INVERTED; break; + case PlacerTileEntity.LOGIC_INVERTED: logic = PlacerTileEntity.LOGIC_IGNORE_EXT; break; + case PlacerTileEntity.LOGIC_IGNORE_EXT: logic = PlacerTileEntity.LOGIC_NOT_INVERTED; break; + default: logic = PlacerTileEntity.LOGIC_IGNORE_EXT; + } + container.onGuiAction("logic", (container.field(0) & (~mask)) | logic); } else if(isPointInRegion(159, 49, 7, 9, mouseX, mouseY)) { container.onGuiAction("logic", container.field(0) ^ PlacerTileEntity.LOGIC_CONTINUOUS); } @@ -806,7 +816,7 @@ public class EdPlacer @Override @SuppressWarnings("deprecation") - protected void drawGuiContainerBackgroundLayer/*drawGuiContainerBackgroundLayer*/(MatrixStack mx, float partialTicks, int mouseX, int mouseY) + protected void drawGuiContainerBackgroundLayer(MatrixStack mx, float partialTicks, int mouseX, int mouseY) { RenderSystem.enableBlend(); RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F); @@ -830,8 +840,9 @@ public class EdPlacer } // trigger logic { - int inverter_offset = ((container.field(0) & PlacerTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0; - blit(mx, x0+145, y0+49, 177+inverter_offset, 49, 9, 9); + int inverter_offset_x = ((container.field(0) & PlacerTileEntity.LOGIC_INVERTED) != 0) ? 11 : 0; + int inverter_offset_y = ((container.field(0) & PlacerTileEntity.LOGIC_IGNORE_EXT) != 0) ? 10 : 0; + blit(mx, x0+145, y0+49, 177+inverter_offset_x, 49+inverter_offset_y, 9, 9); int pulse_mode_offset = ((container.field(0) & PlacerTileEntity.LOGIC_CONTINUOUS ) != 0) ? 9 : 0; blit(mx, x0+159, y0+49, 199+pulse_mode_offset, 49, 9, 9); } diff --git a/src/main/resources/assets/engineersdecor/lang/en_us.json b/src/main/resources/assets/engineersdecor/lang/en_us.json index f413639..197ace7 100644 --- a/src/main/resources/assets/engineersdecor/lang/en_us.json +++ b/src/main/resources/assets/engineersdecor/lang/en_us.json @@ -93,14 +93,14 @@ "block.engineersdecor.factory_hopper.help": "Hopper suitable for advanced factory\n automation. Can transfer half-stacks, max\n collection range 9x9. GUI Slider controls:\n - Collection range (0 to 4)\n - Insertion delay (0.5s to 10s)\n - Insertion stack size (1 to 32).\n GUI Redstone controls:\n Not inverted / inverted (default),\n pulse mode / continuous mode (default).", "block.engineersdecor.factory_hopper.tooltips.count": "Insertion stack size §8(1 to 32 items)", "block.engineersdecor.factory_hopper.tooltips.delayindicator": "Delay indicator\n§8Blinks when the insertion delay timer has not expired yet, or when the Hopper cannot insert into the adjacent inventory.", - "block.engineersdecor.factory_hopper.tooltips.inversion": "Inversion mode §8(inverted/not inverted)", + "block.engineersdecor.factory_hopper.tooltips.inversion": "Redstone mode §8(inverted/not inverted/ignored)", "block.engineersdecor.factory_hopper.tooltips.period": "Insertion delay §8(1s to 10s)", "block.engineersdecor.factory_hopper.tooltips.range": "Collection radius §8(0 to 4)", "block.engineersdecor.factory_hopper.tooltips.rssignal": "External Redstone signal indicator", "block.engineersdecor.factory_hopper.tooltips.triggermode": "Trigger mode §8(continuous/pulse)", "block.engineersdecor.factory_placer": "Factory Block Placer", "block.engineersdecor.factory_placer.help": "Allows placing blocks and planting\n crops or trees. GUI Redstone controls:\n Not inverted / inverted (default),\n pulse mode / continuous mode (default).\n Also supports spike planing from\n underneath the soil. Spits out items\n that it cannot place or plant.", - "block.engineersdecor.factory_placer.tooltips.inversion": "Inversion mode §8(inverted/not inverted)", + "block.engineersdecor.factory_placer.tooltips.inversion": "Redstone mode §8(inverted/not inverted/ignored)", "block.engineersdecor.factory_placer.tooltips.rssignal": "External Redstone signal indicator", "block.engineersdecor.factory_placer.tooltips.triggermode": "Trigger mode §8(continuous/pulse)", "block.engineersdecor.fluid_barrel": "Fluid Barrel", diff --git a/src/main/resources/assets/engineersdecor/textures/gui/factory_hopper_gui.png b/src/main/resources/assets/engineersdecor/textures/gui/factory_hopper_gui.png index 78c19f0..2179b95 100644 Binary files a/src/main/resources/assets/engineersdecor/textures/gui/factory_hopper_gui.png and b/src/main/resources/assets/engineersdecor/textures/gui/factory_hopper_gui.png differ diff --git a/src/main/resources/assets/engineersdecor/textures/gui/factory_placer_gui.png b/src/main/resources/assets/engineersdecor/textures/gui/factory_placer_gui.png index 5e47521..9c4045a 100644 Binary files a/src/main/resources/assets/engineersdecor/textures/gui/factory_placer_gui.png and b/src/main/resources/assets/engineersdecor/textures/gui/factory_placer_gui.png differ