diff --git a/changelog b/changelog index 0773405a3..4aa8ff9c3 100644 --- a/changelog +++ b/changelog @@ -5,4 +5,7 @@ ## Fixed * Fixed missing battery socket tooltip * Potentially fixed an issue in regards to some hidden structures spawning -* Fixed FEnSU not immediately applying the muffler effect when used \ No newline at end of file +* Fixed FEnSU not immediately applying the muffler effect when used +* Fixed fluid counter valve not having a recipe +* Fixed issue where `/ntmreload` would break registered fluids from addons +* Fixed yet another issue regarding crates \ No newline at end of file diff --git a/src/main/java/com/hbm/inventory/fluid/FluidType.java b/src/main/java/com/hbm/inventory/fluid/FluidType.java index aed5ef93c..9113db421 100644 --- a/src/main/java/com/hbm/inventory/fluid/FluidType.java +++ b/src/main/java/com/hbm/inventory/fluid/FluidType.java @@ -103,6 +103,13 @@ public class FluidType { /** For CompatFluidRegistry */ public FluidType(String name, int id, int color, int p, int f, int r, EnumSymbol symbol, ResourceLocation texture) { + setupForeign(name, id, color, p, f, r, symbol, texture); + + Fluids.foreignFluids.add(this); + Fluids.metaOrder.add(this); + } + + public FluidType setupForeign(String name, int id, int color, int p, int f, int r, EnumSymbol symbol, ResourceLocation texture) { this.stringId = name; this.color = color; this.unlocalized = "hbmfluid." + name.toLowerCase(Locale.US); @@ -115,7 +122,7 @@ public class FluidType { this.id = id; Fluids.register(this, id); - Fluids.foreignFluids.add(this); + return this; } public FluidType setTemp(int temperature) { diff --git a/src/main/java/com/hbm/inventory/fluid/Fluids.java b/src/main/java/com/hbm/inventory/fluid/Fluids.java index 494973163..47fe280d4 100644 --- a/src/main/java/com/hbm/inventory/fluid/Fluids.java +++ b/src/main/java/com/hbm/inventory/fluid/Fluids.java @@ -884,7 +884,7 @@ public class Fluids { } } - private static HashMap fluidMigration = new HashMap(); // since reloading would create new fluid instances, and those break existing machines + public static HashMap fluidMigration = new HashMap(); // since reloading would create new fluid instances, and those break existing machines public static void reloadFluids(){ File folder = MainRegistry.configHbmDir; @@ -901,6 +901,7 @@ public class Fluids { customFluids.clear(); for(FluidType type : foreignFluids) { + fluidMigration.put(type.getName(), type); idMapping.remove(type.getID()); registerOrder.remove(type); nameMapping.remove(type.getName()); diff --git a/src/main/java/com/hbm/main/CraftingManager.java b/src/main/java/com/hbm/main/CraftingManager.java index 773bb98bc..26e7fafe1 100644 --- a/src/main/java/com/hbm/main/CraftingManager.java +++ b/src/main/java/com/hbm/main/CraftingManager.java @@ -580,6 +580,7 @@ public class CraftingManager { addShapelessAuto(new ItemStack(ModBlocks.fluid_duct_gauge), new Object[] { ModBlocks.fluid_duct_paintable, STEEL.ingot(), DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC) }); addRecipeAuto(new ItemStack(ModBlocks.fluid_valve, 1), new Object[] { "S", "W", 'S', Blocks.lever, 'W', ModBlocks.fluid_duct_paintable }); addRecipeAuto(new ItemStack(ModBlocks.fluid_switch, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.fluid_duct_paintable }); + addRecipeAuto(new ItemStack(ModBlocks.fluid_counter_valve, 1), new Object[] { "S", "W", 'S', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'W', ModBlocks.fluid_switch }); addRecipeAuto(new ItemStack(ModBlocks.fluid_pump, 1), new Object[] { " S ", "PGP", "IMI", 'S', STEEL.shell(), 'P', STEEL.pipe(), 'G', GRAPHITE.ingot(), 'I', STEEL.ingot(), 'M', ModItems.motor }); addRecipeAuto(new ItemStack(ModBlocks.pneumatic_tube, 8), new Object[] { "CRC", 'C', CU.plateCast(), 'R', ANY_RUBBER.ingot() }); addRecipeAuto(new ItemStack(ModBlocks.pneumatic_tube, 24), new Object[] { "CRC", 'C', CU.plateWelded(), 'R', ANY_RUBBER.ingot() }); diff --git a/src/main/java/com/hbm/util/CompatFluidRegistry.java b/src/main/java/com/hbm/util/CompatFluidRegistry.java index c683734c9..8b310781c 100644 --- a/src/main/java/com/hbm/util/CompatFluidRegistry.java +++ b/src/main/java/com/hbm/util/CompatFluidRegistry.java @@ -10,8 +10,9 @@ public class CompatFluidRegistry { /** Registers a fluid with a custom ID. */ public static FluidType registerFluid(String name, int id, int color, int p, int f, int r, EnumSymbol symbol, ResourceLocation texture) { - FluidType type = new FluidType(name, id, color, p, f, r, symbol, texture); - Fluids.metaOrder.add(type); + FluidType type = Fluids.fluidMigration.get(name); + if(type == null) type = new FluidType(name, id, color, p, f, r, symbol, texture); + else type.setupForeign(name, id, color, p, f, r, symbol, texture); return type; } }