From dfee6b6341dd5b701decaaa87121c28df216b390 Mon Sep 17 00:00:00 2001 From: rgjav Date: Mon, 25 May 2026 09:50:07 -0600 Subject: [PATCH 1/2] added my name to credits --- CREDITS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CREDITS.md b/CREDITS.md index 7ab1f7bc..daad5b17 100644 --- a/CREDITS.md +++ b/CREDITS.md @@ -1,5 +1,5 @@ # Developers -RealAntEngineers, purpl3xity +RealAntEngineers, purpl3xity, rgjava # Translators 9m113konkurs, RealAntEngineers From 94bcd05fbd4ed22156de2c63ba69d6e5134e4b46 Mon Sep 17 00:00:00 2001 From: rgjav Date: Mon, 25 May 2026 17:40:19 -0600 Subject: [PATCH 2/2] finished porting to 1.21.1 --- build.gradle | 2 +- .../rae/crowns/content/event/DataEvents.java | 2 +- .../fuel_assembly/AssemblyBlockEntity.java | 4 +- .../crowns/content/ponder/NuclearScene.java | 2 + .../conduction/HeatExchangerBlockEntity.java | 4 +- .../rae/crowns/init/misc/CommandsInit.java | 2 +- .../com/rae/crowns/init/misc/NucleusInit.java | 184 +++++++++++++----- .../META-INF/neoforge.mods.toml | 0 8 files changed, 143 insertions(+), 57 deletions(-) rename src/main/{template => templates}/META-INF/neoforge.mods.toml (100%) diff --git a/build.gradle b/build.gradle index 185d1a70..402451b4 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ neoForge { } // This line is optional. Access Transformers are automatically detected - accessTransformers = project.files('src/main/template/META-INF/accesstransformer.cfg') + // accessTransformers = project.files('src/main/templates/META-INF/accesstransformer.cfg') // Default run configurations. // These can be tweaked, removed, or duplicated as needed. diff --git a/src/main/java/com/rae/crowns/content/event/DataEvents.java b/src/main/java/com/rae/crowns/content/event/DataEvents.java index e2736791..2d79c146 100644 --- a/src/main/java/com/rae/crowns/content/event/DataEvents.java +++ b/src/main/java/com/rae/crowns/content/event/DataEvents.java @@ -12,7 +12,7 @@ import net.neoforged.neoforge.event.server.ServerStoppedEvent; import org.jetbrains.annotations.NotNull; -@EventBusSubscriber(modid = CROWNS.MODID) +//@EventBusSubscriber(modid = CROWNS.MODID) public class DataEvents { //put this inside the Physics world data, that way we will have access to the private maps diff --git a/src/main/java/com/rae/crowns/content/nuclear/fuel_assembly/AssemblyBlockEntity.java b/src/main/java/com/rae/crowns/content/nuclear/fuel_assembly/AssemblyBlockEntity.java index 61649fc9..11db2bee 100644 --- a/src/main/java/com/rae/crowns/content/nuclear/fuel_assembly/AssemblyBlockEntity.java +++ b/src/main/java/com/rae/crowns/content/nuclear/fuel_assembly/AssemblyBlockEntity.java @@ -100,7 +100,7 @@ public void tick() { PhysicsWorldData data = PhysicsSaveManager.get((ServerLevel) level); if (data != null && !data - .ticked(SectionPos.of(getBlockPos()).asLong())) return; + .ticked(SectionPos.of(getBlockPos()).asLong(), (int) level.getGameTime())) return; if (syncCooldown > 0) { syncCooldown--; if (syncCooldown == 0 && queuedSync) @@ -166,7 +166,7 @@ public void fakeLazyTick() { assert level != null; if (!level.isClientSide()) { PhysicsWorldData data = PhysicsSaveManager.get((ServerLevel) level); - if (data == null || !data.ticked(SectionPos.of(getBlockPos()).asLong())) return; + if (data == null || !data.ticked(SectionPos.of(getBlockPos()).asLong(), (int) level.getGameTime())) return; oldNbrOfFission = nbrOfFission; nbrOfFission = additionalNeutronsAbsorbed.getValue() + backgroundActivity; //for now a 100% change of fission : no absorption //this is fine here. because diff --git a/src/main/java/com/rae/crowns/content/ponder/NuclearScene.java b/src/main/java/com/rae/crowns/content/ponder/NuclearScene.java index 50fb3e60..c29663d7 100644 --- a/src/main/java/com/rae/crowns/content/ponder/NuclearScene.java +++ b/src/main/java/com/rae/crowns/content/ponder/NuclearScene.java @@ -32,8 +32,10 @@ public static void nuclearBasic(@NotNull SceneBuilder builder, @NotNull SceneBui scene.world().showSection(sceneBuildingUtil.select().position(centerFuel), Direction.UP); scene.world().showSection(sceneBuildingUtil.select().position(exteriorFuel), Direction.UP); scene.overlay().showOutlineWithText(sceneBuildingUtil.select().position(centerFuel), 3 * 20) + .text("nuclear fuel naturally produce fast neutrons"); scene.idleSeconds(4); + scene.overlay().showOutlineWithText(sceneBuildingUtil.select().position(exteriorFuel), 3 * 20) .text("fast neutrons are unlikely to cause an other fuel block to undergo fission"); scene.idleSeconds(4); diff --git a/src/main/java/com/rae/crowns/content/thermodynamics/conduction/HeatExchangerBlockEntity.java b/src/main/java/com/rae/crowns/content/thermodynamics/conduction/HeatExchangerBlockEntity.java index 1983f1cd..01416892 100644 --- a/src/main/java/com/rae/crowns/content/thermodynamics/conduction/HeatExchangerBlockEntity.java +++ b/src/main/java/com/rae/crowns/content/thermodynamics/conduction/HeatExchangerBlockEntity.java @@ -123,7 +123,7 @@ public void tick() { float power = getInternalConductivity() * (this.getTemperature() - WATER_TANK.getState().temperature()) * dt / iteration; WATER_TANK.heat(power); PhysicsWorldData data = PhysicsSaveManager.get((ServerLevel) level); - if (data != null && data.ticked(SectionPos.of(getBlockPos()).asLong())) { + if (data != null && data.ticked(SectionPos.of(getBlockPos()).asLong(), (int) level.getGameTime())) { this.addTemperature(-power / this.getThermalCapacity()); } } @@ -262,7 +262,7 @@ public FluidStack getProvidedOutwardFluid(Direction side) { PhysicsWorldData data = PhysicsSaveManager.get(level); boolean canCoolBlock = - data != null && data.ticked(SectionPos.of(exchanger.getBlockPos()).asLong()); + data != null && data.ticked(SectionPos.of(exchanger.getBlockPos()).asLong(), (int) level.getGameTime()); for (int i = 0; i < iteration; i++) { // ENERGY, not temperature diff --git a/src/main/java/com/rae/crowns/init/misc/CommandsInit.java b/src/main/java/com/rae/crowns/init/misc/CommandsInit.java index 89bd781f..b2b7b2c0 100644 --- a/src/main/java/com/rae/crowns/init/misc/CommandsInit.java +++ b/src/main/java/com/rae/crowns/init/misc/CommandsInit.java @@ -119,7 +119,7 @@ private static int dumpStatus(CommandContext context, boolea "___________thermodynamic simulation status___________\n" + " -" + data.getDynamicData().size() + " dynamic data blocks\n" + " -" + data.getLoadedSections().size() + " loaded chunk sections\n" + - " -" + data.getLoadedSections().stream().filter(data::ticked).toList().size() + " ticked sections\n" + + " -" + data.getLoadedSections().stream().filter((s) -> data.ticked(s, (int) context.getSource().getLevel().getGameTime())).toList().size() + " ticked sections\n" + " -initialization :\n" + " -" + DataLayerType.CONDUCTION.id + " " + initialise.getOrDefault(DataLayerType.CONDUCTION, new ArrayList<>()).size() + "\n" + " -" + DataLayerType.RESILIENCE.id + " " + initialise.getOrDefault(DataLayerType.RESILIENCE, new ArrayList<>()).size() + "\n" + diff --git a/src/main/java/com/rae/crowns/init/misc/NucleusInit.java b/src/main/java/com/rae/crowns/init/misc/NucleusInit.java index e2f966ae..066301cc 100644 --- a/src/main/java/com/rae/crowns/init/misc/NucleusInit.java +++ b/src/main/java/com/rae/crowns/init/misc/NucleusInit.java @@ -10,86 +10,170 @@ public class NucleusInit { - long Day = 24000L; - - Nucleus Sr90 = new Nucleus(90,38); - Nucleus Zr92 = new Nucleus(92, 52); - Nucleus Xe135 = new Nucleus(135, 54, Couple.create(7f,7f), - Nucleus.NuclearEquation.EMPTY , - Nucleus.NuclearEquation.EMPTY, Day * 0.5f); - Nucleus Cs137 = new Nucleus(137, 55, new Nucleus.NuclearEquation(Map.of(), 1, 0f), - 30 * Day); - Nucleus Nd144 = new Nucleus(144, 60); - Nucleus Sm149 = new Nucleus(149, 62); + static long Day = 24000L; + static long Year = 31_556_952L * 20; + public static Nucleus Be9; + public static Nucleus Sr90; + public static Nucleus Zr92; + public static Nucleus Kr92; + public static Nucleus Xe135; + public static Nucleus Cs137; + public static Nucleus Ba141; + public static Nucleus Nd144; + public static Nucleus Sm149; + public static Nucleus Th231; + public static Nucleus Th234; + public static Nucleus U236; + public static Nucleus U238; + public static Nucleus U239; + public static Nucleus Np239; + static { + Sr90 = new Nucleus(90, 38, () -> Nucleus.NuclearEquation.EMPTY, 2.8f * Day); + Zr92 = new Nucleus((short) 92, (short) 52); + Xe135 = new Nucleus(135, 54, Couple.create(7f, 7f), + () -> Nucleus.NuclearEquation.EMPTY, + () -> Nucleus.NuclearEquation.EMPTY, 1200); + Cs137 = new Nucleus(137, 55, () -> Nucleus.NuclearEquation.EMPTY, 3f * Day); + Nd144 = new Nucleus((short) 144, (short) 60); + Sm149 = new Nucleus((short) 149, (short) 62); + Be9 = new Nucleus((short) 9, (short) 4); // It's just a thing + } // Delayed neutron precursor groups (DN1..DN6) - Nucleus DN1 = new Nucleus( - 8001, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), // emits 1 neutron + public static Nucleus DN1 = new Nucleus( + 8001, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), // emits 1 neutron 55.6f * 20f // ~1112 ticks ); - Nucleus DN2 = new Nucleus( - 8002, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), + public static Nucleus DN2 = new Nucleus( + 8002, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), 22.7f * 20f // ~454 ticks ); - Nucleus DN3 = new Nucleus( - 8002, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), + public static Nucleus DN3 = new Nucleus( + 8003, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), 6.2f * 20f // ~454 ticks ); - Nucleus DN4 = new Nucleus( - 8002, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), + public static Nucleus DN4 = new Nucleus( + 8004, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), 2.3f * 20f // ~454 ticks ); - Nucleus DN5 = new Nucleus( - 8002, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), + public static Nucleus DN5 = new Nucleus( + 8005, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), 0.61f * 20f // ~454 ticks ); - Nucleus DN6 = new Nucleus( - 8002, 0, - new Nucleus.NuclearEquation(Map.of(), 1f, 0f), + public static Nucleus DN6 = new Nucleus( + 8006, 0, 0, + () -> new Nucleus.NuclearEquation(Map.of(), 1f, 0f), 0.23f * 20f // ~454 ticks ); // ... repeat for DN3–DN6 with their half-lives // U-235 with prompt + delayed neutrons - Nucleus U235 = new Nucleus( - 235, 92, + public static Nucleus U235 = new Nucleus(235, 92, Couple.create(1f, 583f), - new Nucleus.NuclearEquation( + () -> new Nucleus.NuclearEquation( Map.ofEntries( - entry(135, 0.06f), // Xe-135 - entry(137, 0.06f), // Cs-137 - entry(90, 0.06f), // Sr-90 - entry(149, 0.011f), // Sm-149 - entry(92, 0.06f), // Zr-92 - entry(144, 0.05f), // Nd-144 - entry(8001, 0.000215f), // DN1 - entry(8002, 0.001424f), // DN2 - entry(8003, 0.001274f), // DN3 - entry(8004, 0.002568f), // DN4 - entry(8005, 0.000748f), // DN5 - entry(8006, 0.000273f) // DN6 + entry(Xe135, 0.06f), // Xe-135 + entry(Cs137, 0.06f), // Cs-137 + entry(Sr90, 0.06f), // Sr-90 + entry(Sm149, 0.011f), // Sm-149 + entry(Zr92, 0.06f), // Zr-92 + entry(Nd144, 0.05f), // Nd-144 + entry(DN1, 0.000215f), // DN1 + entry(DN2, 0.001424f), // DN2 + entry(DN3, 0.001274f), // DN3 + entry(DN4, 0.002568f), // DN4 + entry(DN5, 0.000748f), // DN5 + entry(DN6, 0.000273f) // DN6 ), 2.39f, // prompt neutrons only 19.54f*1e12f ), - new Nucleus.NuclearEquation(Map.of(231, 1f), 0f, 0f), + () -> new Nucleus.NuclearEquation(Map.of(Th231, 1f), 0f, 0f), + 1000f * Day + ); + + // Pu-239 with prompt + delayed neutrons + public static Nucleus Pu239 = new Nucleus(239, 94, + Couple.create(10f, 742f), + () -> new Nucleus.NuclearEquation( + Map.ofEntries( + entry(Ba141, 0.06f), // Ba-141 + entry(Kr92, 0.06f), // Kr-92 + entry(Xe135, 0.03f), // Xe-135 + entry(Cs137, 0.03f), // Cs-137 + entry(Sr90, 0.03f), // Sr-90 + entry(Sm149, 0.008f), // Sm-149 + entry(Zr92, 0.02f), // Zr-92 + entry(Nd144, 0.01f), // Nd-144 + entry(DN1, 0.000105f), // DN1 + entry(DN2, 0.000924f), // DN2 + entry(DN3, 0.001274f), // DN3 + entry(DN4, 0.000568f), // DN4 + entry(DN5, 0.000748f), // DN5 + entry(DN6, 0.000273f) // DN6 + ), + 2.9f, // prompt neutrons only + 20.07f * 1e12f + ), + () -> new Nucleus.NuclearEquation(Map.of(U235, 1f), 0f, 0f), 100f * Day ); + static { + Kr92 = new Nucleus(92, 92, 36, () ->Nucleus.NuclearEquation.EMPTY, 1.841f * 20f); + } + // Np237, similar to U235 and Pu239 + public static Nucleus Np237 = new Nucleus(237, 93, + Couple.create(280f, 0.001f), + () -> new Nucleus.NuclearEquation( + Map.ofEntries( + entry(Ba141, 0.06f), // Ba-141 + entry(Kr92, 0.06f), // Kr-92 + entry(Xe135, 0.03f), // Xe-135 + entry(Cs137, 0.03f), // Cs-137 + entry(Sr90, 0.03f), // Sr-90 + entry(Sm149, 0.008f), // Sm-149 + entry(Zr92, 0.02f), // Zr-92 + entry(Nd144, 0.01f), // Nd-144 + entry(DN1, 0.000105f), // DN1 + entry(DN2, 0.000924f), // DN2 + entry(DN3, 0.001274f), // DN3 + entry(DN4, 0.000568f), // DN4 + entry(DN5, 0.000748f), // DN5 + entry(DN6, 0.000273f) // DN6 + ), + 2.39f, // prompt neutrons only + 19.54f * 1e12f + ), + () -> Nucleus.NuclearEquation.EMPTY, + 800f * Day + ); + + static { + U236 = new Nucleus(236, 92, + () -> new Nucleus.NuclearEquation(Map.of(Kr92, 1f, Ba141, 1f), 3, 0f), 1); + + U238 = new Nucleus(238, 92, Couple.create(108f, 2.7f), + () -> new Nucleus.NuclearEquation(Map.of(U239, 0.1f), 0, 0f), + () -> new Nucleus.NuclearEquation(Map.of(Th234, 1f), 0, 0f), 1000f * Day); + + U239 = new Nucleus(239, 92, + () -> new Nucleus.NuclearEquation(Map.of(Np239, 1f), 0, 0f), 1692f); + + Np239 = new Nucleus(239, 93, + () -> new Nucleus.NuclearEquation(Map.of(U239, 1f), 0, 0f), Day); + } + public static Nucleus Am241Be = new Nucleus(241, 95, () -> new Nucleus.NuclearEquation(Map.of(Np237, 1f), 10f, 8.88e-13f), 100f * Day); // Exagerated for noticable effect - Nucleus U236 = new Nucleus(236, 92, - new Nucleus.NuclearEquation(Map.of(92,1f,141, 1f), 3, 0f), 1); - Nucleus U238 = new Nucleus(238, 92, Couple.create(0.3f,0.0001f), - new Nucleus.NuclearEquation(Map.of(236, 0.1f), 0, 0f), - new Nucleus.NuclearEquation(Map.of(234, 1f), 0, 0f), 100f * Day); + public static Nucleus Ba146 = new Nucleus(146, 56, () -> Nucleus.NuclearEquation.EMPTY, 2.16f * 20); } \ No newline at end of file diff --git a/src/main/template/META-INF/neoforge.mods.toml b/src/main/templates/META-INF/neoforge.mods.toml similarity index 100% rename from src/main/template/META-INF/neoforge.mods.toml rename to src/main/templates/META-INF/neoforge.mods.toml