From 86918a33e6d05610362f15d4a3f06751ccac932b Mon Sep 17 00:00:00 2001 From: Boblet Date: Tue, 8 Oct 2024 16:54:52 +0200 Subject: [PATCH] thorium recipe autogen --- changelog | 6 ++++-- .../hbm/inventory/fluid/tank/FluidTank.java | 8 +++++--- .../inventory/material/MatDistribution.java | 2 +- .../inventory/recipes/AssemblerRecipes.java | 10 +++++----- .../inventory/recipes/CentrifugeRecipes.java | 4 +++- .../inventory/recipes/CrystallizerRecipes.java | 4 +++- src/main/java/com/hbm/lib/HbmWorldGen.java | 18 ++++++++++-------- 7 files changed, 31 insertions(+), 21 deletions(-) diff --git a/changelog b/changelog index f272bd3e8..6a367159f 100644 --- a/changelog +++ b/changelog @@ -1,7 +1,7 @@ ## Changed * Updated russian and chinese localization * The fine soot recipe in the pyrolysis oven now only needs 4 tar -* Overdrive upgrades now use fullerite instead of lithium crystals +* Overdrive upgrades now use hard plastic/fullerite instead of lithium crystals * Machines now only send their sync packets once a second instead of once per tick if the values haven't changed, reducing network traffic by a considerable amount * Tom's explosion no longer causes any block updates on the millions of blocks it deletes which hopefully fixes a majority of the lag caused by the crater * Overdrive upgrades now increase power usage in pyrolysis ovens (equivalent to 2 speed upgrades per level) @@ -11,10 +11,12 @@ * Updated the shredder's textures * The strand caster will now cast its remaining buffer after 10 seconds of inactivity, even if the buffer is not full enough for a batch of 9 * The soldering station now has a toggle for the "refuse to do recipes with no fluid if fluid is present" behavior +* Recipes using the ore dictionary "oreThorium232" are now also generated for "oreThorium" ## Fixed * The conveyor grabber should no longer skip over items when used in long lines * Fixed a potential crash regarding crucibles * Fixed compatibility with EndlessIDs, biome changes should no longer crash the game * Fixed GL state leak caused by fluid tanks, causing some tile entities to be rendered without face culling -* Fixed a bug where using too many PWR heatsinks would cause an overflow, making the heat capacity negative \ No newline at end of file +* Fixed a bug where using too many PWR heatsinks would cause an overflow, making the heat capacity negative +* Fixed landmines generating into the floor on superflat worlds \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java index 135582280..1cbf80cc2 100644 --- a/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java +++ b/src/main/java/com/hbm/inventory/fluid/tank/FluidTank.java @@ -13,6 +13,8 @@ import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.items.ModItems; import com.hbm.items.machine.IItemFluidIdentifier; +import cpw.mods.fml.relauncher.Side; +import cpw.mods.fml.relauncher.SideOnly; import io.netty.buffer.ByteBuf; import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.Tessellator; @@ -183,11 +185,11 @@ public class FluidTank { * @param width * @param height */ - public void renderTank(int x, int y, double z, int width, int height) { + @SideOnly(Side.CLIENT) public void renderTank(int x, int y, double z, int width, int height) { renderTank(x, y, z, width, height, 0); } - public void renderTank(int x, int y, double z, int width, int height, int orientation) { + @SideOnly(Side.CLIENT) public void renderTank(int x, int y, double z, int width, int height, int orientation) { GL11.glEnable(GL11.GL_BLEND); @@ -242,7 +244,7 @@ public class FluidTank { GL11.glDisable(GL11.GL_BLEND); } - public void renderTankInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) { + @SideOnly(Side.CLIENT) public void renderTankInfo(GuiInfoContainer gui, int mouseX, int mouseY, int x, int y, int width, int height) { if(x <= mouseX && x + width > mouseX && y < mouseY && y + height >= mouseY) { List list = new ArrayList(); diff --git a/src/main/java/com/hbm/inventory/material/MatDistribution.java b/src/main/java/com/hbm/inventory/material/MatDistribution.java index 12e6d4f6e..6db7f5da2 100644 --- a/src/main/java/com/hbm/inventory/material/MatDistribution.java +++ b/src/main/java/com/hbm/inventory/material/MatDistribution.java @@ -68,7 +68,7 @@ public class MatDistribution extends SerializableRecipe { registerOre(OreDictManager.COAL.ore(), MAT_CARBON, GEM.q(3), MAT_STONE, QUART.q(1)); registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1)); registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1)); - registerOre(OreDictManager.TH232.ore(), MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1)); + for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) registerOre(ore, MAT_THORIUM, INGOT.q(2), MAT_URANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1)); registerOre(OreDictManager.CU.ore(), MAT_COPPER, INGOT.q(2), MAT_STONE, QUART.q(1)); registerOre(OreDictManager.PB.ore(), MAT_LEAD, INGOT.q(2), MAT_GOLD, NUGGET.q(1), MAT_STONE, QUART.q(1)); registerOre(OreDictManager.BE.ore(), MAT_BERYLLIUM, INGOT.q(2), MAT_STONE, QUART.q(1)); diff --git a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java index 5b52a30fd..01475b4ac 100644 --- a/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/AssemblerRecipes.java @@ -362,8 +362,8 @@ public class AssemblerRecipes extends SerializableRecipe { makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new AStack[] { new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), - new OreDictStack(DESH.ingot(), 16), - new ComparableStack(ModItems.ingot_cft, 2), + new OreDictStack(BIGMT.ingot(), 16), + new OreDictStack(ANY_HARDPLASTIC.ingot(), 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.ADVANCED), }, 200); makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new AStack[] { @@ -371,15 +371,15 @@ public class AssemblerRecipes extends SerializableRecipe { new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(BIGMT.ingot(), 16), - new ComparableStack(ModItems.ingot_cft, 6), + new ComparableStack(ModItems.ingot_cft, 8), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_BOARD), }, 300); makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] { new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), - new OreDictStack(STAR.ingot(), 16), - new ComparableStack(ModItems.ingot_cft, 8), + new OreDictStack(ANY_BISMOIDBRONZE.ingot(), 16), + new ComparableStack(ModItems.ingot_cft, 16), new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID), }, 500); diff --git a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java index 2c91e4e4a..4878cfb24 100644 --- a/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CentrifugeRecipes.java @@ -15,10 +15,12 @@ import com.hbm.config.GeneralConfig; import com.hbm.handler.imc.IMCCentrifuge; import static com.hbm.inventory.OreDictManager.*; import com.hbm.inventory.OreDictManager.DictFrame; +import com.hbm.inventory.OreDictManager; import com.hbm.inventory.RecipesCommon; import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.RecipesCommon.OreDictStack; +import com.hbm.inventory.material.MaterialShapes; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumChunkType; @@ -395,7 +397,7 @@ public class CentrifugeRecipes extends SerializableRecipe { lbs ? new ItemStack(ModItems.nugget_ra226, 2) : new ItemStack(ModItems.nugget_ra226, 1), new ItemStack(Blocks.gravel, 1) }); - recipes.put(new OreDictStack(TH232.ore()), new ItemStack[] { + for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) recipes.put(new OreDictStack(ore), new ItemStack[] { new ItemStack(ModItems.powder_thorium, 1), new ItemStack(ModItems.powder_thorium, 1), new ItemStack(ModItems.powder_uranium, 1), diff --git a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java index 5930101dd..135524cba 100644 --- a/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java +++ b/src/main/java/com/hbm/inventory/recipes/CrystallizerRecipes.java @@ -13,11 +13,13 @@ import com.google.gson.stream.JsonWriter; import com.hbm.blocks.ModBlocks; import com.hbm.handler.imc.IMCCrystallizer; import com.hbm.inventory.FluidStack; +import com.hbm.inventory.OreDictManager; import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.RecipesCommon.OreDictStack; import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.Fluids; +import com.hbm.inventory.material.MaterialShapes; import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumPlantType; @@ -63,7 +65,7 @@ public class CrystallizerRecipes extends SerializableRecipe { registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime)); registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime)); registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime), sulfur); - registerRecipe(TH232.ore(), new CrystallizerRecipe(ModItems.crystal_thorium, baseTime), sulfur); + for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime), sulfur); registerRecipe(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime), sulfur); registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime), sulfur); registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime)); diff --git a/src/main/java/com/hbm/lib/HbmWorldGen.java b/src/main/java/com/hbm/lib/HbmWorldGen.java index e17c1b0fd..e060239d9 100644 --- a/src/main/java/com/hbm/lib/HbmWorldGen.java +++ b/src/main/java/com/hbm/lib/HbmWorldGen.java @@ -403,14 +403,16 @@ public class HbmWorldGen implements IWorldGenerator { int x = i + rand.nextInt(16) + 8; int z = j + rand.nextInt(16) + 8; int y = world.getHeightValue(x, z); - - if(world.getBlock(x, y - 1, z).canPlaceTorchOnTop(world, x, y - 1, z)) { - world.setBlock(x, y, z, ModBlocks.mine_ap); - TileEntityLandmine landmine = (TileEntityLandmine) world.getTileEntity(x, y, z); - landmine.waitingForPlayer = true; - - if(GeneralConfig.enableDebugMode) - MainRegistry.logger.info("[Debug] Successfully spawned landmine at " + x + " " + (y) + " " + z); + + for(int g = y + 2; g >= y; g--) { + + if(world.getBlock(x, g - 1, z).canPlaceTorchOnTop(world, x, g - 1, z)) { + world.setBlock(x, g, z, ModBlocks.mine_ap); + TileEntityLandmine landmine = (TileEntityLandmine) world.getTileEntity(x, g, z); + landmine.waitingForPlayer = true; + if(GeneralConfig.enableDebugMode) MainRegistry.logger.info("[Debug] Successfully spawned landmine at " + x + " " + g + " " + z); + break; + } } }