From 308fcf71f8fcd25c45fe94dca8e3651eb839436a Mon Sep 17 00:00:00 2001 From: Boblet Date: Fri, 17 Apr 2026 14:54:08 +0200 Subject: [PATCH 1/3] chop chop --- changelog | 6 +- src/main/java/com/hbm/blocks/ModBlocks.java | 3 - .../com/hbm/blocks/generic/BlockPlasma.java | 42 ----------- .../com/hbm/explosion/ExplosionChaos.java | 22 ------ .../inventory/recipes/anvil/AnvilRecipes.java | 13 ++++ .../com/hbm/items/block/ItemBlockLore.java | 2 +- src/main/java/com/hbm/main/MainRegistry.java | 1 + .../entity/effect/RenderCloudSolinium.java | 66 ++++++++++-------- .../hbm/textures/blocks/fusion_hatch_alt.png | Bin 581 -> 0 bytes .../blocks/fusion_heater_side_base.png | Bin 265 -> 0 bytes .../assets/hbm/textures/blocks/plasma.png | Bin 4701 -> 0 bytes .../hbm/textures/blocks/plasma.png.mcmeta | 45 ------------ 12 files changed, 57 insertions(+), 143 deletions(-) delete mode 100644 src/main/java/com/hbm/blocks/generic/BlockPlasma.java delete mode 100644 src/main/resources/assets/hbm/textures/blocks/fusion_hatch_alt.png delete mode 100644 src/main/resources/assets/hbm/textures/blocks/fusion_heater_side_base.png delete mode 100644 src/main/resources/assets/hbm/textures/blocks/plasma.png delete mode 100644 src/main/resources/assets/hbm/textures/blocks/plasma.png.mcmeta diff --git a/changelog b/changelog index b98eaa7aa..0cd64c5ff 100644 --- a/changelog +++ b/changelog @@ -11,7 +11,11 @@ * EMP grenades now destroy machines in a small radius like an EMP missile would * Grenades are no longer affected by nuclear blasts or other grenade explosions * Players no longer receive the starting guide book on first spawn since it's now very outdated -* All redstone-over-radio panels now have QMAW integration +* All RoR panels now have QMAW integration +* Legacy plasma heater and plasma heater hatches which are still found in crashed space ships can now be dismantled into steel pipes, copper pipes and analog circuits +* Removed legacy plasma block +* RoR panels now have OpenComputers integration, allowing otherwise fixed parameters like gauge thresholds, channels, and button commands to be adjusted on the fly +* Solinium blasts now use the new higher poly sphere model and frame interpolation, making the expansion smoother ## Fixed * Fixed the grenade crafting handler not checking if a shell/filling combination is even valid, allowing weird combos diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 4cd964c56..73ef2a6d8 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -866,7 +866,6 @@ public class ModBlocks { @Deprecated public static Block fusion_heater; @Deprecated public static Block fusion_hatch; - @Deprecated public static Block plasma; // only actually used by the old plasma grenade, will die with the grenade rework @Deprecated public static Block iter; @Deprecated public static Block plasma_heater; @@ -1984,7 +1983,6 @@ public class ModBlocks { fusion_heater = new BlockPillar(Material.iron, RefStrings.MODID + ":fusion_heater_top").setBlockName("fusion_heater").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fusion_heater_side"); fusion_hatch = new FusionHatch(Material.iron).setBlockName("fusion_hatch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":fusion_hatch"); - plasma = new BlockPlasma(Material.iron).setBlockName("plasma").setHardness(5.0F).setResistance(6000.0F).setLightLevel(1.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":plasma"); iter = new MachineITER().setBlockName("iter").setHardness(5.0F).setResistance(60.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":iter"); plasma_heater = new MachinePlasmaHeater().setBlockName("plasma_heater").setHardness(5.0F).setResistance(60.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":plasma_heater"); @@ -3345,7 +3343,6 @@ public class ModBlocks { //Multiblock Generators GameRegistry.registerBlock(fusion_heater, fusion_heater.getUnlocalizedName()); GameRegistry.registerBlock(fusion_hatch, fusion_hatch.getUnlocalizedName()); - GameRegistry.registerBlock(plasma, ItemBlockLore.class, plasma.getUnlocalizedName()); GameRegistry.registerBlock(iter, iter.getUnlocalizedName()); GameRegistry.registerBlock(plasma_heater, plasma_heater.getUnlocalizedName()); diff --git a/src/main/java/com/hbm/blocks/generic/BlockPlasma.java b/src/main/java/com/hbm/blocks/generic/BlockPlasma.java deleted file mode 100644 index b47f52d90..000000000 --- a/src/main/java/com/hbm/blocks/generic/BlockPlasma.java +++ /dev/null @@ -1,42 +0,0 @@ -package com.hbm.blocks.generic; - -import java.util.Random; - -import net.minecraft.block.Block; -import net.minecraft.block.material.Material; -import net.minecraft.entity.Entity; -import net.minecraft.init.Blocks; -import net.minecraft.item.Item; -import net.minecraft.util.AxisAlignedBB; -import net.minecraft.world.World; - -@Deprecated -public class BlockPlasma extends Block { - - public BlockPlasma(Material p_i45394_1_) { - super(p_i45394_1_); - this.setTickRandomly(true); - } - - @Override - public void updateTick(World world, int x, int y, int z, Random rand) { - if(world.getGameRules().getGameRuleBooleanValue("doFireTick")) - world.setBlock(x, y, z, Blocks.air); - } - - @Override - public AxisAlignedBB getCollisionBoundingBoxFromPool(World p_149668_1_, int p_149668_2_, int p_149668_3_, int p_149668_4_) { - return null; - } - - @Override - public void onEntityCollidedWithBlock(World p_149670_1_, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity p_149670_5_) { - p_149670_5_.setFire(10); - p_149670_5_.setInWeb(); - } - - @Override public boolean isOpaqueCube() { return false; } - @Override public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) { return null; } - @Override public boolean renderAsNormalBlock() { return false; } - -} diff --git a/src/main/java/com/hbm/explosion/ExplosionChaos.java b/src/main/java/com/hbm/explosion/ExplosionChaos.java index 95c1e9f7f..49ae5c0b1 100644 --- a/src/main/java/com/hbm/explosion/ExplosionChaos.java +++ b/src/main/java/com/hbm/explosion/ExplosionChaos.java @@ -501,28 +501,6 @@ public class ExplosionChaos { //TODO: destroy this entire class radius = (int) f; } - public static void plasma(World world, int x, int y, int z, int radius) { - int r = radius; - int r2 = r * r; - int r22 = r2 / 2; - for (int xx = -r; xx < r; xx++) { - int X = xx + x; - int XX = xx * xx; - for (int yy = -r; yy < r; yy++) { - int Y = yy + y; - int YY = XX + yy * yy; - for (int zz = -r; zz < r; zz++) { - int Z = zz + z; - int ZZ = YY + zz * zz; - if (ZZ < r22 + world.rand.nextInt(r22 / 2)) { - if(world.getBlock(X, Y, Z) != ModBlocks.statue_elb_f) - world.setBlock(X, Y, Z, ModBlocks.plasma); - } - } - } - } - } - public static void levelDown(World world, int x, int y, int z, int radius) { if(!world.isRemote) diff --git a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java index e3bb7c440..476b4a456 100644 --- a/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/anvil/AnvilRecipes.java @@ -1026,6 +1026,19 @@ public class AnvilRecipes extends SerializableRecipe { new AnvilOutput(new ItemStack(Items.bone, 1), 0.75F), new AnvilOutput(new ItemStack(Items.experience_bottle, 1), 0.5F) }).setTier(1)); + + constructionRecipes.add(new AnvilConstructionRecipe( + new ComparableStack(ModBlocks.fusion_heater), new AnvilOutput[] { + new AnvilOutput(new ItemStack(ModItems.pipe, 4, Mats.MAT_STEEL.id)), + new AnvilOutput(new ItemStack(ModItems.pipe, 2, Mats.MAT_COPPER.id)), + new AnvilOutput(new ItemStack(ModItems.circuit, 1, EnumCircuitType.ANALOG.ordinal()), 0.5F) + }).setTier(1)); + constructionRecipes.add(new AnvilConstructionRecipe( + new ComparableStack(ModBlocks.fusion_hatch), new AnvilOutput[] { + new AnvilOutput(new ItemStack(ModItems.pipe, 4, Mats.MAT_STEEL.id)), + new AnvilOutput(new ItemStack(ModItems.pipe, 4, Mats.MAT_COPPER.id)), + new AnvilOutput(new ItemStack(ModItems.circuit, 1, EnumCircuitType.ANALOG.ordinal()), 0.75F) + }).setTier(1)); } public static List getSmithing() { diff --git a/src/main/java/com/hbm/items/block/ItemBlockLore.java b/src/main/java/com/hbm/items/block/ItemBlockLore.java index 13bd6b2e4..9d6d7f43f 100644 --- a/src/main/java/com/hbm/items/block/ItemBlockLore.java +++ b/src/main/java/com/hbm/items/block/ItemBlockLore.java @@ -59,7 +59,7 @@ public class ItemBlockLore extends ItemBlockBase { if(this.field_150939_a == ModBlocks.gravel_diamond) return EnumRarity.rare; - if(this.field_150939_a == ModBlocks.block_euphemium || this.field_150939_a == ModBlocks.block_euphemium_cluster || this.field_150939_a == ModBlocks.plasma) + if(this.field_150939_a == ModBlocks.block_euphemium || this.field_150939_a == ModBlocks.block_euphemium_cluster) return EnumRarity.epic; return EnumRarity.common; diff --git a/src/main/java/com/hbm/main/MainRegistry.java b/src/main/java/com/hbm/main/MainRegistry.java index 8b6c3ccb8..f84196a1a 100644 --- a/src/main/java/com/hbm/main/MainRegistry.java +++ b/src/main/java/com/hbm/main/MainRegistry.java @@ -1569,6 +1569,7 @@ public class MainRegistry { ignoreMappings.add("hbm:item.grenade_if_null"); ignoreMappings.add("hbm:item.grenade_kit"); ignoreMappings.add("hbm:item.nuclear_waste_pearl"); + ignoreMappings.add("hbm:tile.plasma"); /// REMAP /// remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses); diff --git a/src/main/java/com/hbm/render/entity/effect/RenderCloudSolinium.java b/src/main/java/com/hbm/render/entity/effect/RenderCloudSolinium.java index 4c077afbc..43c96ceb7 100644 --- a/src/main/java/com/hbm/render/entity/effect/RenderCloudSolinium.java +++ b/src/main/java/com/hbm/render/entity/effect/RenderCloudSolinium.java @@ -3,44 +3,52 @@ package com.hbm.render.entity.effect; import org.lwjgl.opengl.GL11; import com.hbm.entity.effect.EntityCloudSolinium; -import com.hbm.lib.RefStrings; +import com.hbm.main.ResourceManager; +import com.hbm.util.ColorUtil; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.ResourceLocation; -import net.minecraftforge.client.model.AdvancedModelLoader; -import net.minecraftforge.client.model.IModelCustom; public class RenderCloudSolinium extends Render { - private static final ResourceLocation objTesterModelRL = new ResourceLocation(/*"/assets/" + */RefStrings.MODID, "models/Sphere.obj"); - private IModelCustom blastModel; - private ResourceLocation blastTexture; - public float scale = 0; - public float ring = 0; - - public RenderCloudSolinium() { - blastModel = AdvancedModelLoader.loadModel(objTesterModelRL); - blastTexture = new ResourceLocation(RefStrings.MODID, "textures/models/BlastSolinium.png"); - scale = 0; - } - @Override - public void doRender(Entity p_76986_1_, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { - render((EntityCloudSolinium)p_76986_1_, p_76986_2_, p_76986_4_, p_76986_6_, p_76986_8_, p_76986_9_); - } - - public void render(EntityCloudSolinium cloud, double p_76986_2_, double p_76986_4_, double p_76986_6_, float p_76986_8_, float p_76986_9_) { + public void doRender(Entity entity, double x, double y, double z, float f0, float interp) { GL11.glPushMatrix(); - GL11.glTranslatef((float)p_76986_2_, (float)p_76986_4_, (float)p_76986_6_); - GL11.glDisable(GL11.GL_LIGHTING); - GL11.glDisable(GL11.GL_CULL_FACE); - - GL11.glScalef(cloud.age, cloud.age, cloud.age); - - bindTexture(blastTexture); - blastModel.renderAll(); - GL11.glPopMatrix(); + GL11.glTranslated(x, y, z); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glDisable(GL11.GL_CULL_FACE); + GL11.glShadeModel(GL11.GL_SMOOTH); + GL11.glDisable(GL11.GL_TEXTURE_2D); + + int color = 0x27FFDA; + + EntityCloudSolinium cloud = (EntityCloudSolinium) entity; + float scale = cloud.age + interp; + GL11.glScalef(scale, scale, scale); + + GL11.glColor3f(ColorUtil.fr(color), ColorUtil.fg(color), ColorUtil.fb(color)); + ResourceManager.sphere_new.renderAll(); + + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); + GL11.glColor4f(ColorUtil.fr(color), ColorUtil.fg(color), ColorUtil.fb(color), 0.125F); + + GL11.glEnable(GL11.GL_CULL_FACE); + + double outerScale = 1.025; + for(int i = 0; i < 3; i++) { + GL11.glScaled(outerScale, outerScale, outerScale); + ResourceManager.sphere_new.renderAll(); + } + + GL11.glColor4f(1F, 1F, 1F, 1F); + + GL11.glDisable(GL11.GL_BLEND); + GL11.glEnable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_TEXTURE_2D); + GL11.glShadeModel(GL11.GL_FLAT); + GL11.glPopMatrix(); } @Override diff --git a/src/main/resources/assets/hbm/textures/blocks/fusion_hatch_alt.png b/src/main/resources/assets/hbm/textures/blocks/fusion_hatch_alt.png deleted file mode 100644 index e11433175a8c7e0fbd35fa471b5ae50878d64f94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 581 zcmV-L0=oT)P)e|dR9M94W~ttID-)|$)9%Y!=WoI`6(N{QRsTby$!rMSAfqN*xF z2q>jWgHnq7`+ER-y&m@M?TzE(W0X?VbXSb)=L4SS%Je=cuX*r4-*s{rZ(14u^yg2qCauukqfKQlhSFrqd}R!u$I>tJMmC z&1S>r=O??}Zm)uKuBgy74X3B4q?9;2J1Z*8X0!5g(=?o%oN#n>g!dksb7s5UVy#7M zjdSjw+KWiZB7*Jpdc+v%x{i;Jj~@UrMgUSu7-MkGv0AN&F)|zu_au%+BWAN1qtS@T zWKs-cjA66c8~_dm1KPHwZCe(L1vaI`cDrT0UXyeF(eOR~c4E#MdvS3AfOC$n>v(v0 zI4Cs6;JrVP@A2`G>2%8Z`8jqnnUon{Utd`+ml$J8v53%h9U_8K3avHPTAHSzu4~lY z-CZ6G28CU%^+9orv6$xTOesZ-aj!zZ-^Y7T&bcuCUn6D|k T=;}N600000NkvXXu0mjfBjpQ8 diff --git a/src/main/resources/assets/hbm/textures/blocks/fusion_heater_side_base.png b/src/main/resources/assets/hbm/textures/blocks/fusion_heater_side_base.png deleted file mode 100644 index fe0b6412cf7e7b4dde2d00c4bffdd62576ee9574..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 265 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`EX7WqAsj$Z!;#VfKaSXBO ztqt}TYf<3w{`?^B&VQG6D^?rK+?Qm=wdJgP&(<(EmT&h?_%JY>+^p8w;gFW}o|oZ- zj|+@$R$Uv*%rH7-aINo?V-qW!sZt`ma zDz$gr{J5UgL@})6>}!@u5_t>7JkqAV|Mr62ZjD)p^{w>l4>slhoWpqU$tLU2C+}}* z2w(G$m}y;c{)g6&TbHX!ICn34x9IQP=I51t>3=)rmb6{T@n}+sJN{!WV_byjE1+K( NJYD@<);T3K0RTugZXN&t diff --git a/src/main/resources/assets/hbm/textures/blocks/plasma.png b/src/main/resources/assets/hbm/textures/blocks/plasma.png deleted file mode 100644 index 5042b3489336915e2d1b4c0b9613fa03677d6c1e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4701 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 Date: Sun, 19 Apr 2026 17:31:56 +0200 Subject: [PATCH 2/3] she is a '77 pontiac --- changelog | 6 + gradle.properties | 2 +- src/main/java/com/hbm/blocks/ModBlocks.java | 3 + .../blocks/machine/rbmk/RBMKIndicator.java | 50 +++++ .../blocks/network/BlockCablePaintable.java | 34 +-- .../BlockOpenComputersCablePaintable.java | 32 +-- .../blocks/network/FluidDuctPaintable.java | 34 +-- .../FluidDuctPaintableBlockExhaust.java | 35 ++-- .../network/PneumoTubePaintableBlock.java | 12 +- .../hbm/inventory/gui/GUIScreenRBMKGauge.java | 22 +- .../inventory/gui/GUIScreenRBMKIndicator.java | 174 +++++++++++++++ .../hbm/inventory/gui/GUIScreenRBMKLever.java | 8 +- src/main/java/com/hbm/lib/RefStrings.java | 2 +- src/main/java/com/hbm/main/ClientProxy.java | 1 + .../java/com/hbm/main/CraftingManager.java | 1 + .../java/com/hbm/main/ResourceManager.java | 2 + .../tileentity/RenderRBMKIndicator.java | 70 +++++++ .../java/com/hbm/tileentity/TileMappings.java | 1 + .../machine/TileEntityForceField.java | 2 +- .../machine/rbmk/TileEntityRBMKIndicator.java | 198 ++++++++++++++++++ src/main/resources/assets/hbm/lang/de_DE.lang | 3 + src/main/resources/assets/hbm/lang/en_US.lang | 3 + .../assets/hbm/manual/ror/panelbutton.json | 2 +- .../assets/hbm/manual/ror/panelgauge.json | 2 +- .../assets/hbm/manual/ror/panelgraph.json | 2 +- .../assets/hbm/manual/ror/panelindicator.json | 11 + .../assets/hbm/manual/ror/panellever.json | 2 +- .../assets/hbm/manual/ror/panelnumitron.json | 2 +- .../assets/hbm/models/rbmk/indicator.obj | 66 ++++++ .../gui/machine/gui_rbmk_indicator.png | Bin 0 -> 4252 bytes .../hbm/textures/models/network/indicator.png | Bin 0 -> 185 bytes 31 files changed, 705 insertions(+), 77 deletions(-) create mode 100644 src/main/java/com/hbm/blocks/machine/rbmk/RBMKIndicator.java create mode 100644 src/main/java/com/hbm/inventory/gui/GUIScreenRBMKIndicator.java create mode 100644 src/main/java/com/hbm/render/tileentity/RenderRBMKIndicator.java create mode 100644 src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKIndicator.java create mode 100644 src/main/resources/assets/hbm/manual/ror/panelindicator.json create mode 100644 src/main/resources/assets/hbm/models/rbmk/indicator.obj create mode 100644 src/main/resources/assets/hbm/textures/gui/machine/gui_rbmk_indicator.png create mode 100644 src/main/resources/assets/hbm/textures/models/network/indicator.png diff --git a/changelog b/changelog index 0cd64c5ff..b77da83cc 100644 --- a/changelog +++ b/changelog @@ -3,6 +3,10 @@ * Big breaker switches * Up to two per module, side by side * Can send different RoR values based on the lever's position +* Redstone-over-radio indicator lights + * Colored indicator light panels with labels on them + * Up to six lights per module + * Will light up when an RoR signal falls within the configured threshold ## Changed * All RoR panels now have basic item descriptions informing about the screwdriver requirement for configuration @@ -16,6 +20,8 @@ * Removed legacy plasma block * RoR panels now have OpenComputers integration, allowing otherwise fixed parameters like gauge thresholds, channels, and button commands to be adjusted on the fly * Solinium blasts now use the new higher poly sphere model and frame interpolation, making the expansion smoother +* Using a defuser on paintable cables/pipes/tubes that already have a paint applied will toggle the overlay, makng the cable/pipe/tube blend in perfectly +* Mufflers installed on force fields now disable the loud spark noise caused by impacts ## Fixed * Fixed the grenade crafting handler not checking if a shell/filling combination is even valid, allowing weird combos diff --git a/gradle.properties b/gradle.properties index 8491656bb..a00ea66a7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,6 +1,6 @@ mod_version=1.0.27 # Empty build number makes a release type -mod_build_number=5663 +mod_build_number=5670 credits=HbMinecraft,\ \ rodolphito (explosion algorithms),\ diff --git a/src/main/java/com/hbm/blocks/ModBlocks.java b/src/main/java/com/hbm/blocks/ModBlocks.java index 73ef2a6d8..fd685f872 100644 --- a/src/main/java/com/hbm/blocks/ModBlocks.java +++ b/src/main/java/com/hbm/blocks/ModBlocks.java @@ -1096,6 +1096,7 @@ public class ModBlocks { public static Block rbmk_numitron; public static Block rbmk_graph; public static Block rbmk_lever; + public static Block rbmk_indicator; public static Block rbmk_autoloader; public static Block rbmk_loader; public static Block rbmk_steam_inlet; @@ -2118,6 +2119,7 @@ public class ModBlocks { rbmk_numitron = new RBMKNumitron().setBlockName("rbmk_numitron").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display"); rbmk_graph = new RBMKGraph().setBlockName("rbmk_graph").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display"); rbmk_lever = new RBMKLever().setBlockName("rbmk_lever").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display"); + rbmk_indicator = new RBMKIndicator().setBlockName("rbmk_indicator").setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_display"); rbmk_autoloader = new RBMKAutoloader().setBlockName("rbmk_autoloader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_autoloader"); rbmk_loader = new RBMKLoader(Material.iron).setBlockName("rbmk_loader").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_loader"); rbmk_steam_inlet = new RBMKInlet(Material.iron).setBlockName("rbmk_steam_inlet").setCreativeTab(MainRegistry.machineTab).setHardness(50.0F).setResistance(60.0F).setBlockTextureName(RefStrings.MODID + ":rbmk_steam_inlet"); @@ -3109,6 +3111,7 @@ public class ModBlocks { register(rbmk_key_pad); register(rbmk_lever); register(rbmk_gauge); + register(rbmk_indicator); register(rbmk_numitron); register(rbmk_graph); register(rbmk_autoloader); diff --git a/src/main/java/com/hbm/blocks/machine/rbmk/RBMKIndicator.java b/src/main/java/com/hbm/blocks/machine/rbmk/RBMKIndicator.java new file mode 100644 index 000000000..935db1370 --- /dev/null +++ b/src/main/java/com/hbm/blocks/machine/rbmk/RBMKIndicator.java @@ -0,0 +1,50 @@ +package com.hbm.blocks.machine.rbmk; + +import org.lwjgl.opengl.GL11; + +import com.hbm.main.MainRegistry; +import com.hbm.main.ResourceManager; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKIndicator; + +import api.hbm.block.IToolable; +import cpw.mods.fml.common.network.internal.FMLNetworkHandler; +import net.minecraft.block.Block; +import net.minecraft.client.Minecraft; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.tileentity.TileEntity; +import net.minecraft.world.World; + +public class RBMKIndicator extends RBMKMiniPanelBase implements IToolable { + + @Override + public TileEntity createNewTileEntity(World world, int meta) { + return new TileEntityRBMKIndicator(); + } + + @Override + public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { + if(tool != ToolType.SCREWDRIVER) return false; + if(world.isRemote) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, world, x, y, z); + return true; + } + + @Override + public void renderInventoryBlock(Block block, int meta, int modelId, Object renderBlocks) { + super.renderInventoryBlock(block, meta, modelId, renderBlocks); + + GL11.glPushMatrix(); + GL11.glTranslated(0, -0.5, 0); + GL11.glRotated(-90, 0, 1, 0); + + for(int i = 0; i < 6; i++) { + + GL11.glPushMatrix(); + GL11.glTranslated(0.25, (i / 2) * -0.3125 + 0.3125, (i % 2) * 0.5 - 0.25); + Minecraft.getMinecraft().getTextureManager().bindTexture(ResourceManager.rbmk_indicator_tex); + ResourceManager.rbmk_indicator.renderAll(); + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/blocks/network/BlockCablePaintable.java b/src/main/java/com/hbm/blocks/network/BlockCablePaintable.java index 4b37262ff..dd92b6940 100644 --- a/src/main/java/com/hbm/blocks/network/BlockCablePaintable.java +++ b/src/main/java/com/hbm/blocks/network/BlockCablePaintable.java @@ -54,7 +54,7 @@ public class BlockCablePaintable extends BlockContainer implements IToolable, IB TileEntityCablePaintable pipe = (TileEntityCablePaintable) tile; if(pipe.block != null) { - if(RenderBlockMultipass.currentPass == 1) { + if(RenderBlockMultipass.currentPass == 1 && pipe.getBlockMetadata() == 0) { return this.overlay; } else { return pipe.block.getIcon(side, pipe.meta); @@ -103,20 +103,28 @@ public class BlockCablePaintable extends BlockContainer implements IToolable, IB @Override public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { - if(tool != ToolType.SCREWDRIVER) return false; - - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TileEntityCablePaintable) { - TileEntityCablePaintable pipe = (TileEntityCablePaintable) tile; - - if(pipe.block != null) { - pipe.block = null; - world.markBlockForUpdate(x, y, z); - pipe.markDirty(); - return true; + if(tool == ToolType.SCREWDRIVER) { + + TileEntity tile = world.getTileEntity(x, y, z); + + if(tile instanceof TileEntityCablePaintable) { + TileEntityCablePaintable pipe = (TileEntityCablePaintable) tile; + + if(pipe.block != null) { + pipe.block = null; + world.markBlockForUpdate(x, y, z); + pipe.markDirty(); + return true; + } } } + + if(tool == ToolType.DEFUSER) { + int meta = world.getBlockMetadata(x, y, z); + if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3); + else world.setBlockMetadataWithNotify(x, y, z, 0, 3); + return true; + } return false; } diff --git a/src/main/java/com/hbm/blocks/network/BlockOpenComputersCablePaintable.java b/src/main/java/com/hbm/blocks/network/BlockOpenComputersCablePaintable.java index d40d81595..c865bf0b5 100644 --- a/src/main/java/com/hbm/blocks/network/BlockOpenComputersCablePaintable.java +++ b/src/main/java/com/hbm/blocks/network/BlockOpenComputersCablePaintable.java @@ -1,6 +1,7 @@ package com.hbm.blocks.network; import api.hbm.block.IToolable; + import com.hbm.blocks.IBlockMultiPass; import com.hbm.interfaces.ICopiable; import com.hbm.lib.RefStrings; @@ -66,6 +67,7 @@ public class BlockOpenComputersCablePaintable extends BlockContainer implements TileEntityOpenComputersCablePaintable pipe = (TileEntityOpenComputersCablePaintable) tile; if(pipe.block != null) { + if(pipe.getBlockMetadata() != 0) pipe.block.getIcon(side, pipe.meta); if(RenderBlockMultipass.currentPass == 1) { return this.overlay; } else if(RenderBlockMultipass.currentPass == 2) { @@ -144,20 +146,26 @@ public class BlockOpenComputersCablePaintable extends BlockContainer implements @Override public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { - if(tool != ToolType.SCREWDRIVER) return false; - - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TileEntityOpenComputersCablePaintable) { - TileEntityOpenComputersCablePaintable pipe = (TileEntityOpenComputersCablePaintable) tile; - - if(pipe.block != null) { - pipe.block = null; - world.markBlockForUpdate(x, y, z); - pipe.markDirty(); - return true; + if(tool == ToolType.SCREWDRIVER) { + TileEntity tile = world.getTileEntity(x, y, z); + if(tile instanceof TileEntityOpenComputersCablePaintable) { + TileEntityOpenComputersCablePaintable pipe = (TileEntityOpenComputersCablePaintable) tile; + + if(pipe.block != null) { + pipe.block = null; + world.markBlockForUpdate(x, y, z); + pipe.markDirty(); + return true; + } } } + + if(tool == ToolType.DEFUSER) { + int meta = world.getBlockMetadata(x, y, z); + if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3); + else world.setBlockMetadataWithNotify(x, y, z, 0, 3); + return true; + } return false; } diff --git a/src/main/java/com/hbm/blocks/network/FluidDuctPaintable.java b/src/main/java/com/hbm/blocks/network/FluidDuctPaintable.java index 71bb8d246..df6b313ae 100644 --- a/src/main/java/com/hbm/blocks/network/FluidDuctPaintable.java +++ b/src/main/java/com/hbm/blocks/network/FluidDuctPaintable.java @@ -1,6 +1,7 @@ package com.hbm.blocks.network; import api.hbm.block.IToolable; + import com.hbm.blocks.IBlockMultiPass; import com.hbm.blocks.ILookOverlay; import com.hbm.interfaces.ICopiable; @@ -58,7 +59,7 @@ public class FluidDuctPaintable extends FluidDuctBase implements IToolable, IBlo TileEntityPipePaintable pipe = (TileEntityPipePaintable) tile; if(pipe.block != null) { - if(RenderBlockMultipass.currentPass == 1) { + if(RenderBlockMultipass.currentPass == 1 && pipe.getBlockMetadata() == 0) { return this.overlay; } else { return pipe.block.getIcon(side, pipe.meta); @@ -122,20 +123,27 @@ public class FluidDuctPaintable extends FluidDuctBase implements IToolable, IBlo @Override public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { - if(tool != ToolType.SCREWDRIVER) return false; - - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TileEntityPipePaintable) { - TileEntityPipePaintable pipe = (TileEntityPipePaintable) tile; - - if(pipe.block != null) { - pipe.block = null; - world.markBlockForUpdate(x, y, z); - pipe.markDirty(); - return true; + if(tool == ToolType.SCREWDRIVER) { + TileEntity tile = world.getTileEntity(x, y, z); + + if(tile instanceof TileEntityPipePaintable) { + TileEntityPipePaintable pipe = (TileEntityPipePaintable) tile; + + if(pipe.block != null) { + pipe.block = null; + world.markBlockForUpdate(x, y, z); + pipe.markDirty(); + return true; + } } } + + if(tool == ToolType.DEFUSER) { + int meta = world.getBlockMetadata(x, y, z); + if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3); + else world.setBlockMetadataWithNotify(x, y, z, 0, 3); + return true; + } return false; } diff --git a/src/main/java/com/hbm/blocks/network/FluidDuctPaintableBlockExhaust.java b/src/main/java/com/hbm/blocks/network/FluidDuctPaintableBlockExhaust.java index 21d3bd899..79febabac 100644 --- a/src/main/java/com/hbm/blocks/network/FluidDuctPaintableBlockExhaust.java +++ b/src/main/java/com/hbm/blocks/network/FluidDuctPaintableBlockExhaust.java @@ -37,7 +37,7 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo @SideOnly(Side.CLIENT) protected IIcon overlay; public FluidDuctPaintableBlockExhaust() { - super(Material.iron); + super(Material.iron); } @Override @@ -61,7 +61,7 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile; if(pipe.block != null) { - if(RenderBlockMultipass.currentPass == 1) { + if(RenderBlockMultipass.currentPass == 1 && pipe.getBlockMetadata() == 0) { return this.overlay; } else { return pipe.block.getIcon(side, pipe.meta); @@ -75,20 +75,27 @@ public class FluidDuctPaintableBlockExhaust extends FluidDuctBase implements ITo @Override public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) { - if(tool != ToolType.SCREWDRIVER) return false; - - TileEntity tile = world.getTileEntity(x, y, z); - - if(tile instanceof TileEntityPipeExhaustPaintable) { - TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile; - - if(pipe.block != null) { - pipe.block = null; - world.markBlockForUpdate(x, y, z); - pipe.markDirty(); - return true; + if(tool == ToolType.SCREWDRIVER) { + TileEntity tile = world.getTileEntity(x, y, z); + + if(tile instanceof TileEntityPipeExhaustPaintable) { + TileEntityPipeExhaustPaintable pipe = (TileEntityPipeExhaustPaintable) tile; + + if(pipe.block != null) { + pipe.block = null; + world.markBlockForUpdate(x, y, z); + pipe.markDirty(); + return true; + } } } + + if(tool == ToolType.DEFUSER) { + int meta = world.getBlockMetadata(x, y, z); + if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3); + else world.setBlockMetadataWithNotify(x, y, z, 0, 3); + 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 bae313ad7..5cd33b2a6 100644 --- a/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java +++ b/src/main/java/com/hbm/blocks/network/PneumoTubePaintableBlock.java @@ -1,6 +1,7 @@ package com.hbm.blocks.network; import api.hbm.block.IToolable; + import com.hbm.blocks.IBlockMultiPass; import com.hbm.interfaces.ICopiable; import com.hbm.lib.RefStrings; @@ -58,7 +59,7 @@ public class PneumoTubePaintableBlock extends BlockContainer implements IToolabl if(tile instanceof TileEntityPneumoTubePaintable) { TileEntityPneumoTubePaintable tube = (TileEntityPneumoTubePaintable) tile; - if(RenderBlockMultipass.currentPass == 0) { + if(RenderBlockMultipass.currentPass == 0 || tube.getBlockMetadata() != 0) { if(tube.block != null) { return tube.block.getIcon(side, tube.meta); } else { @@ -123,7 +124,14 @@ public class PneumoTubePaintableBlock extends BlockContainer implements IToolabl ((WorldServer) world).getPlayerManager().markBlockForUpdate(x, y, z); return true; + + } else if(tool == ToolType.DEFUSER) { + int meta = world.getBlockMetadata(x, y, z); + if(meta == 0) world.setBlockMetadataWithNotify(x, y, z, 1, 3); + else world.setBlockMetadataWithNotify(x, y, z, 0, 3); + return true; } + return false; } @@ -149,7 +157,7 @@ public class PneumoTubePaintableBlock extends BlockContainer implements IToolabl } } } - } else if(ToolType.getType(stack) == ToolType.SCREWDRIVER || ToolType.getType(stack) == ToolType.HAND_DRILL) return false; + } else if(ToolType.getType(stack) == ToolType.SCREWDRIVER || ToolType.getType(stack) == ToolType.HAND_DRILL || ToolType.getType(stack) == ToolType.DEFUSER) return false; if(!player.isSneaking()) { TileEntity tile = world.getTileEntity(x, y, z); diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKGauge.java b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKGauge.java index ed6ea5adf..f734d5b2e 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKGauge.java +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKGauge.java @@ -19,7 +19,7 @@ import net.minecraft.util.ResourceLocation; public class GUIScreenRBMKGauge extends GuiScreen { private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_rbmk_gauge.png"); - public TileEntityRBMKGauge keypad; + public TileEntityRBMKGauge gauge; protected int xSize = 256; protected int ySize = 204; protected int guiLeft; @@ -33,8 +33,8 @@ public class GUIScreenRBMKGauge extends GuiScreen { protected boolean[] active = new boolean[4]; protected boolean[] polling = new boolean[4]; - public GUIScreenRBMKGauge(TileEntityRBMKGauge keypad) { - this.keypad = keypad; + public GUIScreenRBMKGauge(TileEntityRBMKGauge gauge) { + this.gauge = gauge; } @Override @@ -49,21 +49,21 @@ public class GUIScreenRBMKGauge extends GuiScreen { int oY = 4; for(int i = 0; i < 4; i++) { - String col = Integer.toHexString(keypad.gauges[i].color); + String col = Integer.toHexString(gauge.gauges[i].color); while(col.length() < 6) col = "0" + col; color[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14); GUIScreenRBMKKeyPad.setupTextFieldStandard(color[i], 6, col); label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14); - GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 15, keypad.gauges[i].label); + GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 15, gauge.gauges[i].label); rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 73 + oY + i * 36, 72 - oX * 2, 14); - GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, keypad.gauges[i].rtty); + GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, gauge.gauges[i].rtty); min[i] = new GuiTextField(this.fontRendererObj, guiLeft + 121 + oX, guiTop + 73 + oY + i * 36, 52 - oX * 2, 14); - GUIScreenRBMKKeyPad.setupTextFieldStandard(min[i], 32, keypad.gauges[i].min + ""); + GUIScreenRBMKKeyPad.setupTextFieldStandard(min[i], 32, gauge.gauges[i].min + ""); max[i] = new GuiTextField(this.fontRendererObj, guiLeft + 195 + oX, guiTop + 73 + oY + i * 36, 52 - oX * 2, 14); - GUIScreenRBMKKeyPad.setupTextFieldStandard(max[i], 32, keypad.gauges[i].max + ""); + GUIScreenRBMKKeyPad.setupTextFieldStandard(max[i], 32, gauge.gauges[i].max + ""); - active[i] = keypad.gauges[i].active; - polling[i] = keypad.gauges[i].polling; + active[i] = gauge.gauges[i].active; + polling[i] = gauge.gauges[i].polling; } } @@ -137,7 +137,7 @@ public class GUIScreenRBMKGauge extends GuiScreen { try { data.setInteger("min" + i, Integer.parseInt(this.min[i].getText())); } catch(Exception ex) { } try { data.setInteger("max" + i, Integer.parseInt(this.max[i].getText())); } catch(Exception ex) { } } - PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, keypad.xCoord, keypad.yCoord, keypad.zCoord)); + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, gauge.xCoord, gauge.yCoord, gauge.zCoord)); return; } diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKIndicator.java b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKIndicator.java new file mode 100644 index 000000000..ca4e7474c --- /dev/null +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKIndicator.java @@ -0,0 +1,174 @@ +package com.hbm.inventory.gui; + +import org.lwjgl.input.Keyboard; +import org.lwjgl.opengl.GL11; + +import com.hbm.lib.RefStrings; +import com.hbm.packet.PacketDispatcher; +import com.hbm.packet.toserver.NBTControlPacket; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKIndicator; +import com.hbm.util.i18n.I18nUtil; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.audio.PositionedSoundRecord; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.GuiTextField; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.ResourceLocation; + +public class GUIScreenRBMKIndicator extends GuiScreen { + + private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/machine/gui_rbmk_indicator.png"); + public TileEntityRBMKIndicator indicator; + protected int xSize = 256; + protected int ySize = 258; // idk if this is a good idea + protected int guiLeft; + protected int guiTop; + + protected GuiTextField[] color = new GuiTextField[6]; + protected GuiTextField[] label = new GuiTextField[6]; + protected GuiTextField[] rtty = new GuiTextField[6]; + protected GuiTextField[] min = new GuiTextField[6]; + protected GuiTextField[] max = new GuiTextField[6]; + protected boolean[] active = new boolean[6]; + protected boolean[] polling = new boolean[6]; + + public GUIScreenRBMKIndicator(TileEntityRBMKIndicator indicator) { + this.indicator = indicator; + } + + @Override + public void initGui() { + super.initGui(); + this.guiLeft = (this.width - this.xSize) / 2; + this.guiTop = (this.height - this.ySize) / 2; + + Keyboard.enableRepeatEvents(true); + + int oX = 4; + int oY = 4; + + for(int i = 0; i < 6; i++) { + String col = Integer.toHexString(indicator.indicators[i].color); + while(col.length() < 6) col = "0" + col; + color[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 37 + oY + i * 36, 72 - oX * 2, 14); + GUIScreenRBMKKeyPad.setupTextFieldStandard(color[i], 6, col); + label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 37 + oY + i * 36, 72 - oX * 2, 14); + GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 15, indicator.indicators[i].label); + rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 36, 72 - oX * 2, 14); + GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, indicator.indicators[i].rtty); + min[i] = new GuiTextField(this.fontRendererObj, guiLeft + 121 + oX, guiTop + 55 + oY + i * 36, 52 - oX * 2, 14); + GUIScreenRBMKKeyPad.setupTextFieldStandard(min[i], 32, indicator.indicators[i].min + ""); + max[i] = new GuiTextField(this.fontRendererObj, guiLeft + 195 + oX, guiTop + 55 + oY + i * 36, 52 - oX * 2, 14); + GUIScreenRBMKKeyPad.setupTextFieldStandard(max[i], 32, indicator.indicators[i].max + ""); + + active[i] = indicator.indicators[i].active; + polling[i] = indicator.indicators[i].polling; + } + } + + @Override + public void drawScreen(int mouseX, int mouseY, float f) { + this.drawDefaultBackground(); + this.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); + GL11.glDisable(GL11.GL_LIGHTING); + this.drawGuiContainerForegroundLayer(mouseX, mouseY); + GL11.glEnable(GL11.GL_LIGHTING); + } + + private void drawGuiContainerForegroundLayer(int x, int y) { + String name = I18nUtil.resolveKey("container.rbmkIndicator"); + this.fontRendererObj.drawString(name, this.guiLeft + this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, this.guiTop + 6, 4210752); + } + + private void drawGuiContainerBackgroundLayer(float f, int mouseX, int mouseY) { + GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(texture); + drawTexturedModalRect(guiLeft, guiTop, 0, 0, 256, 143); + drawTexturedModalRect(guiLeft, guiTop + 143, 0, 35, 256, 115); + + for(int i = 0; i < 6; i++) { + drawTexturedModalRect(guiLeft + 102, guiTop + 112 + 36 + i * 36, 34 + 8 * i, 150, 8, 8); + if(this.active[i]) drawTexturedModalRect(guiLeft + 111, guiTop + i * 36 + 36, 18, 150, 16, 16); + if(this.polling[i]) drawTexturedModalRect(guiLeft + 128, guiTop + i * 36 + 35, 0, 150, 18, 18); + } + + for(int i = 0; i < 6; i++) { + this.color[i].drawTextBox(); + this.label[i].drawTextBox(); + this.rtty[i].drawTextBox(); + this.min[i].drawTextBox(); + this.max[i].drawTextBox(); + } + } + + @Override + protected void mouseClicked(int x, int y, int b) { + super.mouseClicked(x, y, b); + + for(int i = 0; i < 6; i++) { + if(guiLeft + 111 <= x && guiLeft + 111 + 16 > x && guiTop + i * 36 + 36 < y && guiTop + i * 36 + 36 + 16 >= y) { + this.active[i] = !this.active[i]; + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.active[i] ? 0.25F : 0F))); + return; + } + + if(guiLeft + 128 <= x && guiLeft + 128 + 18 > x && guiTop + i * 36 + 35 < y && guiTop + i * 36 + 35 + 18 >= y) { + this.polling[i] = !this.polling[i]; + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 0.5F + (this.polling[i] ? 0.25F : 0F))); + return; + } + } + + if(guiLeft + 209 <= x && guiLeft + 209 + 18 > x && guiTop + 8 < y && guiTop + 8 + 18 >= y) { + mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F)); + NBTTagCompound data = new NBTTagCompound(); + byte active = 0; + byte polling = 0; + for(int i = 0; i < 6; i++) { + if(this.active[i]) active |= 1 << i; + if(this.polling[i]) polling |= 1 << i; + } + data.setByte("active", active); + data.setByte("polling", polling); + + for(int i = 0; i < 6; i++) { + try { data.setInteger("color" + i, Integer.parseInt(this.color[i].getText(), 16)); } catch(Exception ex) { } + data.setString("label" + i, this.label[i].getText()); + data.setString("rtty" + i, this.rtty[i].getText()); + try { data.setInteger("min" + i, Integer.parseInt(this.min[i].getText())); } catch(Exception ex) { } + try { data.setInteger("max" + i, Integer.parseInt(this.max[i].getText())); } catch(Exception ex) { } + } + PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, indicator.xCoord, indicator.yCoord, indicator.zCoord)); + return; + } + + for(int i = 0; i < 6; i++) { + this.color[i].mouseClicked(x, y, b); + this.label[i].mouseClicked(x, y, b); + this.rtty[i].mouseClicked(x, y, b); + this.min[i].mouseClicked(x, y, b); + this.max[i].mouseClicked(x, y, b); + } + } + + @Override + protected void keyTyped(char c, int b) { + + for(int i = 0; i < 6; i++) { + if(this.color[i].textboxKeyTyped(c, b)) return; + if(this.label[i].textboxKeyTyped(c, b)) return; + if(this.rtty[i].textboxKeyTyped(c, b)) return; + if(this.min[i].textboxKeyTyped(c, b)) return; + if(this.max[i].textboxKeyTyped(c, b)) return; + } + + if(b == 1 || b == this.mc.gameSettings.keyBindInventory.getKeyCode()) { + this.mc.thePlayer.closeScreen(); + this.mc.setIngameFocus(); + } + } + + @Override public void onGuiClosed() { Keyboard.enableRepeatEvents(false); } + @Override public boolean doesGuiPauseGame() { return false; } +} diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKLever.java b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKLever.java index 4b316fbc0..a98861e2f 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKLever.java +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenRBMKLever.java @@ -51,13 +51,13 @@ public class GUIScreenRBMKLever extends GuiScreen { int oY = 4; for(int i = 0; i < 2; i++) { - rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 52, 72 - oX * 2, 14); + rtty[i] = new GuiTextField(this.fontRendererObj, guiLeft + 27 + oX, guiTop + 55 + oY + i * 54, 72 - oX * 2, 14); GUIScreenRBMKKeyPad.setupTextFieldStandard(rtty[i], 10, lever.levers[i].rtty); - label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 52, 72 - oX * 2, 14); + label[i] = new GuiTextField(this.fontRendererObj, guiLeft + 175 + oX, guiTop + 55 + oY + i * 54, 72 - oX * 2, 14); GUIScreenRBMKKeyPad.setupTextFieldStandard(label[i], 15, lever.levers[i].label); - cmdOn[i] = new GuiTextField(this.fontRendererObj, guiLeft + 45 + oX, guiTop + 73 + oY + i * 52, 81 - oX * 2, 14); + cmdOn[i] = new GuiTextField(this.fontRendererObj, guiLeft + 45 + oX, guiTop + 73 + oY + i * 54, 81 - oX * 2, 14); GUIScreenRBMKKeyPad.setupTextFieldStandard(cmdOn[i], 32, lever.levers[i].commandOn); - cmdOff[i] = new GuiTextField(this.fontRendererObj, guiLeft + 166 + oX, guiTop + 73 + oY + i * 52, 81 - oX * 2, 14); + cmdOff[i] = new GuiTextField(this.fontRendererObj, guiLeft + 166 + oX, guiTop + 73 + oY + i * 54, 81 - oX * 2, 14); GUIScreenRBMKKeyPad.setupTextFieldStandard(cmdOff[i], 32, lever.levers[i].commandOff); active[i] = lever.levers[i].active; diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index c35945f2f..570995a93 100644 --- a/src/main/java/com/hbm/lib/RefStrings.java +++ b/src/main/java/com/hbm/lib/RefStrings.java @@ -3,7 +3,7 @@ package com.hbm.lib; public class RefStrings { public static final String MODID = "hbm"; public static final String NAME = "Hbm's Nuclear Tech Mod"; - public static final String VERSION = "1.0.27 BETA (5663)"; + public static final String VERSION = "1.0.27 BETA (5670)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/main/ClientProxy.java b/src/main/java/com/hbm/main/ClientProxy.java index e81a6ae09..9fc37ce11 100644 --- a/src/main/java/com/hbm/main/ClientProxy.java +++ b/src/main/java/com/hbm/main/ClientProxy.java @@ -416,6 +416,7 @@ public class ClientProxy extends ServerProxy { ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKNumitron.class, new RenderRBMKNumitron()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKGraph.class, new RenderRBMKGraph()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKLever.class, new RenderRBMKLever()); + ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKIndicator.class, new RenderRBMKIndicator()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRod.class, new RenderRBMKFuelChannel()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKRodReaSim.class, new RenderRBMKFuelChannel()); ClientRegistry.bindTileEntitySpecialRenderer(TileEntityRBMKAutoloader.class, new RenderRBMKAutoloader()); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 47c84611c..adc52c528 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -797,6 +797,7 @@ public class CraftingManager { addRecipeAuto(new ItemStack(ModBlocks.rbmk_numitron, 1), new Object[] { " R ", "CCC", " B ", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.NUMITRON) }); addRecipeAuto(new ItemStack(ModBlocks.rbmk_graph, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', ModItems.crt_display }); addRecipeAuto(new ItemStack(ModBlocks.rbmk_lever, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_sender, 'B', ModBlocks.rbmk_display_blank, 'C', CU.ingot() }); + addRecipeAuto(new ItemStack(ModBlocks.rbmk_indicator, 1), new Object[] { "R", "C", "B", 'R', ModBlocks.radio_torch_receiver, 'B', ModBlocks.rbmk_display_blank, 'C', ModItems.coil_tungsten }); addRecipeAuto(new ItemStack(ModBlocks.deco_rbmk, 8), new Object[] { "R", 'R', ModBlocks.rbmk_blank }); addRecipeAuto(new ItemStack(ModBlocks.deco_rbmk_smooth, 1), new Object[] { "R", 'R', ModBlocks.deco_rbmk }); diff --git a/src/main/java/com/hbm/main/ResourceManager.java b/src/main/java/com/hbm/main/ResourceManager.java index d08ce4715..f229937d9 100644 --- a/src/main/java/com/hbm/main/ResourceManager.java +++ b/src/main/java/com/hbm/main/ResourceManager.java @@ -1641,6 +1641,7 @@ public class ResourceManager { public static final HFRWavefrontObjectVBO rbmk_gauge = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/gauge.obj")).asVBO(); public static final HFRWavefrontObjectVBO rbmk_numitron = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/numitron.obj")).asVBO(); public static final HFRWavefrontObjectVBO rbmk_lever = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/lever.obj")).asVBO(); + public static final HFRWavefrontObjectVBO rbmk_indicator = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/indicator.obj")).asVBO(); public static final HFRWavefrontObject rbmk_debris = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/rbmk/debris.obj")).noSmooth(); public static final ResourceLocation rbmk_crane_console_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/crane_console.png"); public static final ResourceLocation rbmk_crane_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/rbmk_crane.png"); @@ -1651,6 +1652,7 @@ public class ResourceManager { public static final ResourceLocation rbmk_numitron_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/numitron.png"); public static final ResourceLocation rbmk_numitron_lights_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/numitron_lights.png"); public static final ResourceLocation rbmk_lever_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/lever.png"); + public static final ResourceLocation rbmk_indicator_tex = new ResourceLocation(RefStrings.MODID, "textures/models/network/indicator.png"); public static final HFRWavefrontObject hev_battery = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/battery.obj")).noSmooth(); public static final HFRWavefrontObject anvil = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/anvil.obj")).noSmooth(); public static final HFRWavefrontObject crystal_power = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/blocks/crystals_power.obj")).noSmooth(); diff --git a/src/main/java/com/hbm/render/tileentity/RenderRBMKIndicator.java b/src/main/java/com/hbm/render/tileentity/RenderRBMKIndicator.java new file mode 100644 index 000000000..87d030f7c --- /dev/null +++ b/src/main/java/com/hbm/render/tileentity/RenderRBMKIndicator.java @@ -0,0 +1,70 @@ +package com.hbm.render.tileentity; + +import org.lwjgl.opengl.GL11; + +import com.hbm.main.ResourceManager; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKIndicator; +import com.hbm.tileentity.machine.rbmk.TileEntityRBMKIndicator.IndicatorUnit; +import com.hbm.util.ColorUtil; + +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer; +import net.minecraft.tileentity.TileEntity; + +public class RenderRBMKIndicator extends TileEntitySpecialRenderer { + + @Override + public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) { + + GL11.glPushMatrix(); + GL11.glTranslated(x + 0.5, y, z + 0.5); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glEnable(GL11.GL_LIGHTING); + + switch(te.getBlockMetadata()) { + case 2: GL11.glRotatef(90, 0F, 1F, 0F); break; + case 4: GL11.glRotatef(180, 0F, 1F, 0F); break; + case 3: GL11.glRotatef(270, 0F, 1F, 0F); break; + case 5: GL11.glRotatef(0, 0F, 1F, 0F); break; + } + + TileEntityRBMKIndicator indicator = (TileEntityRBMKIndicator) te; + + for(int i = 0; i < 6; i++) { + IndicatorUnit unit = indicator.indicators[i]; + if(!unit.active) continue; + + GL11.glPushMatrix(); + GL11.glTranslated(0.25, (i / 2) * -0.3125 + 0.3125, (i % 2) * -0.5 + 0.25); + + GL11.glColor3f(1F, 1F, 1F); + this.bindTexture(ResourceManager.rbmk_indicator_tex); + ResourceManager.rbmk_indicator.renderPart("Base"); + + float mult = unit.light ? 1F : 0.35F; + GL11.glColor3f(ColorUtil.fr(unit.color) * mult, ColorUtil.fg(unit.color) * mult, ColorUtil.fb(unit.color) * mult); + if(unit.light) RenderArcFurnace.fullbright(true); + ResourceManager.rbmk_indicator.renderPart("Light"); + if(unit.light) RenderArcFurnace.fullbright(false); + + FontRenderer font = Minecraft.getMinecraft().fontRenderer; + int height = font.FONT_HEIGHT; + if(unit.label != null && !unit.label.isEmpty()) { + + GL11.glTranslated(0.0725, 0.5, 0); + int width = font.getStringWidth(unit.label); + float f3 = Math.min(0.0125F, 0.3F / Math.max(width, 1)); + GL11.glScalef(f3, -f3, f3); + GL11.glNormal3f(0.0F, 0.0F, -1.0F); + GL11.glRotatef(90, 0, 1, 0); + + font.drawString(unit.label, - width / 2, - height / 2, 0x000000); + } + + GL11.glPopMatrix(); + } + + GL11.glPopMatrix(); + } +} diff --git a/src/main/java/com/hbm/tileentity/TileMappings.java b/src/main/java/com/hbm/tileentity/TileMappings.java index 623dac412..a67e399ac 100644 --- a/src/main/java/com/hbm/tileentity/TileMappings.java +++ b/src/main/java/com/hbm/tileentity/TileMappings.java @@ -408,6 +408,7 @@ public class TileMappings { put(TileEntityRBMKNumitron.class, "tileentity_rbmk_numitron"); put(TileEntityRBMKGraph.class, "tileentity_rbmk_graph"); put(TileEntityRBMKLever.class, "tileentity_rbmk_lever"); + put(TileEntityRBMKIndicator.class, "tileentity_rbmk_indicator"); put(TileEntityRBMKInlet.class, "tileentity_rbmk_inlet"); put(TileEntityRBMKOutlet.class, "tileentity_rbmk_outlet"); put(TileEntityRBMKAutoloader.class, "tileentity_rbmk_autoloader"); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityForceField.java b/src/main/java/com/hbm/tileentity/machine/TileEntityForceField.java index 26e1cbc47..9e486f1cc 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityForceField.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityForceField.java @@ -421,7 +421,7 @@ public class TileEntityForceField extends TileEntityLoadedBase implements ISided entity.posY -= entity.motionY; entity.posZ -= entity.motionZ; - worldObj.playSoundAtEntity(entity, "hbm:weapon.sparkShoot", 2.5F, 1.0F); + if(!this.muffled) worldObj.playSoundAtEntity(entity, "hbm:weapon.sparkShoot", 2.5F, 1.0F); outside.add(entity); if(!worldObj.isRemote) { diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKIndicator.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKIndicator.java new file mode 100644 index 000000000..dab98af0e --- /dev/null +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKIndicator.java @@ -0,0 +1,198 @@ +package com.hbm.tileentity.machine.rbmk; + +import com.hbm.interfaces.IControlReceiver; +import com.hbm.inventory.gui.GUIScreenRBMKIndicator; +import com.hbm.tileentity.IGUIProvider; +import com.hbm.tileentity.TileEntityLoadedBase; +import com.hbm.tileentity.network.RTTYSystem; +import com.hbm.tileentity.network.RTTYSystem.RTTYChannel; +import com.hbm.util.BufferUtil; + +import io.netty.buffer.ByteBuf; +import net.minecraft.entity.player.EntityPlayer; +import net.minecraft.inventory.Container; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.MathHelper; +import net.minecraft.world.World; + +public class TileEntityRBMKIndicator extends TileEntityLoadedBase implements IGUIProvider, IControlReceiver { + + /* __________ + * / /| + * /________ / | + * | __ __ | | + * ||__| |__|| | + * ||__| |__|| | + * ||__| |__|| / + * |_________|/ + */ + + public IndicatorUnit[] indicators = new IndicatorUnit[6]; + + public TileEntityRBMKIndicator() { + for(int i = 0; i < 6; i++) this.indicators[i] = new IndicatorUnit(i); + } + + @Override + public void updateEntity() { + + if(!worldObj.isRemote) { + + for(int i = 0; i < 6; i++) this.indicators[i].update(); + + this.networkPackNT(50); + } + } + + @Override + public void serialize(ByteBuf buf) { + super.serialize(buf); + for(int i = 0; i < 6; i++) this.indicators[i].serialize(buf); + } + + @Override + public void deserialize(ByteBuf buf) { + super.deserialize(buf); + for(int i = 0; i < 6; i++) this.indicators[i].deserialize(buf); + } + + @Override + public void readFromNBT(NBTTagCompound nbt) { + super.readFromNBT(nbt); + for(int i = 0; i < 6; i++) this.indicators[i].readFromNBT(nbt, i); + } + + @Override + public void writeToNBT(NBTTagCompound nbt) { + super.writeToNBT(nbt); + for(int i = 0; i < 6; i++) this.indicators[i].writeToNBT(nbt, i); + } + + public class IndicatorUnit { + + /** If the value should be pulled from the RTTY system every tick, otherwise only on state change */ + public boolean polling; + /** Color of the indicator light */ + public int color; + /** Label on the indicator */ + public String label = ""; + /** What channel to read values from */ + public String rtty = ""; + /** Lower bound for the indicator to light up */ + public long min = 0; + /** Upper bound for the indicator to light up */ + public long max = 100; + /** Whether the indicator is on or off */ + public boolean light; + /** Whether this indicator is visible on the panel */ + public boolean active; + + public IndicatorUnit(int initialIndex) { + if(initialIndex % 2 == 0) + color = 0xff0000; + else + color = 0xffff00; + label = "Indicator " + (initialIndex + 1); + } + + public void update() { + if(!active) return; + if(rtty == null || rtty.isEmpty()) return; + + RTTYChannel chan = RTTYSystem.listen(worldObj, rtty); + int sigVal = 0; + + if(chan != null && chan.timeStamp < worldObj.getTotalWorldTime() - 1) chan = null; + + // always accept new signals + if(chan != null && chan.signal != null) { + try { sigVal = Integer.parseInt(chan.signal.toString()); } catch(Exception ex) { } + decideLight(sigVal); + } else { + // if there's no new signal and we're polling, set to 0 + if(polling) decideLight(0); + } + } + + // if max is lower than min, inverse the operation, i.e. make the indicator light up outside of the bounds + private void decideLight(long value) { + if(min <= max) { + light = value >= min && value <= max; + } else { + light = value < max || value > min; + } + } + + public void serialize(ByteBuf buf) { + buf.writeBoolean(active); + buf.writeBoolean(polling); + buf.writeBoolean(light); + buf.writeInt(color); + BufferUtil.writeString(buf, label); + BufferUtil.writeString(buf, rtty); + buf.writeLong(min); + buf.writeLong(max); + } + + public void deserialize(ByteBuf buf) { + active = buf.readBoolean(); + polling = buf.readBoolean(); + light = buf.readBoolean(); + color = buf.readInt(); + label = BufferUtil.readString(buf); + rtty = BufferUtil.readString(buf); + min = buf.readLong(); + max = buf.readLong(); + } + + public void readFromNBT(NBTTagCompound nbt, int index) { + this.active = nbt.getBoolean("active" + index); + this.polling = nbt.getBoolean("polling" + index); + this.color = nbt.getInteger("color" + index); + this.label = nbt.getString("label" + index); + this.rtty = nbt.getString("rtty" + index); + this.min = nbt.getLong("min" + index); + this.max = nbt.getLong("max" + index); + this.light = nbt.getBoolean("light" + index); + } + + public void writeToNBT(NBTTagCompound nbt, int index) { + nbt.setBoolean("active" + index, active); + nbt.setBoolean("polling" + index, polling); + nbt.setInteger("color" + index, color); + nbt.setString("label" + index, label); + nbt.setString("rtty" + index, rtty); + nbt.setLong("min" + index, min); + nbt.setLong("max" + index, max); + nbt.setBoolean("light" + index, light); + } + } + + @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 new GUIScreenRBMKIndicator(this); } + + @Override + public boolean hasPermission(EntityPlayer player) { + return player.getDistanceSq(xCoord + 0.5, yCoord + 0.5, zCoord + 0.5) < 15 * 15; + } + + @Override + public void receiveControl(NBTTagCompound data) { + + int active = data.getByte("active"); + int polling = data.getByte("polling"); + for(int i = 0; i < 6; i++) { + this.indicators[i].active = (active & (1 << i)) != 0; + this.indicators[i].polling = (polling & (1 << i)) != 0; + } + + for(int i = 0; i < 6; i++) { + IndicatorUnit indicator = this.indicators[i]; + indicator.color = MathHelper.clamp_int(data.getInteger("color" + i), 0, 0xffffff); + indicator.label = data.getString("label" + i); + indicator.rtty = data.getString("rtty" + i); + indicator.min = data.hasKey("min" + i) ? data.getInteger("min" + i) : Integer.MIN_VALUE; + indicator.max = data.hasKey("max" + i) ? data.getInteger("max" + i) : Integer.MAX_VALUE; + } + } +} diff --git a/src/main/resources/assets/hbm/lang/de_DE.lang b/src/main/resources/assets/hbm/lang/de_DE.lang index 464704798..0e690ee19 100644 --- a/src/main/resources/assets/hbm/lang/de_DE.lang +++ b/src/main/resources/assets/hbm/lang/de_DE.lang @@ -466,6 +466,7 @@ container.rbmkControlAuto=RBMK Automatische Steuerstäbe container.rbmkGauge=Redstone-over-Radio Meter container.rbmkGraph=Redstone-over-Radio Graph container.rbmkHeater=RBMK Heizer +container.rbmkIndicator=Redstone-over-Radio Statuslampen container.rbmkKeyPad=Redstone-over-Radio Tastenfeld container.rbmkLever=Redstone-over-Radio Hebel container.rbmkNumitron=Redstone-over-Radio Ziffernanzeige @@ -4896,7 +4897,9 @@ tile.rbmk_display_blank.name=Leeres Redstone-over-Radio Panel tile.rbmk_gauge.name=Redstone-over-Radio Meter tile.rbmk_graph.name=Redstone-over-Radio Graph tile.rbmk_heater.name=RBMK-Heizer +tile.rbmk_indicator.name=Redstone-over-Radio Statuslampen tile.rbmk_key_pad.name=Redstone-over-Radio Tastenfeld +tile.rbmk_lever.name=Redstone-over-Radio Hebel tile.rbmk_loader.name=RBMK-Dampfadapter tile.rbmk_moderator.name=RBMK Graphitmoderator tile.rbmk_numitron.name=Redstone-over-Radio Ziffernanzeige diff --git a/src/main/resources/assets/hbm/lang/en_US.lang b/src/main/resources/assets/hbm/lang/en_US.lang index 23ed7fe4a..9b928a89d 100644 --- a/src/main/resources/assets/hbm/lang/en_US.lang +++ b/src/main/resources/assets/hbm/lang/en_US.lang @@ -874,6 +874,7 @@ container.rbmkControlAuto=RBMK Automatic Control Rods container.rbmkGauge=Redstone-over-Radio Gauge container.rbmkGraph=Redstone-over-Radio Graph container.rbmkHeater=RBMK Fluid Heater +container.rbmkIndicator=Redstone-over-Radio Indicator Lights container.rbmkKeyPad=Redstone-over-Radio Keypad container.rbmkLever=Redstone-over-Radio Lever container.rbmkNumitron=Redstone-over-Radio Numeric Display @@ -6167,6 +6168,8 @@ tile.rbmk_gauge.desc=Can be configured with a screwdriver.$Displays up to four n tile.rbmk_graph.name=Redstone-over-Radio Graph tile.rbmk_graph.desc=Can be configured with a screwdriver.$Logs and displays up to two numeric values$from different RoR signal sources. tile.rbmk_heater.name=RBMK Fluid Heater +tile.rbmk_indicator.name=Redstone-over-Radio Indicator Lights +tile.rbmk_indicator.desc=Can be configured with a screwdriver.$Can have up to six indicators that will$light up when an RoR value falls$within the configured threshold. tile.rbmk_key_pad.name=Redstone-over-Radio Keypad tile.rbmk_key_pad.desc=Can be configured with a screwdriver.$Allows up to four different buttons which can$send RoR signals when pressed. tile.rbmk_lever.name=Redstone-over-Radio Lever diff --git a/src/main/resources/assets/hbm/manual/ror/panelbutton.json b/src/main/resources/assets/hbm/manual/ror/panelbutton.json index bcc889a2d..8ceff1694 100644 --- a/src/main/resources/assets/hbm/manual/ror/panelbutton.json +++ b/src/main/resources/assets/hbm/manual/ror/panelbutton.json @@ -6,6 +6,6 @@ "en_US": "Redstone-over-Radio Keypad" }, "content": { - "en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to four buttons can be enabled using the red buttons, each button can transmit one value over its own RoR channel. This is useful for [RoR controllers|Redstone-over-Radio Controller], allowing things like RBMK settings to be adjusted with the push of a button.

The color setting accepts hexadecimal values, i.e. up to six characters with groups of two representing red, green and blue color components respectively. As a rule of thumb: FF is full color, 80 is half color and 00 is no color. FF8000 (full red, half green and no blue) is therefore orange.

The polling setting on the keypad turns the button into a locking one, the button remains pressed, sending the RoR signal each tick, until it is unpressed. State change buttons only send the command once when initially pressed.

See also:
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" + "en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to four buttons can be enabled using the red buttons, each button can transmit one value over its own RoR channel. This is useful for [RoR controllers|Redstone-over-Radio Controller], allowing things like RBMK settings to be adjusted with the push of a button.

The color setting accepts hexadecimal values, i.e. up to six characters with groups of two representing red, green and blue color components respectively. As a rule of thumb: FF is full color, 80 is half color and 00 is no color. FF8000 (full red, half green and no blue) is therefore orange.

The polling setting on the keypad turns the button into a locking one, the button remains pressed, sending the RoR signal each tick, until it is unpressed. State change buttons only send the command once when initially pressed.

See also:
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Indicator Lights]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" } } diff --git a/src/main/resources/assets/hbm/manual/ror/panelgauge.json b/src/main/resources/assets/hbm/manual/ror/panelgauge.json index 354ba369b..cd88eadc7 100644 --- a/src/main/resources/assets/hbm/manual/ror/panelgauge.json +++ b/src/main/resources/assets/hbm/manual/ror/panelgauge.json @@ -6,6 +6,6 @@ "en_US": "Redstone-over-Radio Gauge" }, "content": { - "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a gauge needle. Up to four gauges can be enabled using the red buttons, each gauge can receive one value over its own RoR channel. Minimum and maximum values need to be configured before the gauge can be used, if the minimum is set to a higher value than the maximum, then the needle will run in reverse. The needle can exceed the maximum value by up to 50%, entering the red section of the gauge.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" + "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a gauge needle. Up to four gauges can be enabled using the red buttons, each gauge can receive one value over its own RoR channel. Minimum and maximum values need to be configured before the gauge can be used, if the minimum is set to a higher value than the maximum, then the needle will run in reverse. The needle can exceed the maximum value by up to 50%, entering the red section of the gauge.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Indicator Lights]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" } } diff --git a/src/main/resources/assets/hbm/manual/ror/panelgraph.json b/src/main/resources/assets/hbm/manual/ror/panelgraph.json index 6597ac27a..6db3b40ff 100644 --- a/src/main/resources/assets/hbm/manual/ror/panelgraph.json +++ b/src/main/resources/assets/hbm/manual/ror/panelgraph.json @@ -6,6 +6,6 @@ "en_US": "Redstone-over-Radio Graph" }, "content": { - "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values over time using a line graph. Values are updated every half second, and the graph can log up to 15 seconds of input. Up to two graphs can be enabled using the red buttons, each graphs can receive one value over its own RoR channel. Useful for displaying values where the change over time is important, such as temperature curves.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Lever]]" + "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values over time using a line graph. Values are updated every half second, and the graph can log up to 15 seconds of input. Up to two graphs can be enabled using the red buttons, each graphs can receive one value over its own RoR channel. Useful for displaying values where the change over time is important, such as temperature curves.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Indicator Lights]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Lever]]" } } diff --git a/src/main/resources/assets/hbm/manual/ror/panelindicator.json b/src/main/resources/assets/hbm/manual/ror/panelindicator.json new file mode 100644 index 000000000..4ff027b6b --- /dev/null +++ b/src/main/resources/assets/hbm/manual/ror/panelindicator.json @@ -0,0 +1,11 @@ +{ + "name": "Redstone-over-Radio Indicator Lights", + "icon": ["hbm:tile.rbmk_indicator", 1, 0], + "trigger": [["hbm:tile.rbmk_indicator"]], + "title": { + "en_US": "Redstone-over-Radio Indicator Lights" + }, + "content": { + "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Indicator panels will light up, if a numeric RoR signal falls within the configured threshold (bounds are inclusive).If the minimum threshold is larger than the maximum, then the behavior is inverted, making the indicator light up outside of the configured threshold.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" + } +} diff --git a/src/main/resources/assets/hbm/manual/ror/panellever.json b/src/main/resources/assets/hbm/manual/ror/panellever.json index 371e19bad..bc7d499a0 100644 --- a/src/main/resources/assets/hbm/manual/ror/panellever.json +++ b/src/main/resources/assets/hbm/manual/ror/panellever.json @@ -6,6 +6,6 @@ "en_US": "Redstone-over-Radio Lever" }, "content": { - "en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to two large breaker switches can be enabled using the red buttons, each button can transmit one value over its own RoR channel. Levers behave similar to keypad buttons, except that they can transmit different values depending on whether they have been turned on or off. With polling enabled, the switch will continuously send the signal corresponding to whichevever state it is in, except when the lever is currently being flipped. State change causes it to only send a single pulse after it has been flipped.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]" + "en_US": "Interactive [[redstone over radio|Redstone over Radio]] transmitting device, needs to be configured with a scredriver first. Up to two large breaker switches can be enabled using the red buttons, each button can transmit one value over its own RoR channel. Levers behave similar to keypad buttons, except that they can transmit different values depending on whether they have been turned on or off. With polling enabled, the switch will continuously send the signal corresponding to whichevever state it is in, except when the lever is currently being flipped. State change causes it to only send a single pulse after it has been flipped.

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Indicator Lights]]
[[Redstone-over-Radio Numeric Display]]
[[Redstone-over-Radio Graph]]" } } diff --git a/src/main/resources/assets/hbm/manual/ror/panelnumitron.json b/src/main/resources/assets/hbm/manual/ror/panelnumitron.json index 37ededf7d..e0c967139 100644 --- a/src/main/resources/assets/hbm/manual/ror/panelnumitron.json +++ b/src/main/resources/assets/hbm/manual/ror/panelnumitron.json @@ -6,6 +6,6 @@ "en_US": "Redstone-over-Radio Numeric Display" }, "content": { - "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a seven segment number display. Up to two displays can be enabled using the red buttons, each display can receive one value over its own RoR channel. Large values displayed will be shortened, using SI suffixes. Also useful for displaying item counts provided by an [[RoR item counter|Redstone-over-Radio Item Counter]].

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" + "en_US": "Aesthetic [[redstone over radio|Redstone over Radio]] receiving device, needs to be configured with a scredriver first. Can represent numeric RoR values using a seven segment number display. Up to two displays can be enabled using the red buttons, each display can receive one value over its own RoR channel. Large values displayed will be shortened, using SI suffixes. Also useful for displaying item counts provided by an [[RoR item counter|Redstone-over-Radio Item Counter]].

See also:
[[Redstone-over-Radio Keypad]]
[[Redstone-over-Radio Gauge]]
[[Redstone-over-Radio Indicator Lights]]
[[Redstone-over-Radio Graph]]
[[Redstone-over-Radio Lever]]" } } diff --git a/src/main/resources/assets/hbm/models/rbmk/indicator.obj b/src/main/resources/assets/hbm/models/rbmk/indicator.obj new file mode 100644 index 000000000..e4a945caf --- /dev/null +++ b/src/main/resources/assets/hbm/models/rbmk/indicator.obj @@ -0,0 +1,66 @@ +# Blender v2.79 (sub 0) OBJ File: '' +# www.blender.org +o Light +v 0.062500 0.593750 0.187500 +v 0.062500 0.406250 0.187500 +v 0.062500 0.593750 -0.187500 +v 0.062500 0.406250 -0.187500 +vt 0.428571 -0.000000 +vt 1.000000 1.000000 +vt 0.428571 1.000000 +vt 1.000000 -0.000000 +vn 1.0000 -0.0000 -0.0000 +s off +f 2/1/1 3/2/1 1/3/1 +f 2/1/1 4/4/1 3/2/1 +o Base +v 0.000000 0.375000 -0.218750 +v 0.000000 0.625000 -0.218750 +v -0.000000 0.375000 0.218750 +v 0.000000 0.625000 0.218750 +v 0.062500 0.593750 0.187500 +v 0.062500 0.406250 0.187500 +v 0.062500 0.593750 -0.187500 +v 0.062500 0.406250 -0.187500 +v 0.062500 0.625000 -0.218750 +v 0.062500 0.625000 0.218750 +v 0.062500 0.375000 0.218750 +v 0.062500 0.375000 -0.218750 +vt -0.000000 0.833333 +vt 0.047619 0.166667 +vt 0.047619 0.833333 +vt 0.428571 0.833333 +vt 0.380952 0.166667 +vt 0.428571 0.166667 +vt 0.047619 1.000000 +vt 0.380952 0.833333 +vt 0.380952 1.000000 +vt 0.380952 -0.000000 +vt 0.047619 -0.000000 +vt 0.357143 0.750000 +vt 0.071429 0.750000 +vt 0.071429 0.250000 +vt 0.357143 0.250000 +vt -0.000000 0.166667 +vn 0.0000 -0.0000 1.0000 +vn 0.0000 -0.0000 -1.0000 +vn 0.0000 1.0000 0.0000 +vn 0.0000 -1.0000 0.0000 +vn 1.0000 0.0000 -0.0000 +s off +f 8/5/2 15/6/2 14/7/2 +f 6/8/3 16/9/3 5/10/3 +f 8/11/4 13/12/4 6/13/4 +f 5/14/5 15/6/5 7/15/5 +f 11/16/6 14/7/6 9/17/6 +f 9/17/6 15/6/6 10/18/6 +f 10/18/6 16/9/6 12/19/6 +f 12/19/6 13/12/6 11/16/6 +f 8/5/2 7/20/2 15/6/2 +f 6/8/3 13/12/3 16/9/3 +f 8/11/4 14/7/4 13/12/4 +f 5/14/5 16/9/5 15/6/5 +f 11/16/6 13/12/6 14/7/6 +f 9/17/6 14/7/6 15/6/6 +f 10/18/6 15/6/6 16/9/6 +f 12/19/6 16/9/6 13/12/6 diff --git a/src/main/resources/assets/hbm/textures/gui/machine/gui_rbmk_indicator.png b/src/main/resources/assets/hbm/textures/gui/machine/gui_rbmk_indicator.png new file mode 100644 index 0000000000000000000000000000000000000000..eb343cfce5adc44983cb006303222f68cad781d0 GIT binary patch literal 4252 zcmeHKXH=70mwqEn5fBBGa4GkSQdJ^w1rsq*5k!#CL68sxK}329CO{%6NEa~DivrTS z6pfxj&7V1c&UyDb=j?ON-p}*wH^RtJSCC(V z9{>PBy&Kvl0080)LBK&?PIt$&(QJR^b@UMJZc)P$X~M_x%H$f_nW+zeC0o;E!Zcq}dt z3BTaOFUNhgZAK?g-+z;ICq3oVoKNnUeY*s5%}S*yoJuV_H%>A&N19t&;^F8KC9U8F z)_^H;Z?&*!$>n~5JTRPnG;okbZ-U3HR09gb)F~Si{H#Z0hD@@O%>EaQ34Go|;WLQ5 zN1E-}Dg<8Kr5Cdja?>Ip-{Z=ksv6LePchT#lyxN${C|02SI>o^c6(*jiy#@8~c222W?(J zv~;k597})od*^%rF&L5$61&O=h@u^Wn%E~jhmj*Y=f8*o$#;D@{^v!3uEOD!u1(rr z7Q`1o730?~Cd10S4#)aeQV+CmTNVqrB=eU*OCPHt#J{$>+B6 z)NsJZn*5J2P!^8%uGb@wM!raC!NW0H!)-DuBE@zxPQm54@NjJXBV&_yBK51=90p4V)833^KfIn&p7esAhy3{g71Fb^&E|;BEI2I7O-rsg`|sI zKZ5I&gPLV+-Ca2oPFzTUfv^vKaCU;Gbu~#@NvCYFo0g$&820zNHu$xpD=q3%LS-dx zoiFzS=nckNU2>MZ*`)Pvs&b6%gh&aljj0c?a(DU5y7+rRHZnornM0p5zmw8IcP6ZS zs|owAiF$D>m3@zNgIZK$cZ2Ua0$D-dQ4c4Nl;Mv~y5C3sT<8IKm-fT7&TG}atMF}E zGbPOJ`qf(02-b!^{UoM0bc6!4wz>oU3AVUgB%PZC<(k0nAvm`h&Wl$~+Fx_x!f51l z9$2oFkE{~6-cI5`%*5;lFPgiNIdtuGf% zHEb`H(SAW2MY20DobZ35!V=9^_~1V``*W{6r$?T%b_9%IS^wB6eh}^+SH!njA|W>^$Ew;3vV8S5qy^VSCW>36In42M??Rzf#Fl`BS#Y^K;#zuY>#YF zE%n3a_P(fyxNSK_948A+Ybw;Oc!*j){olWP)1b-g&Z_5Sjh;?KT2kf>(|aMZpPy8U zl{a)|Xr|cfWFOKc_X+2(nNawI8>a_Y6cNmc>=xE(oTzZ>TH;@pFoQm~y1e`)*h?0Q&|6Mm*)2Uw{|s zwTET;`WEBJp|b-~x}GnUItns%c#Z7s9nQLxH$E9P)o{Ey84ohEvTCHcpNo~8G`MTc ztXH#0$RG-|x;{^Lm=qIJ88%+e#Zp5A{)ExE3Lq+|4?b)KV+W9591M)`=R|QXK3vwg z^7Yrun#_iiraiIFAf@Q~w7(1|IgfSyC`Rq0qKp%Fk-}H^FwKSbXoT4I&X{su)A)a7 zwupt~zYDO*M+>eRIC*Z`?CnCfa1_|35l%D`$Wod|I=!NyK*WxjoD+8{L{6=KVy;gv zUH#Q^*}Q0#w&r@FWbZ-s(=@3!B<>C^BIg_GT`KSvKiza?;g|j;4?&+20W+x-H3A*; zerO3cv{1X_f$_5sT`G0sw>cC*FSdu)?R?*QiVr(Egm-x>b?5eU>{-_4j9(7+`K{&} zkV;)5DS0IHrqTn>qwvui8#3w@x`_<8pzV7B@(5gyiVv@+y~AMNf!*>yz^hm4D~JS= zCY42u2L-Tw(Nyil|c_Et2B^Tw@HbYQbt(aoHL`5mj)zEdcz1Q`G?Q6`~ zHqyN4&#kXPHbgI2Skhf}Ek|QBa4{UTOdM^F&ItyGthcsovFvn-$SEP8 zLN&rp&BnUrs1QZk{K!}HFC6ruV36Cy2`|Yh)5j+F0DX;@z7>9u0Lm(x0=Kj!t4(ZA zJP%u+vk8*DxOs1$wv)plLnxPcI!m|rqr|xKutQq$mLj1=Dlq@Y^dlGKryh(9;^y|m z=snf06BcqLB52CgZ{tkslP&4BZe?etzGkx1`W(Y0CKA327*$|z0(dZ}^}N~FW0kt&V(>KF!oEGOxu zaV@<{-%kdy;okCAdDNS7A)_E5h3w~Ig0$tHc0QJA4!-Nw%J0wzQ=4H%;g0=X(zvn% zt*(N4{tI`Z<{o{|74JEp=Bgn6g%$-9QYz?6cE*nuEXEc7A9MdJm@8_dwqDO=58a2= zSJg_{?94Z<>M;IH3v}f|xyvV=FXSVdjffM*g=QZ4!MuzUlvk&Bmq{Cj1db3a3e2^2 zyiViUw$o4@3-vU&lB$mun5#z4M4e@QV5kH%yhXfIC46`XN7~%3V~%=m`>!u7ohIV> zh3^PXj2(FO!M~!S{-oaSE1d4(C}mlAdynpD=(dS7z$%xyk+0}DPIzNtr+5A1wkA$fne%U5_87c*;eiXU|LH|fN= z^}{&058^j^frf3+f9;POFC^Bs-=PX*2b~RMnb%ya#+~uLP+~F1Rn2zbI|FRZkS2_3JMxpv``KtE}IGkG~Y_nN}BS$2H zfAeqcS94~)h`btybH6-$5B~bXwul9UU|4y!g)diYSF}HozLn`GVyP!5E+=l3^a#6h zS%|yNq--|ZkrNB-7jD&!rw~UUhk`*`B~m3=*DwP`m@=49Dgesq0(zeW!P${L%5@Do zlUFG7q8&GRpKs%a{GZ5jK}3E9+dF`~w#>9g)daf$r8D9xY~x!J7q)YAY$)^6zk*Sh zLaNQq>oC++3H*ouaMi;toG!_1_=_V+0@-bCU;QvXUf;T$jtz4ZyE0*|#1TM+ev>4X zap)oTf&8fH2}fYkO9t`u(I$T;OE*H|Z~;etfhv6>h&%3*WJIKx7_)>iB9>y}f9bH1 z{YQ#`S5GYXu~Ou3t@{c2N9(dCgyz;uEqit)fsX8pv?BmI@Sm#pD7$Ja0ml2;$`)75 z{2~*~9FYNy*t9bnn2Tv1vFo9L!a!e|#_7VrgAeIXU+@^g1@#{ILNmy)p#0%MYqVdA zlYXkpJ9ye&R7`#+ttD|EIY2+XH!zdM+kz{eLvhN^SM;O>da|;(e?v z14{#6?HVW`-u>g2%Myb$M6UE*yn)?`P{*I@%dF>#b;|9m9*XlB%DKIwr@y;|kH@y> z)Y?s4NW=5J$r!BxrKx#i_OrC&`!B!T->jTI)XRVoTL8~TpAk1+av~WVqCuH*2yNrUpg65Lga6)cab%HF)#)>& z2nHZR7HWi?PH&7S+iySXsyjCpLPzljs*@A}h>iuF`;t~X4p+_zLFb;-Wtznt$}|Ug znoEI{&2>ZKCvz)_apX8Hy{D;okk2h?-Jrrc~sK??1=yIADjynjEQ h^Lzh)-YS;apqb|f%GyxMfBrs<-gQImva9Hje*-#+C4c|` literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/hbm/textures/models/network/indicator.png b/src/main/resources/assets/hbm/textures/models/network/indicator.png new file mode 100644 index 0000000000000000000000000000000000000000..c1ce51dbf7870f63d2fe41b72b906dba15f4451c GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^qCm{X!3HFCLa#0cQY^(zo*^7SP{WbZ0pu5Wx;TbN zOkF$CnvYqLhgDv1(X+cJ+@D*NoHymoytex9hE9=Gts^};%0dh?Zm!w-sB8D)t<$RB z8^80oXT>mK%lyqV&!%n_v}>ChG%dEm^TcZ2<^mP@cGicUkG^jFGx5#4 Date: Sun, 19 Apr 2026 22:00:30 +0200 Subject: [PATCH 3/3] that's not how it works in bean town --- changelog | 32 ++----------------- .../com/hbm/blocks/generic/BlockKeyhole.java | 2 +- .../com/hbm/crafting/ConsumableRecipes.java | 2 ++ src/main/java/com/hbm/main/NEIRegistry.java | 2 +- .../machine/rbmk/TileEntityRBMKBoiler.java | 22 +++++++++++-- .../machine/rbmk/TileEntityRBMKHeater.java | 18 ++++++++++- .../machine/rbmk/TileEntityRBMKRod.java | 8 ++++- 7 files changed, 51 insertions(+), 35 deletions(-) diff --git a/changelog b/changelog index b77da83cc..81693cda2 100644 --- a/changelog +++ b/changelog @@ -1,30 +1,4 @@ -## Added -* Redstone-over-radio lever - * Big breaker switches - * Up to two per module, side by side - * Can send different RoR values based on the lever's position -* Redstone-over-radio indicator lights - * Colored indicator light panels with labels on them - * Up to six lights per module - * Will light up when an RoR signal falls within the configured threshold - ## Changed -* All RoR panels now have basic item descriptions informing about the screwdriver requirement for configuration -* EMP grenades now deal 5x damage against anything with powered armor - * Decreased base damage to compensate -* EMP grenades now destroy machines in a small radius like an EMP missile would -* Grenades are no longer affected by nuclear blasts or other grenade explosions -* Players no longer receive the starting guide book on first spawn since it's now very outdated -* All RoR panels now have QMAW integration -* Legacy plasma heater and plasma heater hatches which are still found in crashed space ships can now be dismantled into steel pipes, copper pipes and analog circuits -* Removed legacy plasma block -* RoR panels now have OpenComputers integration, allowing otherwise fixed parameters like gauge thresholds, channels, and button commands to be adjusted on the fly -* Solinium blasts now use the new higher poly sphere model and frame interpolation, making the expansion smoother -* Using a defuser on paintable cables/pipes/tubes that already have a paint applied will toggle the overlay, makng the cable/pipe/tube blend in perfectly -* Mufflers installed on force fields now disable the loud spark noise caused by impacts - -## Fixed -* Fixed the grenade crafting handler not checking if a shell/filling combination is even valid, allowing weird combos -* Fixed dispenser fired laser grenades crashing the game -* Fixed schrabidium grenade being obscenely powerful for no reason -* Fixed annihilator recipe config throwing an error about the recipe list being empty, even though the recipe list should indeed be empty on purpose \ No newline at end of file +* RoR readers can now read neutron flux from fuel channels and the fill state of boilers and heat exchangers +* Canned recursion can now be crafted from canned recursion +* Soldering recipes are now prioritized over anvil recipes in the NEI listing \ No newline at end of file diff --git a/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java b/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java index b042ba695..ad470b577 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java +++ b/src/main/java/com/hbm/blocks/generic/BlockKeyhole.java @@ -203,7 +203,7 @@ public class BlockKeyhole extends BlockStone { int rand = world.rand.nextInt(20); if(rand == 0) { - world.setBlock(x, y + 1, z, ModBlocks.deco_loot); + world.setBlock(x, y + 1, z, ModBlocks.deco_loot); TileEntityLoot loot = (TileEntityLoot) world.getTileEntity(x, y + 1, z); if(world.rand.nextInt(5) == 0) { diff --git a/src/main/java/com/hbm/crafting/ConsumableRecipes.java b/src/main/java/com/hbm/crafting/ConsumableRecipes.java index d11d70fb5..988bb7165 100644 --- a/src/main/java/com/hbm/crafting/ConsumableRecipes.java +++ b/src/main/java/com/hbm/crafting/ConsumableRecipes.java @@ -10,6 +10,7 @@ import com.hbm.items.weapon.grenade.ItemGrenadeFilling.EnumGrenadeFilling; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; import com.hbm.items.ItemEnums; import com.hbm.items.ModItems; +import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.main.CraftingManager; import static com.hbm.inventory.OreDictManager.*; @@ -63,6 +64,7 @@ public class ConsumableRecipes { CraftingManager.addShapelessAuto(new ItemStack(ModItems.ingot_smore), new Object[] { Items.wheat, new ItemStack(ModItems.marshmallow, 1, 1), new ItemStack(Items.dye, 1, 3) }); CraftingManager.addShapelessAuto(new ItemStack(ModItems.marshmallow), new Object[] { Items.stick, Items.sugar, Items.wheat_seeds }); CraftingManager.addShapelessAuto(new ItemStack(ModItems.quesadilla, 3), new Object[] { ModItems.cheese, ModItems.cheese, Items.bread }); + CraftingManager.addShapelessAuto(new ItemStack(ModItems.canned_conserve, 1, EnumFoodType.RECURSION.ordinal()), new Object[] { new ItemStack(ModItems.canned_conserve, 1, EnumFoodType.RECURSION.ordinal()) }); //Peas CraftingManager.addRecipeAuto(new ItemStack(ModItems.peas), new Object[] { " S ", "SNS", " S ", 'S', Items.wheat_seeds, 'N', GOLD.nugget() }); diff --git a/src/main/java/com/hbm/main/NEIRegistry.java b/src/main/java/com/hbm/main/NEIRegistry.java index c340a14bb..2e8bbcb23 100644 --- a/src/main/java/com/hbm/main/NEIRegistry.java +++ b/src/main/java/com/hbm/main/NEIRegistry.java @@ -18,6 +18,7 @@ public class NEIRegistry { handlers.add(new ToolingHandler()); handlers.add(new ConstructionHandler()); handlers.add(new AnnihilatorHandler()); + handlers.add(new SolderingStationHandler()); handlers.add(new AnvilRecipeHandler()); handlers.add(new SmithingRecipeHandler()); handlers.add(new PressRecipeHandler()); @@ -72,7 +73,6 @@ public class NEIRegistry { handlers.add(new ElectrolyserMetalHandler()); handlers.add(new AshpitHandler()); handlers.add(new ArcWelderHandler()); - handlers.add(new SolderingStationHandler()); handlers.add(new ExposureChamberHandler()); handlers.add(new ArcFurnaceSolidHandler()); handlers.add(new ArcFurnaceFluidHandler()); diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java index a32131591..d76f5b550 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKBoiler.java @@ -1,7 +1,8 @@ package com.hbm.tileentity.machine.rbmk; -import api.hbm.fluid.IFluidStandardTransceiver; import api.hbm.fluidmk2.FluidNode; +import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import api.hbm.tile.IInfoProviderEC; import com.hbm.blocks.ModBlocks; @@ -37,7 +38,7 @@ import net.minecraft.util.Vec3; import net.minecraft.world.World; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")}) -public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent { +public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IControlReceiver, IFluidStandardTransceiverMK2, SimpleComponent, IInfoProviderEC, IRORValueProvider, CompatHandler.OCComponent { public FluidTank feed; public FluidTank steam; @@ -347,4 +348,21 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I data.setDouble(CompatEnergyControl.D_CONSUMPTION_MB, consumption); data.setDouble(CompatEnergyControl.D_OUTPUT_MB, output); } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "feed", + PREFIX_VALUE + "steam", + PREFIX_VALUE + "consumption" + }; + } + + @Override + public String provideRORValue(String name) { + if((PREFIX_VALUE + "feed").equals(name)) return "" + this.feed.getFill(); + if((PREFIX_VALUE + "steam").equals(name)) return "" + this.steam.getFill(); + if((PREFIX_VALUE + "consumption").equals(name)) return "" + this.consumption; + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java index 08397ddb2..402237bbc 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKHeater.java @@ -1,6 +1,7 @@ package com.hbm.tileentity.machine.rbmk; import api.hbm.fluidmk2.IFluidStandardTransceiverMK2; +import api.hbm.redstoneoverradio.IRORValueProvider; import com.hbm.blocks.ModBlocks; import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType; @@ -29,7 +30,7 @@ import net.minecraft.nbt.NBTTagCompound; import net.minecraft.world.World; @Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")}) -public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidStandardTransceiverMK2, SimpleComponent, CompatHandler.OCComponent { +public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidStandardTransceiverMK2, IRORValueProvider, SimpleComponent, CompatHandler.OCComponent { public FluidTank feed; public FluidTank steam; @@ -262,4 +263,19 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIRBMKHeater(player.inventory, this); } + + @Override + public String[] getFunctionInfo() { + return new String[] { + PREFIX_VALUE + "in", + PREFIX_VALUE + "out" + }; + } + + @Override + public String provideRORValue(String name) { + if((PREFIX_VALUE + "in").equals(name)) return "" + this.feed.getFill(); + if((PREFIX_VALUE + "out").equals(name)) return "" + this.steam.getFill(); + return null; + } } diff --git a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java index 37bae47ea..a44b2c5d8 100644 --- a/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java +++ b/src/main/java/com/hbm/tileentity/machine/rbmk/TileEntityRBMKRod.java @@ -552,7 +552,10 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM PREFIX_VALUE + "columnheat", PREFIX_VALUE + "rodheat", PREFIX_VALUE + "depletion", - PREFIX_VALUE + "xenon" + PREFIX_VALUE + "xenon", + PREFIX_VALUE + "fastflux", + PREFIX_VALUE + "slowflux", + PREFIX_VALUE + "flux" }; } @@ -564,6 +567,9 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM if((PREFIX_VALUE + "depletion").equals(name)) return "" + (int) (100 - ItemRBMKRod.getEnrichment(slots[0]) * 100); if((PREFIX_VALUE + "xenon").equals(name)) return "" + (int) (ItemRBMKRod.getPoison(slots[0])); } + if((PREFIX_VALUE + "fastflux").equals(name)) return "" + (int) Math.ceil(fluxFromType(NType.FAST)); + if((PREFIX_VALUE + "slowflux").equals(name)) return "" + (int) Math.ceil(fluxFromType(NType.SLOW)); + if((PREFIX_VALUE + "flux").equals(name)) return "" + (int) Math.ceil(fluxFromType(NType.ANY)); return null; } }