From 3bf9ab1570b0114bfd4ca1847a41d0c93484669e Mon Sep 17 00:00:00 2001 From: Bob Date: Tue, 21 Oct 2025 21:55:14 +0200 Subject: [PATCH] pneumonia --- changelog | 5 ++ .../com/hbm/blocks/network/PneumoTube.java | 3 ++ .../network/PneumoTubePaintableBlock.java | 3 ++ .../com/hbm/inventory/gui/GUIPneumoTube.java | 50 +++++++++++-------- .../weapon/sedna/mods/XWeaponModManager.java | 2 +- .../java/com/hbm/main/CraftingManager.java | 1 + .../network/TileEntityPneumoTube.java | 2 +- .../networkproviders/PneumaticNetwork.java | 7 +++ src/main/resources/assets/hbm/lang/de_DE.lang | 3 +- src/main/resources/assets/hbm/lang/en_US.lang | 3 +- 10 files changed, 54 insertions(+), 25 deletions(-) diff --git a/changelog b/changelog index b94bd1832..f01245c3d 100644 --- a/changelog +++ b/changelog @@ -10,6 +10,10 @@ * Despite this, sneaking allows the AoE to be disabled * Unlike pickaxes, shows a preview for what area is to be mined * Due to not being considered a tool like a vanilla one, it's not affected by dig speed penalties from fatigue, being underwater or on a ladder +* Pipe anchor + * Works like a electricity connector but for fluids + * Range of 10 blocks + * Can be connected using a pipe wrench ## Changed * Updated russian and chinese localization @@ -53,6 +57,7 @@ * Gerald is now way more expensive * PWR parts are now subject to expensive mode * Fluid container items now keep their custom name when filling or emptying +* Pneumatic tube endpoints now have a GUI that allows filters to be defined ## Fixed * Fixed the T-51b set not having radiation resistance diff --git a/src/main/java/com/hbm/blocks/network/PneumoTube.java b/src/main/java/com/hbm/blocks/network/PneumoTube.java index 4566af7dc..729f224dc 100644 --- a/src/main/java/com/hbm/blocks/network/PneumoTube.java +++ b/src/main/java/com/hbm/blocks/network/PneumoTube.java @@ -96,6 +96,9 @@ public class PneumoTube extends BlockContainer implements IToolable, ITooltipPro if(tube.isCompressor()) { FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z); return true; + } else if(tube.isEndpoint()) { + FMLNetworkHandler.openGui(player, MainRegistry.instance, 1, world, x, y, z); + return true; } } return false; diff --git a/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java b/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java index cb2d368aa..24beaae17 100644 --- a/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java +++ b/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java @@ -153,6 +153,9 @@ public class PneumoTubePaintableBlock extends BlockContainer implements IToolabl if (tube.isCompressor()) { FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z); return true; + } else if(tube.isEndpoint()) { + FMLNetworkHandler.openGui(player, MainRegistry.instance, 1, world, x, y, z); + return true; } } } diff --git a/src/main/java/com/hbm/inventory/gui/GUIPneumoTube.java b/src/main/java/com/hbm/inventory/gui/GUIPneumoTube.java index e1737e9cf..9ee7bd1b1 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIPneumoTube.java +++ b/src/main/java/com/hbm/inventory/gui/GUIPneumoTube.java @@ -25,11 +25,14 @@ import net.minecraft.util.ResourceLocation; public class GUIPneumoTube extends GuiInfoContainer { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_pneumatic_pipe.png"); + private static ResourceLocation texture_endpoint = new ResourceLocation(RefStrings.MODID + ":textures/gui/storage/gui_pneumatic_endpoint.png"); public TileEntityPneumoTube tube; + public boolean endpointOnly; - public GUIPneumoTube(InventoryPlayer invPlayer, TileEntityPneumoTube tedf) { + public GUIPneumoTube(InventoryPlayer invPlayer, TileEntityPneumoTube tedf, boolean endpointOnly) { super(new ContainerPneumoTube(invPlayer, tedf)); this.tube = tedf; + this.endpointOnly = endpointOnly; this.xSize = 176; this.ySize = 185; @@ -39,14 +42,15 @@ public class GUIPneumoTube extends GuiInfoContainer { public void drawScreen(int x, int y, float interp) { super.drawScreen(x, y, interp); - tube.compair.renderTankInfo(this, x, y, guiLeft + 7, guiTop + 16, 18, 18); - - this.drawCustomInfoStat(x, y, guiLeft + 7, guiTop + 52, 18, 18, x, y, (tube.redstone ? (EnumChatFormatting.GREEN + "ON ") : (EnumChatFormatting.RED + "OFF ")) + EnumChatFormatting.RESET + "with Redstone"); - this.drawCustomInfoStat(x, y, guiLeft + 6, guiTop + 36, 20, 8, x, y, "Compressor: " + tube.compair.getPressure() + " PU", "Max range: " + tube.getRangeFromPressure(tube.compair.getPressure()) + "m"); - - this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 16, 18, 18, x, y, EnumChatFormatting.YELLOW + "Receiver order:", tube.receiveOrder == PneumaticNetwork.RECEIVE_ROBIN ? "Round robin" : "Random"); - this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 52, 18, 18, x, y, EnumChatFormatting.YELLOW + "Provider slot order:", tube.sendOrder == PneumaticNetwork.SEND_FIRST ? "First to last" : tube.sendOrder == PneumaticNetwork.SEND_LAST ? "Last to first" : "Random"); - + if(!endpointOnly) { + tube.compair.renderTankInfo(this, x, y, guiLeft + 7, guiTop + 16, 18, 18); + + this.drawCustomInfoStat(x, y, guiLeft + 7, guiTop + 52, 18, 18, x, y, (tube.redstone ? (EnumChatFormatting.GREEN + "ON ") : (EnumChatFormatting.RED + "OFF ")) + EnumChatFormatting.RESET + "with Redstone"); + this.drawCustomInfoStat(x, y, guiLeft + 6, guiTop + 36, 20, 8, x, y, "Compressor: " + tube.compair.getPressure() + " PU", "Max range: " + tube.getRangeFromPressure(tube.compair.getPressure()) + "m"); + + this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 16, 18, 18, x, y, EnumChatFormatting.YELLOW + "Receiver order:", tube.receiveOrder == PneumaticNetwork.RECEIVE_ROBIN ? "Round robin" : "Random"); + this.drawCustomInfoStat(x, y, guiLeft + 151, guiTop + 52, 18, 18, x, y, EnumChatFormatting.YELLOW + "Provider slot order:", tube.sendOrder == PneumaticNetwork.SEND_FIRST ? "First to last" : tube.sendOrder == PneumaticNetwork.SEND_LAST ? "Last to first" : "Random"); + } if(this.mc.thePlayer.inventory.getItemStack() == null) { for(int i = 0; i < 15; ++i) { @@ -63,11 +67,14 @@ public class GUIPneumoTube extends GuiInfoContainer { protected void mouseClicked(int x, int y, int i) { super.mouseClicked(x, y, i); - click(x, y, 7, 52, 18, 18, "redstone"); - click(x, y, 6, 36, 20, 8, "pressure"); + if(!endpointOnly) { + click(x, y, 7, 52, 18, 18, "redstone"); + click(x, y, 6, 36, 20, 8, "pressure"); + click(x, y, 151, 16, 18, 18, "receive"); + click(x, y, 151, 52, 18, 18, "send"); + } + click(x, y, 128, 30, 14, 26, "whitelist"); - click(x, y, 151, 16, 18, 18, "receive"); - click(x, y, 151, 52, 18, 18, "send"); } public void click(int x, int y, int left, int top, int sizeX, int sizeY, String name) { @@ -90,21 +97,22 @@ public class GUIPneumoTube extends GuiInfoContainer { @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); + Minecraft.getMinecraft().getTextureManager().bindTexture(endpointOnly ? texture_endpoint : texture); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); - if(tube.redstone) drawTexturedModalRect(guiLeft + 7, guiTop + 52, 179, 0, 18, 18); - if(tube.whitelist) { drawTexturedModalRect(guiLeft + 139, guiTop + 33, 176, 0, 3, 6); } else { drawTexturedModalRect(guiLeft + 139, guiTop + 47, 176, 0, 3, 6); } - drawTexturedModalRect(guiLeft + 151, guiTop + 16, 197, 18 * tube.receiveOrder, 18, 18); - drawTexturedModalRect(guiLeft + 151, guiTop + 52, 215, 18 * tube.sendOrder, 18, 18); - - drawTexturedModalRect(guiLeft + 6 + 4 * (tube.compair.getPressure() - 1), guiTop + 36, 179, 18, 4, 8); - GaugeUtil.drawSmoothGauge(guiLeft + 16, guiTop + 25, this.zLevel, (double) tube.compair.getFill() / (double) tube.compair.getMaxFill(), 5, 2, 1, 0xCA6C43, 0xAB4223); + if(!endpointOnly) { + if(tube.redstone) drawTexturedModalRect(guiLeft + 7, guiTop + 52, 179, 0, 18, 18); + drawTexturedModalRect(guiLeft + 151, guiTop + 16, 197, 18 * tube.receiveOrder, 18, 18); + drawTexturedModalRect(guiLeft + 151, guiTop + 52, 215, 18 * tube.sendOrder, 18, 18); + + drawTexturedModalRect(guiLeft + 6 + 4 * (tube.compair.getPressure() - 1), guiTop + 36, 179, 18, 4, 8); + GaugeUtil.drawSmoothGauge(guiLeft + 16, guiTop + 25, this.zLevel, (double) tube.compair.getFill() / (double) tube.compair.getMaxFill(), 5, 2, 1, 0xCA6C43, 0xAB4223); + } } } diff --git a/src/main/java/com/hbm/items/weapon/sedna/mods/XWeaponModManager.java b/src/main/java/com/hbm/items/weapon/sedna/mods/XWeaponModManager.java index 2dc9cb2e6..25a561aa4 100644 --- a/src/main/java/com/hbm/items/weapon/sedna/mods/XWeaponModManager.java +++ b/src/main/java/com/hbm/items/weapon/sedna/mods/XWeaponModManager.java @@ -162,7 +162,7 @@ public class XWeaponModManager { new WeaponModDefinition(EnumModSpecial.ENGINE_DIESEL).addMod(new Item[] {ModItems.gun_drill}, new WeaponModEngine(ID_ENGINE_DIESEL).mag(WeaponModEngine.ENGINE_DIESEL).delay(15)); new WeaponModDefinition(EnumModSpecial.ENGINE_AVIATION).addMod(new Item[] {ModItems.gun_drill}, new WeaponModEngine(ID_ENGINE_AVIATION).mag(WeaponModEngine.ENGINE_AVIATION).delay(10)); new WeaponModDefinition(EnumModSpecial.ENGINE_ELECTRIC).addMod(new Item[] {ModItems.gun_drill}, new WeaponModEngine(ID_ENGINE_ELECTRIC).mag(WeaponModEngine.ENGINE_ELECTRIC).delay(15)); - new WeaponModDefinition(EnumModSpecial.ENGINE_TURBO).addMod(new Item[] {ModItems.gun_drill}, new WeaponModEngine(ID_ENGINE_TURBO).mag(WeaponModEngine.ENGINE_TURBO).delay(2)); + new WeaponModDefinition(EnumModSpecial.ENGINE_TURBO).addMod(new Item[] {ModItems.gun_drill}, new WeaponModEngine(ID_ENGINE_TURBO).mag(WeaponModEngine.ENGINE_TURBO).delay(5)); new WeaponModDefinition(EnumModSpecial.MAGNET).addMod(new Item[] {ModItems.gun_drill}, new WeaponModDrillFortune(230, "MAGNET", 2)); new WeaponModDefinition(EnumModSpecial.SIFTER).addMod(new Item[] {ModItems.gun_drill}, new WeaponModDrillFortune(231, "SIFTER", 1)); new WeaponModDefinition(EnumModSpecial.CANISTERS).addMod(new Item[] {ModItems.gun_drill}, new WeaponModCanisters(232)); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index e4c6bf68c..c1415162d 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -613,6 +613,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.pneumatic_tube, 8), new Object[] { "CRC", 'C', CU.plateCast(), 'R', ANY_RUBBER.ingot() }); addRecipeAuto(new ItemStack(ModBlocks.pneumatic_tube, 24), new Object[] { "CRC", 'C', CU.plateWelded(), 'R', ANY_RUBBER.ingot() }); addRecipeAuto(new ItemStack(ModBlocks.pneumatic_tube_paintable, 4), new Object[] { "SAS", "A A", "SAS", 'S', STEEL.plate(), 'A', ModBlocks.pneumatic_tube}); + addRecipeAuto(new ItemStack(ModBlocks.pipe_anchor, 2), new Object[] { "P", "P", "S", 'P', STEEL.pipe(), 'S', STEEL.ingot() }); addRecipeAuto(new ItemStack(ModItems.template_folder, 1), new Object[] { "LPL", "BPB", "LPL", 'P', Items.paper, 'L', "dye", 'B', "dye" }); addRecipeAuto(new ItemStack(ModItems.pellet_antimatter, 1), new Object[] { "###", "###", "###", '#', ModItems.cell_antimatter }); diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityPneumoTube.java b/src/main/java/com/hbm/tileentity/network/TileEntityPneumoTube.java index 571494c35..03a3879b9 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityPneumoTube.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityPneumoTube.java @@ -257,7 +257,7 @@ public class TileEntityPneumoTube extends TileEntityMachineBase implements IGUIP @Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { - return new GUIPneumoTube(player.inventory, this); + return new GUIPneumoTube(player.inventory, this, ID == 1); } @Override diff --git a/src/main/java/com/hbm/uninos/networkproviders/PneumaticNetwork.java b/src/main/java/com/hbm/uninos/networkproviders/PneumaticNetwork.java index 39043131a..336fbf86d 100644 --- a/src/main/java/com/hbm/uninos/networkproviders/PneumaticNetwork.java +++ b/src/main/java/com/hbm/uninos/networkproviders/PneumaticNetwork.java @@ -84,6 +84,7 @@ public class PneumaticNetwork extends NodeNet { if(chosenReceiverEntry == null) return false; IInventory dest = chosenReceiverEntry.getKey(); + TileEntityPneumoTube endpointTile = chosenReceiverEntry.getValue().getZ(); ISidedInventory sidedDest = dest instanceof ISidedInventory ? (ISidedInventory) dest : null; ISidedInventory sidedSource = source instanceof ISidedInventory ? (ISidedInventory) source : null; @@ -108,8 +109,14 @@ public class PneumaticNetwork extends NodeNet { ItemStack sourceStack = source.getStackInSlot(sourceIndex); if(sourceStack == null) continue; if(sidedSource != null && !sidedSource.canExtractItem(sourceIndex, sourceStack, sourceSide)) continue; + // filter of the source boolean match = tube.matchesFilter(sourceStack); if((match && !tube.whitelist) || (!match && tube.whitelist)) continue; + // filter of the receiver, only if the sender and receiver aren't the same block + if(endpointTile != null && endpointTile != tube) { + match = endpointTile.matchesFilter(sourceStack); + if((match && !endpointTile.whitelist) || (!match && endpointTile.whitelist)) continue; + } // the "mass" of an item. something that only stacks to 4 has a "mass" of 16. max transfer mass is 64, i.e. one standard stack, or one single unstackable item int proportionalValue = MathHelper.clamp_int(64 / sourceStack.getMaxStackSize(), 1, 64); diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index a47a56742..0624bd030 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -4699,6 +4699,7 @@ tile.pink_log.name=Pinkes Holz tile.pink_planks.name=Pinke Holzbretter tile.pink_slab.name=Pinke Holzstufe tile.pink_stairs.name=Pinke Holztreppen +tile.pipe_anchor.name=Rohr-Anker tile.piston_inserter.name=Einsetzer-Kolben tile.piston_inserter.desc=Kann ein Item halten$Wenn mit Redstone aktiviert, setzt das Item in gebohrten Graphit ein$Alle Items in gebohrten Graphitblöcken in der Linie werden einen Block verschoben$Benötigt einen Luftblock zwischen sich selbst und dem Graphit tile.plant_dead.name=Tote Pflanze @@ -4960,7 +4961,7 @@ tile.vent_chlorine.name=Chlorgas-Auslass tile.vent_chlorine_seal.name=Chlorgassiegel tile.vent_cloud.name=Wolken-Auslass tile.vent_pink_cloud.name=Pinker Wolken-Auslass -tile.vine_phosphor.large.name=Phosphorranken +tile.vine_phosphor.name=Phosphorranken tile.vinyl_tile.large.name=Große Vinylfliesen tile.vinyl_tile.small.name=Kleine Vinylfliesen tile.vitrified_barrel.name=Fass voll vitrifiziertem Atommüll diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 79da8ba6b..627305fba 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -5976,6 +5976,7 @@ tile.pink_log.name=Pink Log tile.pink_planks.name=Pink Wood Planks tile.pink_slab.name=Pink Wood Slab tile.pink_stairs.name=Pink Wood Stairs +tile.pipe_anchor.name=Pipe Anchor tile.piston_inserter.name=Inserter tile.piston_inserter.desc=Can receive one item using automation$Using redstone, it will insert the item into drilled graphite$All drilled graphite in the chain will have their items pushed by one block$Needs one block of air between the graphite tile.plant_dead.name=Dead Plant @@ -6294,7 +6295,7 @@ tile.vent_chlorine.name=Chlorine Vent tile.vent_chlorine_seal.name=Chlorine Seal tile.vent_cloud.name=Cloud Vent tile.vent_pink_cloud.name=Pink Cloud Vent -tile.vine_phosphor.large.name=Phosphor Vines +tile.vine_phosphor.name=Phosphor Vines tile.vinyl_tile.large.name=Large Vinyl Tile tile.vinyl_tile.small.name=Small Vinyl Tiles tile.vitrified_barrel.name=Vitrified Nuclear Waste Drum