From 8eb3e4ac2cef48a7df5998f4ece00bb107be7699 Mon Sep 17 00:00:00 2001 From: Boblet Date: Mon, 22 Nov 2021 10:26:48 +0100 Subject: [PATCH] ZIRNOX fixes, pheo's bobble --- .../com/hbm/blocks/generic/BlockBobble.java | 1 + .../hbm/inventory/gui/GUIScreenBobble.java | 14 +++++++---- src/main/java/com/hbm/items/ModItems.java | 4 +-- .../hbm/render/tileentity/RenderBobble.java | 9 +++++++ .../machine/TileEntityReactorZirnox.java | 25 +++++++++---------- 5 files changed, 33 insertions(+), 20 deletions(-) diff --git a/src/main/java/com/hbm/blocks/generic/BlockBobble.java b/src/main/java/com/hbm/blocks/generic/BlockBobble.java index beddb3174..b94177c08 100644 --- a/src/main/java/com/hbm/blocks/generic/BlockBobble.java +++ b/src/main/java/com/hbm/blocks/generic/BlockBobble.java @@ -170,6 +170,7 @@ public class BlockBobble extends BlockContainer { VT("VT-6/24", "VT-6/24", "Balefire warhead model and general texturework", "You cannot unfuck a horse.", true), DOC("The Doctor", "Doctor17PH", "Russian localization, lunar miner", "Perhaps the moon rocks were too expensive", true), BLUEHAT("The Blue Hat", "The Blue Hat", "Textures", "there's a listening device in this bobblehead$don't touch it thanks", true), + PHEO("Pheo", "Pheonix", "Deuterium machines, tantalium textures, Reliant Rocket", "RUN TO THE BEDROOM, ON THE SUITCASE ON THE LEFT,$YOU'LL FIND MY FAVORITE AXE", true), //testing garbage. why is she so dumb? CIRNO("Cirno", "Cirno", "being a dumb ice fairy", "No brain. Head empty.", true); diff --git a/src/main/java/com/hbm/inventory/gui/GUIScreenBobble.java b/src/main/java/com/hbm/inventory/gui/GUIScreenBobble.java index 9b3f668c0..52998b48a 100644 --- a/src/main/java/com/hbm/inventory/gui/GUIScreenBobble.java +++ b/src/main/java/com/hbm/inventory/gui/GUIScreenBobble.java @@ -69,16 +69,20 @@ public class GUIScreenBobble extends GuiScreen { this.fontRendererObj.drawStringWithShadow(title, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(title) / 2), nextLevel, 0x00ff00); nextLevel += 10; - - String text = this.bobble.type.contribution; - this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900); - nextLevel += 20; + + String[] list = this.bobble.type.contribution.split("\\$"); + for(String text : list) { + this.fontRendererObj.drawStringWithShadow(text, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(text) / 2), nextLevel, 0x009900); + nextLevel += 10; + } + + nextLevel += 10; } if(this.bobble.type.inscription != null) { - String title = "The bottom has following inscription:"; + String title = "On the bottom is the following inscription:"; this.fontRendererObj.drawStringWithShadow(title, (int)(left + sizeX / 2 - this.fontRendererObj.getStringWidth(title) / 2), nextLevel, 0x00ff00); nextLevel += 10; diff --git a/src/main/java/com/hbm/items/ModItems.java b/src/main/java/com/hbm/items/ModItems.java index 55577ccc2..47c3d964b 100644 --- a/src/main/java/com/hbm/items/ModItems.java +++ b/src/main/java/com/hbm/items/ModItems.java @@ -3506,8 +3506,8 @@ public class ModItems { rod_zirnox_thorium_fuel = new ItemZirnoxRod(120000, 30).setUnlocalizedName("rod_zirnox_thorium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_thorium_fuel"); rod_zirnox_mox_fuel = new ItemZirnoxRod(85000, 60).setUnlocalizedName("rod_zirnox_mox_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_mox_fuel"); rod_zirnox_plutonium_fuel = new ItemZirnoxRod(75000, 75).setUnlocalizedName("rod_zirnox_plutonium_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_plutonium_fuel"); - rod_zirnox_u233_fuel = new ItemZirnoxRod(100000, 70).setUnlocalizedName("rod_zirnox_u233_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_u233_fuel"); - rod_zirnox_u235_fuel = new ItemZirnoxRod(80000, 80).setUnlocalizedName("rod_zirnox_u235_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_u235_fuel"); + rod_zirnox_u233_fuel = new ItemZirnoxRod(90000, 70).setUnlocalizedName("rod_zirnox_u233_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_u233_fuel"); + rod_zirnox_u235_fuel = new ItemZirnoxRod(80000, 85).setUnlocalizedName("rod_zirnox_u235_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_u235_fuel"); rod_zirnox_les_fuel = new ItemZirnoxRod(200000, 150).setUnlocalizedName("rod_zirnox_les_fuel").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_les_fuel"); rod_zirnox_lithium = new ItemZirnoxBreedingRod(20000, 0).setUnlocalizedName("rod_zirnox_lithium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":rod_zirnox_lithium"); rod_zirnox_tritium = new Item().setUnlocalizedName("rod_zirnox_tritium").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.rod_zirnox_empty).setTextureName(RefStrings.MODID + ":rod_zirnox_tritium"); diff --git a/src/main/java/com/hbm/render/tileentity/RenderBobble.java b/src/main/java/com/hbm/render/tileentity/RenderBobble.java index 0bc9b1933..d7e45fd01 100644 --- a/src/main/java/com/hbm/render/tileentity/RenderBobble.java +++ b/src/main/java/com/hbm/render/tileentity/RenderBobble.java @@ -38,6 +38,7 @@ public class RenderBobble extends TileEntitySpecialRenderer { public static final ResourceLocation bobble_vt = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/vt.png"); public static final ResourceLocation bobble_doc = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/doctor17ph.png"); public static final ResourceLocation bobble_blue = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/thebluehat.png"); + public static final ResourceLocation bobble_pheo = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/pheo.png"); public static final ResourceLocation bobble_cirno = new ResourceLocation(RefStrings.MODID, "textures/models/trinkets/cirno.png"); @Override @@ -81,6 +82,7 @@ public class RenderBobble extends TileEntitySpecialRenderer { case VT: bindTexture(bobble_vt); break; case DOC: bindTexture(bobble_doc); break; case BLUEHAT: bindTexture(bobble_blue); break; + case PHEO: bindTexture(bobble_pheo); break; case CIRNO: bindTexture(bobble_cirno); break; default: bindTexture(ResourceManager.universal); } @@ -336,6 +338,10 @@ public class RenderBobble extends TileEntitySpecialRenderer { } } + /* + * Creates a small diamond at 0/0, useful for figuring out where the translation is at + * to determine the rotation point + */ public void renderOrigin() { GL11.glDisable(GL11.GL_CULL_FACE); @@ -401,6 +407,9 @@ public class RenderBobble extends TileEntitySpecialRenderer { GL11.glEnable(GL11.GL_LIGHTING); } + /* + * Override with Minecraft.getMinecraft()'s texman to prevent NPEs when invoked statically + */ @Override protected void bindTexture(ResourceLocation loc) { Minecraft.getMinecraft().getTextureManager().bindTexture(loc); diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java b/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java index a22b4e474..29a251aa0 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityReactorZirnox.java @@ -129,23 +129,23 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF case 5: return new int[] { 4, 6, 12 }; case 6: - return new int[] { 1, 5, 13 }; + return new int[] { 5, 13 }; case 7: return new int[] { 0, 8, 14 }; case 8: return new int[] { 1, 7, 9, 15 }; case 9: - return new int[] { 4, 8, 16}; + return new int[] { 2, 8, 16}; case 10: - return new int[] { 11, 17 }; + return new int[] { 3, 11, 17 }; case 11: - return new int[] { 10, 12, 18 }; + return new int[] { 4, 10, 12, 18 }; case 12: - return new int[] { 11, 13, 19 }; + return new int[] { 5, 11, 13, 19 }; case 13: - return new int[] { 12, 20 }; + return new int[] { 6, 12, 20 }; case 14: - return new int[] { 7, 15, 21 }; + return new int[] { 7, 15, 21 }; case 15: return new int[] { 8, 14, 16, 22 }; case 16: @@ -224,13 +224,12 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF private void generateSteam() { // function of SHS produced per tick - // maxes out at heat% * tank capacity / 20 - double Steam = (((double) heat / (double) maxHeat) * ((double) water.getMaxFill() / 50D)); + // heat% * 64 * 10 (should get rid of any rounding errors) + int Water = (int) ((float)heat / maxHeat) * 64; + int Steam = Water * 10; - double Water = Steam /= 10; - - water.setFill(water.getFill() - (int) Math.ceil(Water)); - steam.setFill(steam.getFill() + (int) Math.floor(Steam)); + water.setFill(water.getFill() - Water); + steam.setFill(steam.getFill() + Steam); if(water.getFill() < 0) water.setFill(0);