From 9a2eb731adb90863063ba24ca551c890226fec09 Mon Sep 17 00:00:00 2001 From: Boblet Date: Thu, 30 Jul 2026 14:50:48 +0200 Subject: [PATCH] they are eating my flesh --- changelog | 7 ++- gradle.properties | 2 +- .../java/com/hbm/blocks/BlockDummyable.java | 50 ++++------------- .../com/hbm/blocks/network/PylonRedWire.java | 3 +- .../com/hbm/handler/MultiblockHandlerXR.java | 53 ------------------- .../java/com/hbm/hazard/HazardRegistry.java | 9 ++++ .../java/com/hbm/items/tool/ItemWrench.java | 16 ++++-- src/main/java/com/hbm/lib/RefStrings.java | 2 +- .../saveddata/satellites/SatelliteBase.java | 1 - .../tileentity/network/TileEntityPylon.java | 11 ++++ .../com/hbm/world/gen/NTMWorldGenerator.java | 2 +- 11 files changed, 52 insertions(+), 104 deletions(-) diff --git a/changelog b/changelog index b16a63a42..8d625149d 100644 --- a/changelog +++ b/changelog @@ -12,6 +12,7 @@ * Spy satellites now have the `getsmog` command, checking for soot pollution on the current target coordinate * The research reactor and breeding reactor have been deprecated * The reactors and the plate fuel no longer have recipes, but existing ones will continue to function until they run out of fuel +* Removed orphaned multiblock dummies clearing themselves via random ticks, only block updates can do that now ## Fixed * Fixed pile fuel loader temperature reading not working @@ -23,4 +24,8 @@ * Fixed QMAW manual pages not being able to be overwritten by resource packs * This feature was a major pain in the ass to actually make, and it apparently never even worked until now * Fixed satellite groundstation losing its frequency on relog -* Added extra safeguarding preventing crashes caused by multiblock door tile entities not bound to the correct block \ No newline at end of file +* Added extra safeguarding preventing crashes caused by multiblock door tile entities not bound to the correct block +* Fixed new pile rods now having radiation values +* Potentially fixed a multiblock migration issue where standard electricity pylons would disappear due to changes in expected metadata +* Fixed the pipe wrench assuming anchor pos 0/0/0 when NBT data is initialized as well as clearing all NBT data if a pipe connection is created +* Fixed tower base structures spawning in sandy biomes \ No newline at end of file diff --git a/gradle.properties b/gradle.properties index 283f402c4..e0bb41b87 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=5768 +mod_build_number=5771 credits=HbMinecraft,\ \ rodolphito (explosion algorithms),\ diff --git a/src/main/java/com/hbm/blocks/BlockDummyable.java b/src/main/java/com/hbm/blocks/BlockDummyable.java index 1cca3e365..01c039ade 100644 --- a/src/main/java/com/hbm/blocks/BlockDummyable.java +++ b/src/main/java/com/hbm/blocks/BlockDummyable.java @@ -40,7 +40,6 @@ import net.minecraft.client.renderer.Tessellator; import java.util.ArrayList; import java.util.List; -import java.util.Random; import java.util.Set; import org.lwjgl.opengl.GL11; @@ -49,7 +48,6 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl public BlockDummyable(Material mat) { super(mat); - this.setTickRandomly(true); } /// BLOCK METADATA /// @@ -81,26 +79,17 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl overrideTileMeta = 0; } + @Override public void onNeighborBlockChange(World world, int x, int y, int z, Block block) { - super.onNeighborBlockChange(world, x, y, z, block); - if(safeRem) - return; - - destroyIfOrphan(world, x, y, z); - } - - public void updateTick(World world, int x, int y, int z, Random rand) { - - super.updateTick(world, x, y, z, rand); + if(safeRem) return; destroyIfOrphan(world, x, y, z); } private void destroyIfOrphan(World world, int x, int y, int z) { - if(world.isRemote) - return; + if(world.isRemote) return; int metadata = world.getBlockMetadata(x, y, z); @@ -194,18 +183,10 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl ForgeDirection dir = ForgeDirection.NORTH; - if(i == 0) { - dir = ForgeDirection.getOrientation(2); - } - if(i == 1) { - dir = ForgeDirection.getOrientation(5); - } - if(i == 2) { - dir = ForgeDirection.getOrientation(3); - } - if(i == 3) { - dir = ForgeDirection.getOrientation(4); - } + if(i == 0) dir = ForgeDirection.getOrientation(2); + if(i == 1) dir = ForgeDirection.getOrientation(5); + if(i == 2) dir = ForgeDirection.getOrientation(3); + if(i == 3) dir = ForgeDirection.getOrientation(4); dir = getDirModified(dir); @@ -373,20 +354,9 @@ public abstract class BlockDummyable extends BlockContainer implements ICustomBl super.breakBlock(world, x, y, z, b, i); } - @Override - public int getRenderType() { - return -1; - } - - @Override - public boolean isOpaqueCube() { - return false; - } - - @Override - public boolean renderAsNormalBlock() { - return false; - } + @Override public int getRenderType() { return -1; } + @Override public boolean isOpaqueCube() { return false; } + @Override public boolean renderAsNormalBlock() { return false; } /** * @returns an int array with six fields, describing the amount of dummy blocks in each direction around the core. order is UP, DOWN, FORWARD, BACKWARD, LEFT, RIGHT diff --git a/src/main/java/com/hbm/blocks/network/PylonRedWire.java b/src/main/java/com/hbm/blocks/network/PylonRedWire.java index 7c14957c1..1ee3e7e0d 100644 --- a/src/main/java/com/hbm/blocks/network/PylonRedWire.java +++ b/src/main/java/com/hbm/blocks/network/PylonRedWire.java @@ -22,8 +22,7 @@ public class PylonRedWire extends BlockDummyable implements ITooltipProvider { @Override public TileEntity createNewTileEntity(World world, int meta) { - - if(meta >= 12) return new TileEntityPylon(); + if(meta == 0 || meta >= 12) return new TileEntityPylon(); return null; } diff --git a/src/main/java/com/hbm/handler/MultiblockHandlerXR.java b/src/main/java/com/hbm/handler/MultiblockHandlerXR.java index 7f054d8c7..12a3c689d 100644 --- a/src/main/java/com/hbm/handler/MultiblockHandlerXR.java +++ b/src/main/java/com/hbm/handler/MultiblockHandlerXR.java @@ -96,36 +96,6 @@ public class MultiblockHandlerXR { BlockDummyable.safeRem = false; } - @Deprecated - public static void emptySpace(World world, int x, int y, int z, int[] dim, Block block, ForgeDirection dir) { - - if(dim == null || dim.length != 6) - return; - - int count = 0; - - System.out.println("emptyspace is deprecated and shouldn't even be executed"); - - int[] rot = rotate(dim, dir); - - for(int a = x - rot[4]; a <= x + rot[5]; a++) { - for(int b = y - rot[1]; b <= y + rot[0]; b++) { - for(int c = z - rot[2]; c <= z + rot[3]; c++) { - - if(world.getBlock(a, b, c) == block) - world.setBlockToAir(a, b, c); - - count++; - - if(count > 2000) { - System.out.println("emptyspace: ded " + a + " " + b + " " + c); - return; - } - } - } - } - } - public static int[] rotate(int[] dim, ForgeDirection dir) { if(dim == null) return null; @@ -148,27 +118,4 @@ public class MultiblockHandlerXR { return dim; } - - public static double[] rotateDouble(double[] dim, ForgeDirection dir) { - - if(dim == null) return null; - if(dir == ForgeDirection.SOUTH) return dim; - - if(dir == ForgeDirection.NORTH) { - // U D N S W E - return new double[] { dim[0], dim[1], dim[3], dim[2], dim[5], dim[4] }; - } - - if(dir == ForgeDirection.EAST) { - // U D N S W E - return new double[] { dim[0], dim[1], dim[5], dim[4], dim[2], dim[3] }; - } - - if(dir == ForgeDirection.WEST) { - // U D N S W E - return new double[] { dim[0], dim[1], dim[4], dim[5], dim[3], dim[2] }; - } - - return dim; - } } diff --git a/src/main/java/com/hbm/hazard/HazardRegistry.java b/src/main/java/com/hbm/hazard/HazardRegistry.java index 4347c21fb..e663fc284 100644 --- a/src/main/java/com/hbm/hazard/HazardRegistry.java +++ b/src/main/java/com/hbm/hazard/HazardRegistry.java @@ -14,6 +14,7 @@ import com.hbm.inventory.material.MaterialShapes; import com.hbm.items.ModItems; import com.hbm.items.machine.ItemBreedingRod.BreedingRodType; import com.hbm.items.machine.ItemPWRFuel.EnumPWRFuel; +import com.hbm.items.machine.ItemPileRodMK2.EnumPileRod; import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial; import com.hbm.items.machine.ItemWatzPellet.EnumWatzType; import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType; @@ -344,6 +345,14 @@ public class HazardRegistry { registerRTGPellet(pellet_rtg_gold, au198 * rtg, 0, 5F); registerRTGPellet(pellet_rtg_americium, am241 * rtg, 0); HazardSystem.register(new ItemStack(pellet_rtg_depleted, 1, DepletedRTGMaterial.NEPTUNIUM.ordinal()), makeData(RADIATION, np237 * rtg)); + + + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.RA226BE.ordinal()), makeData(RADIATION, rabe * billet * 3)); + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.PO210BE.ordinal()), makeData(RADIATION, pobe * billet * 3)); + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.NU.ordinal()), makeData(RADIATION, u * billet * 3)); + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.PU239.ordinal()), makeData(RADIATION, pu239 * billet * 3)); + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.RGP.ordinal()), makeData(RADIATION, purg * billet * 3)); + HazardSystem.register(new ItemStack(ModItems.pile_rod, 1, EnumPileRod.WASTE.ordinal()), makeData(RADIATION, wst * billet * 3)); HazardSystem.register(pile_rod_uranium, makeData(RADIATION, u * billet * 3)); HazardSystem.register(pile_rod_pu239, makeData(RADIATION, !GeneralConfig.enable528 ? purg * billet + pu239 * billet + u * billet : purg * billet + pu239 * billet + wst * billet)); diff --git a/src/main/java/com/hbm/items/tool/ItemWrench.java b/src/main/java/com/hbm/items/tool/ItemWrench.java index c7dbe6f5c..871d58cae 100644 --- a/src/main/java/com/hbm/items/tool/ItemWrench.java +++ b/src/main/java/com/hbm/items/tool/ItemWrench.java @@ -44,8 +44,11 @@ public class ItemWrench extends ItemSword { TileEntity te = world.getTileEntity(x, y, z); if(te != null && te instanceof TileEntityPipelineBase) { + + if(stack.stackTagCompound == null) + stack.stackTagCompound = new NBTTagCompound(); - if(stack.stackTagCompound == null) { + if(!stack.stackTagCompound.hasKey("x")) { stack.stackTagCompound = new NBTTagCompound(); stack.stackTagCompound.setInteger("x", x); @@ -77,13 +80,18 @@ public class ItemWrench extends ItemSword { case 3: player.addChatMessage(new ChatComponentText("Pipe error - Pipe anchor is too far away")); break; case 4: player.addChatMessage(new ChatComponentText("Pipe error - Pipe anchor fluid types do not match")); break; } - - stack.stackTagCompound = null; + + stack.stackTagCompound.removeTag("x"); + stack.stackTagCompound.removeTag("y"); + stack.stackTagCompound.removeTag("z"); } else { + stack.stackTagCompound.removeTag("x"); + stack.stackTagCompound.removeTag("y"); + stack.stackTagCompound.removeTag("z"); + player.addChatMessage(new ChatComponentText("Pipe error")); - stack.stackTagCompound = null; } } diff --git a/src/main/java/com/hbm/lib/RefStrings.java b/src/main/java/com/hbm/lib/RefStrings.java index 626bc5a1b..79b50041b 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 (5768)"; + public static final String VERSION = "1.0.27 BETA (5771)"; //HBM's Beta Naming Convention: //V T (X) //V -> next release version diff --git a/src/main/java/com/hbm/saveddata/satellites/SatelliteBase.java b/src/main/java/com/hbm/saveddata/satellites/SatelliteBase.java index 8dc201a85..15a7fb2d8 100644 --- a/src/main/java/com/hbm/saveddata/satellites/SatelliteBase.java +++ b/src/main/java/com/hbm/saveddata/satellites/SatelliteBase.java @@ -17,7 +17,6 @@ public abstract class SatelliteBase { public static final String CMD_GETTARGETX = "gettargetx"; public static final String CMD_GETTARGETZ = "gettargetz"; - public int range = 1_000; public int targetX; public int targetZ; diff --git a/src/main/java/com/hbm/tileentity/network/TileEntityPylon.java b/src/main/java/com/hbm/tileentity/network/TileEntityPylon.java index 99f185e8b..25fdcf046 100644 --- a/src/main/java/com/hbm/tileentity/network/TileEntityPylon.java +++ b/src/main/java/com/hbm/tileentity/network/TileEntityPylon.java @@ -11,6 +11,17 @@ import net.minecraftforge.common.util.ForgeDirection; public class TileEntityPylon extends TileEntityPylonBase { + @Override + public void updateEntity() { + + // migration + if(!worldObj.isRemote && this.getBlockMetadata() == 0) { + worldObj.setBlockMetadataWithNotify(xCoord, yCoord, zCoord, 12, 3); + } + + super.updateEntity(); + } + @Override public ConnectionType getConnectionType() { return ConnectionType.SINGLE; diff --git a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java index 94d6737f9..13c19938f 100644 --- a/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java +++ b/src/main/java/com/hbm/world/gen/NTMWorldGenerator.java @@ -254,7 +254,7 @@ public class NTMWorldGenerator implements IWorldGenerator { spawnWeight = StructureConfig.enableRuins ? StructureConfig.ruinsJSpawnWeight : 0; }}); NBTStructure.registerStructure(0, new SpawnCondition("tower_base") {{ - canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome); + canSpawn = biome -> biome.heightVariation <= 0.3F && !isWaterBiome(biome) && !BiomeDictionary.isBiomeOfType(biome, Type.SANDY); structure = new JigsawPiece("tower_base", StructureManager.tower_base, -6); spawnWeight = StructureConfig.towerBaseSpawnWeight; }});