Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CREDITS.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Developers
RealAntEngineers, purpl3xity
RealAntEngineers, purpl3xity, rgjava

# Translators
9m113konkurs, RealAntEngineers
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rae/crowns/content/event/DataEvents.java
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions src/main/java/com/rae/crowns/content/ponder/NuclearScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
}
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/rae/crowns/init/misc/CommandsInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ private static int dumpStatus(CommandContext<CommandSourceStack> 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" +
Expand Down
184 changes: 134 additions & 50 deletions src/main/java/com/rae/crowns/init/misc/NucleusInit.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);


}
Loading