add parts of the fission reactor

This commit is contained in:
maggi373 committed 2026-09-24 20:33:50 +02:00
1 parent d41f5461bc
commit c0c7fbebb3
45 files changed
+1730

No files matched your search

@@ -31,6 +31,12 @@ public class NuclearClientProxy extends NuclearCommonProxy {
registerBlockItem(NuclearBlocks.RadioactiveWasteBarrel);
registerBlockItem(NuclearBlocks.UraniumOre);
registerBlockItem(NuclearBlocks.FluoriteOre);
registerBlockItem(NuclearBlocks.FissionReactorCasing);
registerBlockItem(NuclearBlocks.ReactorGlass);
registerBlockItem(NuclearBlocks.FissionReactorPort);
registerBlockItem(NuclearBlocks.FissionReactorLogicAdapter);
registerBlockItem(NuclearBlocks.FissionFuelAssembly);
registerBlockItem(NuclearBlocks.ControlRodAssembly);
}
private static void registerBlockItem(net.minecraft.block.Block block) {
@@ -7,6 +7,7 @@ import mekanism.common.base.IModule;
import mekanism.common.config.MekanismConfig;
import mekanism.nuclear.common.config.NuclearWorldGenConfig;
import mekanism.nuclear.common.config.NuclearRadiationConfig;
import mekanism.nuclear.common.content.fission.FissionReactorFormationManager;
import mekanism.nuclear.common.recipe.NuclearLegacyRecipeRegistry;
import mekanism.nuclear.common.recipe.NuclearRecipeRegistry;
import mekanism.nuclear.common.radiation.RadiationCapabilities;
@@ -25,6 +26,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.network.NetworkRegistry;
import net.minecraftforge.fml.common.network.simpleimpl.SimpleNetworkWrapper;
import net.minecraftforge.fml.common.registry.GameRegistry;
import net.minecraftforge.common.MinecraftForge;
/**
* Entry point for the separately packaged Nuclear module.
@@ -83,6 +85,7 @@ public final class MekanismNuclear implements IModule {
NuclearLegacyRecipeRegistry.register();
NetworkRegistry.INSTANCE.registerGuiHandler(this, new NuclearGuiHandler());
proxy.registerTileEntities();
MinecraftForge.EVENT_BUS.register(FissionReactorFormationManager.INSTANCE);
GameRegistry.registerWorldGenerator(NuclearWorldGenerator.INSTANCE, 2);
Mekanism.logger.info("Loaded Mekanism Nuclear module.");
}
@@ -1,8 +1,11 @@
package mekanism.nuclear.common;
import mekanism.nuclear.common.block.BlockIsotopicCentrifuge;
import mekanism.nuclear.common.block.BlockFissionReactorComponent;
import mekanism.nuclear.common.block.BlockFissionReactorPort;
import mekanism.nuclear.common.block.BlockNuclearOre;
import mekanism.nuclear.common.block.BlockRadioactiveWasteBarrel;
import mekanism.nuclear.common.content.fission.FissionReactorComponent;
import net.minecraft.block.Block;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
@@ -17,6 +20,12 @@ public final class NuclearBlocks {
public static final Block RadioactiveWasteBarrel = new BlockRadioactiveWasteBarrel();
public static final BlockNuclearOre UraniumOre = new BlockNuclearOre(NuclearOreType.URANIUM);
public static final BlockNuclearOre FluoriteOre = new BlockNuclearOre(NuclearOreType.FLUORITE);
public static final Block FissionReactorCasing = new BlockFissionReactorComponent(FissionReactorComponent.CASING);
public static final Block ReactorGlass = new BlockFissionReactorComponent(FissionReactorComponent.GLASS);
public static final Block FissionReactorPort = new BlockFissionReactorPort();
public static final Block FissionReactorLogicAdapter = new BlockFissionReactorComponent(FissionReactorComponent.LOGIC_ADAPTER);
public static final Block FissionFuelAssembly = new BlockFissionReactorComponent(FissionReactorComponent.FUEL_ASSEMBLY);
public static final Block ControlRodAssembly = new BlockFissionReactorComponent(FissionReactorComponent.CONTROL_ROD);
private NuclearBlocks() {
}
@@ -30,6 +39,18 @@ public final class NuclearBlocks {
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "uranium_ore")));
registry.register(FluoriteOre.setTranslationKey("FluoriteOre")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "fluorite_ore")));
registry.register(FissionReactorCasing.setTranslationKey("FissionReactorCasing")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "fission_reactor_casing")));
registry.register(ReactorGlass.setTranslationKey("ReactorGlass")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "reactor_glass")));
registry.register(FissionReactorPort.setTranslationKey("FissionReactorPort")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "fission_reactor_port")));
registry.register(FissionReactorLogicAdapter.setTranslationKey("FissionReactorLogicAdapter")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "fission_reactor_logic_adapter")));
registry.register(FissionFuelAssembly.setTranslationKey("FissionFuelAssembly")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "fission_fuel_assembly")));
registry.register(ControlRodAssembly.setTranslationKey("ControlRodAssembly")
.setRegistryName(new ResourceLocation(MekanismNuclear.MODID, "control_rod_assembly")));
}
public static void registerItemBlocks(IForgeRegistry<Item> registry) {
@@ -41,6 +62,16 @@ public final class NuclearBlocks {
fluoriteOre.setRegistryName(FluoriteOre.getRegistryName());
registry.register(uraniumOre);
registry.register(fluoriteOre);
registerItemBlock(registry, FissionReactorCasing);
registerItemBlock(registry, ReactorGlass);
registerItemBlock(registry, FissionReactorPort);
registerItemBlock(registry, FissionReactorLogicAdapter);
registerItemBlock(registry, FissionFuelAssembly);
registerItemBlock(registry, ControlRodAssembly);
NuclearOreDictionary.registerOreBlocks(uraniumOre, fluoriteOre);
}
private static void registerItemBlock(IForgeRegistry<Item> registry, Block block) {
registry.register(new ItemBlock(block).setRegistryName(block.getRegistryName()));
}
}
@@ -5,6 +5,7 @@ import mekanism.nuclear.common.inventory.ContainerIsotopicCentrifuge;
import mekanism.nuclear.common.network.PacketRadiationData;
import mekanism.nuclear.common.tile.TileEntityIsotopicCentrifuge;
import mekanism.nuclear.common.tile.TileEntityRadioactiveWasteBarrel;
import mekanism.nuclear.common.tile.TileEntityFissionReactorPort;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.tileentity.TileEntity;
@@ -35,6 +36,8 @@ public class NuclearCommonProxy implements IGuiProvider {
new ResourceLocation(MekanismNuclear.MODID, "isotopic_centrifuge"));
GameRegistry.registerTileEntity(TileEntityRadioactiveWasteBarrel.class,
new ResourceLocation(MekanismNuclear.MODID, "radioactive_waste_barrel"));
GameRegistry.registerTileEntity(TileEntityFissionReactorPort.class,
new ResourceLocation(MekanismNuclear.MODID, "fission_reactor_port"));
}
@Override
@@ -0,0 +1,55 @@
package mekanism.nuclear.common.block;
import javax.annotation.Nonnull;
import mekanism.common.Mekanism;
import mekanism.nuclear.common.content.fission.FissionReactorComponent;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.util.BlockRenderLayer;
/** Plain exterior/interior reactor parts that do not own reactor state. */
public class BlockFissionReactorComponent extends Block {
private final FissionReactorComponent component;
public BlockFissionReactorComponent(FissionReactorComponent component) {
super(component == FissionReactorComponent.GLASS ? Material.GLASS : Material.IRON);
this.component = component;
setHardness(component == FissionReactorComponent.GLASS ? 3F : 3.5F);
setResistance(component == FissionReactorComponent.GLASS ? 12F : 16F);
setSoundType(component == FissionReactorComponent.GLASS ? SoundType.GLASS : SoundType.METAL);
setHarvestLevel("pickaxe", 2);
setCreativeTab(Mekanism.tabMekanism);
if (component == FissionReactorComponent.GLASS) {
setLightOpacity(0);
}
}
public FissionReactorComponent getComponent() {
return component;
}
@Nonnull
@Override
public BlockRenderLayer getRenderLayer() {
return component == FissionReactorComponent.GLASS ? BlockRenderLayer.TRANSLUCENT : BlockRenderLayer.SOLID;
}
@Override
@Deprecated
public boolean isOpaqueCube(IBlockState state) {
return component != FissionReactorComponent.GLASS
&& component != FissionReactorComponent.FUEL_ASSEMBLY
&& component != FissionReactorComponent.CONTROL_ROD;
}
@Override
@Deprecated
public boolean isFullCube(IBlockState state) {
return component != FissionReactorComponent.GLASS
&& component != FissionReactorComponent.FUEL_ASSEMBLY
&& component != FissionReactorComponent.CONTROL_ROD;
}
}
@@ -0,0 +1,80 @@
package mekanism.nuclear.common.block;
import javax.annotation.Nonnull;
import mekanism.common.Mekanism;
import mekanism.common.block.BlockMekanismContainer;
import mekanism.nuclear.common.NuclearBlocks;
import mekanism.nuclear.common.content.fission.FissionReactorValidator;
import mekanism.nuclear.common.tile.TileEntityFissionReactorPort;
import net.minecraft.block.Block;
import net.minecraft.block.SoundType;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentTranslation;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
/** Formation entry point and persisted controller node for a fission reactor. */
public class BlockFissionReactorPort extends BlockMekanismContainer {
public BlockFissionReactorPort() {
super(Material.IRON);
setHardness(3.5F);
setResistance(16F);
setSoundType(SoundType.METAL);
setHarvestLevel("pickaxe", 2);
setCreativeTab(Mekanism.tabMekanism);
}
@Override
public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player,
EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ) {
if (world.isRemote) {
return true;
}
TileEntity tile = world.getTileEntity(pos);
if (!(tile instanceof TileEntityFissionReactorPort)) {
return false;
}
FissionReactorValidator.Result result = ((TileEntityFissionReactorPort) tile).validateStructure();
if (result.isFormed()) {
player.sendMessage(new TextComponentTranslation("fission.mekanismnuclear.formed",
result.getWidth(), result.getHeight(), result.getLength(), result.getFuelAssemblies()));
} else if (result.getFailurePos() == null) {
player.sendMessage(new TextComponentTranslation(result.getFailure().getTranslationKey()));
} else {
BlockPos failure = result.getFailurePos();
player.sendMessage(new TextComponentTranslation(result.getFailure().getTranslationKey(),
"(" + failure.getX() + ", " + failure.getY() + ", " + failure.getZ() + ")"));
}
return true;
}
@Override
@Deprecated
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos) {
if (!world.isRemote) {
TileEntity tile = world.getTileEntity(pos);
if (tile instanceof TileEntityFissionReactorPort) {
((TileEntityFissionReactorPort) tile).queueValidation();
}
}
}
@Override
public TileEntity createNewTileEntity(@Nonnull World world, int meta) {
return new TileEntityFissionReactorPort();
}
@Nonnull
@Override
protected ItemStack getDropItem(@Nonnull IBlockState state, @Nonnull IBlockAccess world, @Nonnull BlockPos pos) {
return new ItemStack(NuclearBlocks.FissionReactorPort);
}
}
@@ -0,0 +1,43 @@
package mekanism.nuclear.common.content.fission;
import mekanism.nuclear.common.NuclearBlocks;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.block.state.IBlockState;
/** Block roles understood by the 1.12 fission reactor validator. */
public enum FissionReactorComponent {
AIR,
CASING,
GLASS,
PORT,
LOGIC_ADAPTER,
FUEL_ASSEMBLY,
CONTROL_ROD,
INVALID;
public boolean isExterior() {
return this == CASING || this == GLASS || this == PORT || this == LOGIC_ADAPTER;
}
public static FissionReactorComponent fromState(IBlockState state) {
if (state == null || state.getMaterial() == Material.AIR) {
return AIR;
}
Block block = state.getBlock();
if (block == NuclearBlocks.FissionReactorCasing) {
return CASING;
} else if (block == NuclearBlocks.ReactorGlass) {
return GLASS;
} else if (block == NuclearBlocks.FissionReactorPort) {
return PORT;
} else if (block == NuclearBlocks.FissionReactorLogicAdapter) {
return LOGIC_ADAPTER;
} else if (block == NuclearBlocks.FissionFuelAssembly) {
return FUEL_ASSEMBLY;
} else if (block == NuclearBlocks.ControlRodAssembly) {
return CONTROL_ROD;
}
return INVALID;
}
}
@@ -0,0 +1,67 @@
package mekanism.nuclear.common.content.fission;
import java.util.ArrayList;
import java.util.Collections;
import java.util.IdentityHashMap;
import java.util.Set;
import mekanism.nuclear.common.tile.TileEntityFissionReactorPort;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
import net.minecraftforge.event.world.BlockEvent;
import net.minecraftforge.event.world.ChunkEvent;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
/** Defers structural revalidation until a relevant block actually changes. */
public final class FissionReactorFormationManager {
public static final FissionReactorFormationManager INSTANCE = new FissionReactorFormationManager();
private final Set<TileEntityFissionReactorPort> loadedPorts = Collections.newSetFromMap(new IdentityHashMap<>());
private FissionReactorFormationManager() {
}
public void register(TileEntityFissionReactorPort port) {
loadedPorts.add(port);
}
public void unregister(TileEntityFissionReactorPort port) {
loadedPorts.remove(port);
}
@SubscribeEvent
public void onBlockPlaced(BlockEvent.PlaceEvent event) {
structureChanged(event.getWorld(), event.getPos());
}
@SubscribeEvent
public void onBlockBroken(BlockEvent.BreakEvent event) {
structureChanged(event.getWorld(), event.getPos());
}
@SubscribeEvent
public void onChunkLoaded(ChunkEvent.Load event) {
World world = event.getWorld();
if (world.isRemote) {
return;
}
int chunkX = event.getChunk().x;
int chunkZ = event.getChunk().z;
for (TileEntityFissionReactorPort port : new ArrayList<>(loadedPorts)) {
if (!port.isInvalid() && port.getWorld() == world && port.watchesChunk(chunkX, chunkZ)) {
port.queueValidation();
}
}
}
private void structureChanged(World world, BlockPos pos) {
if (world.isRemote) {
return;
}
for (TileEntityFissionReactorPort port : new ArrayList<>(loadedPorts)) {
if (!port.isInvalid() && port.getWorld() == world && port.watches(pos)) {
port.queueValidation();
}
}
}
}
@@ -0,0 +1,240 @@
package mekanism.nuclear.common.content.fission;
import javax.annotation.Nullable;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.math.BlockPos;
/** Persisted controller state shared by the first fission-reactor slice. */
public final class FissionReactorState {
private static final int DATA_VERSION = 1;
private boolean formed;
private BlockPos min;
private BlockPos max;
private int volume;
private int fuelAssemblies;
private int controlRods;
private int surfaceArea;
private long fissileFuel;
private long coolant;
private long heatedCoolant;
private long nuclearWaste;
private CoolantType coolantType = CoolantType.NONE;
private double heat;
private double damage;
private double burnRate;
private boolean active;
public void applyStructure(FissionReactorValidator.Result result) {
if (!result.isFormed()) {
throw new IllegalArgumentException("Cannot apply an invalid fission reactor structure");
}
formed = true;
min = result.getMin();
max = result.getMax();
volume = result.getVolume();
fuelAssemblies = result.getFuelAssemblies();
controlRods = result.getControlRods();
surfaceArea = result.getSurfaceArea();
}
public void setUnformed() {
formed = false;
active = false;
}
public boolean isFormed() {
return formed;
}
public boolean hasBounds() {
return min != null && max != null;
}
public boolean watches(BlockPos pos) {
return hasBounds() && pos.getX() >= min.getX() - 1 && pos.getX() <= max.getX() + 1
&& pos.getY() >= min.getY() - 1 && pos.getY() <= max.getY() + 1
&& pos.getZ() >= min.getZ() - 1 && pos.getZ() <= max.getZ() + 1;
}
public boolean watchesChunk(int chunkX, int chunkZ) {
return hasBounds() && chunkX >= (min.getX() >> 4) && chunkX <= (max.getX() >> 4)
&& chunkZ >= (min.getZ() >> 4) && chunkZ <= (max.getZ() >> 4);
}
@Nullable
public BlockPos getMin() {
return min;
}
@Nullable
public BlockPos getMax() {
return max;
}
public int getVolume() {
return volume;
}
public int getFuelAssemblies() {
return fuelAssemblies;
}
public int getControlRods() {
return controlRods;
}
public int getSurfaceArea() {
return surfaceArea;
}
public long getFissileFuel() {
return fissileFuel;
}
public void setFissileFuel(long fissileFuel) {
this.fissileFuel = nonNegative(fissileFuel);
}
public long getCoolant() {
return coolant;
}
public void setCoolant(long coolant) {
this.coolant = nonNegative(coolant);
}
public long getHeatedCoolant() {
return heatedCoolant;
}
public void setHeatedCoolant(long heatedCoolant) {
this.heatedCoolant = nonNegative(heatedCoolant);
}
public long getNuclearWaste() {
return nuclearWaste;
}
public void setNuclearWaste(long nuclearWaste) {
this.nuclearWaste = nonNegative(nuclearWaste);
}
public CoolantType getCoolantType() {
return coolantType;
}
public void setCoolantType(@Nullable CoolantType coolantType) {
this.coolantType = coolantType == null ? CoolantType.NONE : coolantType;
}
public double getHeat() {
return heat;
}
public void setHeat(double heat) {
this.heat = finiteNonNegative(heat);
}
public double getDamage() {
return damage;
}
public void setDamage(double damage) {
this.damage = finiteNonNegative(damage);
}
public double getBurnRate() {
return burnRate;
}
public void setBurnRate(double burnRate) {
this.burnRate = finiteNonNegative(burnRate);
}
public boolean isActive() {
return active;
}
public void setActive(boolean active) {
this.active = active && formed;
}
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
tag.setInteger("Version", DATA_VERSION);
tag.setBoolean("Formed", formed);
if (hasBounds()) {
tag.setTag("Min", writePos(min));
tag.setTag("Max", writePos(max));
}
tag.setInteger("Volume", volume);
tag.setInteger("FuelAssemblies", fuelAssemblies);
tag.setInteger("ControlRods", controlRods);
tag.setInteger("SurfaceArea", surfaceArea);
tag.setLong("FissileFuel", fissileFuel);
tag.setLong("Coolant", coolant);
tag.setLong("HeatedCoolant", heatedCoolant);
tag.setLong("NuclearWaste", nuclearWaste);
tag.setString("CoolantType", coolantType.name());
tag.setDouble("Heat", heat);
tag.setDouble("Damage", damage);
tag.setDouble("BurnRate", burnRate);
tag.setBoolean("Active", active);
return tag;
}
public void readFromNBT(NBTTagCompound tag) {
min = tag.hasKey("Min", 10) ? readPos(tag.getCompoundTag("Min")) : null;
max = tag.hasKey("Max", 10) ? readPos(tag.getCompoundTag("Max")) : null;
formed = tag.getBoolean("Formed") && hasBounds();
volume = nonNegative(tag.getInteger("Volume"));
fuelAssemblies = nonNegative(tag.getInteger("FuelAssemblies"));
controlRods = nonNegative(tag.getInteger("ControlRods"));
surfaceArea = nonNegative(tag.getInteger("SurfaceArea"));
fissileFuel = nonNegative(tag.getLong("FissileFuel"));
coolant = nonNegative(tag.getLong("Coolant"));
heatedCoolant = nonNegative(tag.getLong("HeatedCoolant"));
nuclearWaste = nonNegative(tag.getLong("NuclearWaste"));
try {
coolantType = CoolantType.valueOf(tag.getString("CoolantType"));
} catch (IllegalArgumentException ignored) {
coolantType = CoolantType.NONE;
}
heat = finiteNonNegative(tag.getDouble("Heat"));
damage = finiteNonNegative(tag.getDouble("Damage"));
burnRate = finiteNonNegative(tag.getDouble("BurnRate"));
active = formed && tag.getBoolean("Active");
}
private static NBTTagCompound writePos(BlockPos pos) {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("X", pos.getX());
tag.setInteger("Y", pos.getY());
tag.setInteger("Z", pos.getZ());
return tag;
}
private static BlockPos readPos(NBTTagCompound tag) {
return new BlockPos(tag.getInteger("X"), tag.getInteger("Y"), tag.getInteger("Z"));
}
private static int nonNegative(int value) {
return Math.max(0, value);
}
private static long nonNegative(long value) {
return Math.max(0, value);
}
private static double finiteNonNegative(double value) {
return Double.isFinite(value) ? Math.max(0, value) : 0;
}
public enum CoolantType {
NONE,
WATER,
SODIUM
}
}
@@ -0,0 +1,392 @@
package mekanism.nuclear.common.content.fission;
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Queue;
import java.util.Set;
import java.util.TreeMap;
import javax.annotation.Nullable;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.World;
/**
* Old-version-native cuboid validator implementing the stable fission reactor
* structure contract without pulling the modern multiblock framework into 1.12.
*/
public final class FissionReactorValidator {
public static final int MIN_SIZE = 3;
public static final int MAX_SIZE = 18;
private static final int MAX_COMPONENTS = MAX_SIZE * MAX_SIZE * MAX_SIZE;
private FissionReactorValidator() {
}
public static Result validate(World world, BlockPos port) {
return validate(port, pos -> world.isBlockLoaded(pos)
? FissionReactorComponent.fromState(world.getBlockState(pos))
: FissionReactorComponent.INVALID);
}
public static Result validate(BlockPos port, ComponentLookup lookup) {
if (lookup.get(port) != FissionReactorComponent.PORT) {
return Result.failure(Failure.NOT_PORT, port);
}
Bounds bounds = discoverBounds(port, lookup);
if (bounds.tooLarge) {
return Result.failure(Failure.TOO_LARGE, bounds.failurePos);
}
int width = bounds.maxX - bounds.minX + 1;
int height = bounds.maxY - bounds.minY + 1;
int length = bounds.maxZ - bounds.minZ + 1;
if (!validDimension(width) || !validDimension(height) || !validDimension(length)) {
return Result.failure(Failure.INVALID_SIZE, port);
}
Set<BlockPos> ports = new HashSet<>();
Set<BlockPos> fuelPositions = new HashSet<>();
Map<ColumnPos, AssemblyColumn> columns = new HashMap<>();
for (int x = bounds.minX; x <= bounds.maxX; x++) {
for (int y = bounds.minY; y <= bounds.maxY; y++) {
for (int z = bounds.minZ; z <= bounds.maxZ; z++) {
BlockPos pos = new BlockPos(x, y, z);
FissionReactorComponent component = lookup.get(pos);
int wallCount = boundaryCount(pos, bounds);
if (wallCount >= 2) {
if (component != FissionReactorComponent.CASING) {
return Result.failure(Failure.INVALID_FRAME, pos);
}
} else if (wallCount == 1) {
if (!component.isExterior()) {
return Result.failure(Failure.INVALID_FACE, pos);
}
if (component == FissionReactorComponent.PORT) {
ports.add(pos);
}
} else if (component == FissionReactorComponent.FUEL_ASSEMBLY
|| component == FissionReactorComponent.CONTROL_ROD) {
ColumnPos columnPos = new ColumnPos(x, z);
AssemblyColumn column = columns.computeIfAbsent(columnPos, ignored -> new AssemblyColumn());
if (component == FissionReactorComponent.FUEL_ASSEMBLY) {
column.fuel.put(y, pos);
fuelPositions.add(pos);
} else if (column.controlRod != null) {
return Result.failure(Failure.EXTRA_CONTROL_ROD, pos);
} else {
column.controlRod = pos;
}
} else if (component != FissionReactorComponent.AIR) {
return Result.failure(Failure.INVALID_INNER, pos);
}
}
}
}
if (columns.isEmpty()) {
return Result.failure(Failure.MISSING_FUEL_ASSEMBLY, null);
}
int controlRods = 0;
for (AssemblyColumn column : columns.values()) {
if (column.controlRod == null) {
BlockPos first = column.fuel.isEmpty() ? null : column.fuel.firstEntry().getValue();
return Result.failure(Failure.MISSING_CONTROL_ROD, first);
}
controlRods++;
if (column.fuel.isEmpty()) {
return Result.failure(Failure.BAD_FUEL_ASSEMBLY, column.controlRod);
}
int previousY = Integer.MIN_VALUE;
for (Map.Entry<Integer, BlockPos> entry : column.fuel.entrySet()) {
if (previousY != Integer.MIN_VALUE && entry.getKey() != previousY + 1) {
return Result.failure(Failure.MALFORMED_FUEL_ASSEMBLY, entry.getValue());
}
previousY = entry.getKey();
}
if (column.controlRod.getY() != previousY + 1) {
return Result.failure(Failure.BAD_CONTROL_ROD, column.controlRod);
}
}
int surfaceArea = fuelPositions.size() * 6;
for (BlockPos fuel : fuelPositions) {
for (EnumFacing side : EnumFacing.VALUES) {
if (fuelPositions.contains(fuel.offset(side))) {
surfaceArea--;
}
}
}
List<BlockPos> sortedPorts = new ArrayList<>(ports);
sortedPorts.sort(POSITION_ORDER);
return Result.success(new BlockPos(bounds.minX, bounds.minY, bounds.minZ),
new BlockPos(bounds.maxX, bounds.maxY, bounds.maxZ), width, height, length,
width * height * length, fuelPositions.size(), controlRods, surfaceArea, sortedPorts);
}
private static boolean validDimension(int dimension) {
return dimension >= MIN_SIZE && dimension <= MAX_SIZE;
}
private static Bounds discoverBounds(BlockPos start, ComponentLookup lookup) {
Queue<BlockPos> open = new ArrayDeque<>();
Set<BlockPos> found = new HashSet<>();
Bounds bounds = new Bounds(start);
open.add(start);
found.add(start);
while (!open.isEmpty()) {
BlockPos current = open.remove();
bounds.include(current);
if (bounds.width() > MAX_SIZE || bounds.height() > MAX_SIZE || bounds.length() > MAX_SIZE
|| found.size() > MAX_COMPONENTS) {
bounds.tooLarge = true;
bounds.failurePos = current;
return bounds;
}
for (EnumFacing side : EnumFacing.VALUES) {
BlockPos adjacent = current.offset(side);
if (!found.contains(adjacent) && lookup.get(adjacent).isExterior()) {
found.add(adjacent);
open.add(adjacent);
}
}
}
return bounds;
}
private static int boundaryCount(BlockPos pos, Bounds bounds) {
int count = 0;
if (pos.getX() == bounds.minX || pos.getX() == bounds.maxX) {
count++;
}
if (pos.getY() == bounds.minY || pos.getY() == bounds.maxY) {
count++;
}
if (pos.getZ() == bounds.minZ || pos.getZ() == bounds.maxZ) {
count++;
}
return count;
}
private static final Comparator<BlockPos> POSITION_ORDER = (first, second) -> {
int x = Integer.compare(first.getX(), second.getX());
if (x != 0) {
return x;
}
int y = Integer.compare(first.getY(), second.getY());
return y != 0 ? y : Integer.compare(first.getZ(), second.getZ());
};
@FunctionalInterface
public interface ComponentLookup {
FissionReactorComponent get(BlockPos pos);
}
public enum Failure {
NONE(""),
NOT_PORT("fission.mekanismnuclear.invalid_not_port"),
TOO_LARGE("fission.mekanismnuclear.invalid_too_large"),
INVALID_SIZE("fission.mekanismnuclear.invalid_size"),
INVALID_FRAME("fission.mekanismnuclear.invalid_frame"),
INVALID_FACE("fission.mekanismnuclear.invalid_face"),
INVALID_INNER("fission.mekanismnuclear.invalid_inner"),
MISSING_FUEL_ASSEMBLY("fission.mekanismnuclear.invalid_missing_fuel_assembly"),
EXTRA_CONTROL_ROD("fission.mekanismnuclear.invalid_extra_control_rod"),
BAD_FUEL_ASSEMBLY("fission.mekanismnuclear.invalid_bad_fuel_assembly"),
MALFORMED_FUEL_ASSEMBLY("fission.mekanismnuclear.invalid_malformed_fuel_assembly"),
MISSING_CONTROL_ROD("fission.mekanismnuclear.invalid_missing_control_rod"),
BAD_CONTROL_ROD("fission.mekanismnuclear.invalid_bad_control_rod");
private final String translationKey;
Failure(String translationKey) {
this.translationKey = translationKey;
}
public String getTranslationKey() {
return translationKey;
}
}
public static final class Result {
private final boolean formed;
private final Failure failure;
private final BlockPos failurePos;
private final BlockPos min;
private final BlockPos max;
private final int width;
private final int height;
private final int length;
private final int volume;
private final int fuelAssemblies;
private final int controlRods;
private final int surfaceArea;
private final List<BlockPos> ports;
private Result(boolean formed, Failure failure, @Nullable BlockPos failurePos,
@Nullable BlockPos min, @Nullable BlockPos max, int width, int height, int length,
int volume, int fuelAssemblies, int controlRods, int surfaceArea, List<BlockPos> ports) {
this.formed = formed;
this.failure = failure;
this.failurePos = failurePos;
this.min = min;
this.max = max;
this.width = width;
this.height = height;
this.length = length;
this.volume = volume;
this.fuelAssemblies = fuelAssemblies;
this.controlRods = controlRods;
this.surfaceArea = surfaceArea;
this.ports = ports;
}
private static Result failure(Failure failure, @Nullable BlockPos pos) {
return new Result(false, failure, pos, null, null, 0, 0, 0, 0, 0, 0, 0,
Collections.emptyList());
}
private static Result success(BlockPos min, BlockPos max, int width, int height, int length,
int volume, int fuelAssemblies, int controlRods, int surfaceArea, List<BlockPos> ports) {
return new Result(true, Failure.NONE, null, min, max, width, height, length, volume,
fuelAssemblies, controlRods, surfaceArea, Collections.unmodifiableList(ports));
}
public boolean isFormed() {
return formed;
}
public Failure getFailure() {
return failure;
}
@Nullable
public BlockPos getFailurePos() {
return failurePos;
}
@Nullable
public BlockPos getMin() {
return min;
}
@Nullable
public BlockPos getMax() {
return max;
}
public int getWidth() {
return width;
}
public int getHeight() {
return height;
}
public int getLength() {
return length;
}
public int getVolume() {
return volume;
}
public int getFuelAssemblies() {
return fuelAssemblies;
}
public int getControlRods() {
return controlRods;
}
public int getSurfaceArea() {
return surfaceArea;
}
public List<BlockPos> getPorts() {
return ports;
}
}
private static final class Bounds {
private int minX;
private int minY;
private int minZ;
private int maxX;
private int maxY;
private int maxZ;
private boolean tooLarge;
private BlockPos failurePos;
private Bounds(BlockPos start) {
minX = maxX = start.getX();
minY = maxY = start.getY();
minZ = maxZ = start.getZ();
}
private void include(BlockPos pos) {
minX = Math.min(minX, pos.getX());
minY = Math.min(minY, pos.getY());
minZ = Math.min(minZ, pos.getZ());
maxX = Math.max(maxX, pos.getX());
maxY = Math.max(maxY, pos.getY());
maxZ = Math.max(maxZ, pos.getZ());
}
private int width() {
return maxX - minX + 1;
}
private int height() {
return maxY - minY + 1;
}
private int length() {
return maxZ - minZ + 1;
}
}
private static final class ColumnPos {
private final int x;
private final int z;
private ColumnPos(int x, int z) {
this.x = x;
this.z = z;
}
@Override
public boolean equals(Object other) {
if (this == other) {
return true;
}
if (!(other instanceof ColumnPos)) {
return false;
}
ColumnPos that = (ColumnPos) other;
return x == that.x && z == that.z;
}
@Override
public int hashCode() {
return 31 * x + z;
}
}
private static final class AssemblyColumn {
private final TreeMap<Integer, BlockPos> fuel = new TreeMap<>();
private BlockPos controlRod;
}
}
@@ -0,0 +1,147 @@
package mekanism.nuclear.common.tile;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import mekanism.common.tile.prefab.TileEntityBasicBlock;
import mekanism.common.util.MekanismUtils;
import mekanism.nuclear.common.content.fission.FissionReactorFormationManager;
import mekanism.nuclear.common.content.fission.FissionReactorState;
import mekanism.nuclear.common.content.fission.FissionReactorValidator;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.math.BlockPos;
public class TileEntityFissionReactorPort extends TileEntityBasicBlock {
private static final String NBT_REACTOR = "FissionReactor";
private static final String NBT_CONTROLLER = "Controller";
private final FissionReactorState reactorState = new FissionReactorState();
private BlockPos controllerPos;
private boolean validationQueued;
@Override
public void onLoad() {
super.onLoad();
if (!world.isRemote) {
FissionReactorFormationManager.INSTANCE.register(this);
validationQueued = reactorState.hasBounds();
}
}
@Override
public void onChunkUnload() {
FissionReactorFormationManager.INSTANCE.unregister(this);
super.onChunkUnload();
}
@Override
public void invalidate() {
FissionReactorFormationManager.INSTANCE.unregister(this);
super.invalidate();
}
@Override
public void onUpdate() {
if (!world.isRemote && validationQueued) {
validationQueued = false;
validateStructure();
}
}
public FissionReactorValidator.Result validateStructure() {
FissionReactorValidator.Result result = FissionReactorValidator.validate(world, pos);
if (result.isFormed()) {
BlockPos controller = result.getPorts().get(0);
for (BlockPos portPos : result.getPorts()) {
TileEntity tile = world.getTileEntity(portPos);
if (tile instanceof TileEntityFissionReactorPort) {
((TileEntityFissionReactorPort) tile).applyStructure(result, controller);
}
}
} else {
reactorState.setUnformed();
markDirtyAndSave();
}
return result;
}
private void applyStructure(FissionReactorValidator.Result result, BlockPos controller) {
reactorState.applyStructure(result);
controllerPos = controller;
validationQueued = false;
markDirtyAndSave();
}
public void queueValidation() {
if (reactorState.hasBounds()) {
validationQueued = true;
}
}
public boolean watches(BlockPos changedPos) {
return reactorState.watches(changedPos);
}
public boolean watchesChunk(int chunkX, int chunkZ) {
return reactorState.watchesChunk(chunkX, chunkZ);
}
public FissionReactorState getReactorState() {
return reactorState;
}
@Nullable
public BlockPos getControllerPos() {
return controllerPos;
}
public boolean isController() {
return pos.equals(controllerPos);
}
@Override
public boolean canSetFacing(@Nonnull EnumFacing facing) {
return false;
}
private void markDirtyAndSave() {
markDirty();
if (world != null && !world.isRemote) {
MekanismUtils.saveChunk(this);
}
}
@Override
public void readFromNBT(NBTTagCompound tag) {
super.readFromNBT(tag);
if (tag.hasKey(NBT_REACTOR, 10)) {
reactorState.readFromNBT(tag.getCompoundTag(NBT_REACTOR));
}
controllerPos = tag.hasKey(NBT_CONTROLLER, 10) ? readPos(tag.getCompoundTag(NBT_CONTROLLER)) : null;
}
@Nonnull
@Override
public NBTTagCompound writeToNBT(NBTTagCompound tag) {
super.writeToNBT(tag);
tag.setTag(NBT_REACTOR, reactorState.writeToNBT(new NBTTagCompound()));
if (controllerPos != null) {
tag.setTag(NBT_CONTROLLER, writePos(controllerPos));
}
return tag;
}
private static NBTTagCompound writePos(BlockPos pos) {
NBTTagCompound tag = new NBTTagCompound();
tag.setInteger("X", pos.getX());
tag.setInteger("Y", pos.getY());
tag.setInteger("Z", pos.getZ());
return tag;
}
private static BlockPos readPos(NBTTagCompound tag) {
return new BlockPos(tag.getInteger("X"), tag.getInteger("Y"), tag.getInteger("Z"));
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/control_rod_assembly" },
"inventory": { "model": "mekanismnuclear:fission/control_rod_assembly" }
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/fuel_assembly" },
"inventory": { "model": "mekanismnuclear:fission/fuel_assembly" }
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/casing" },
"inventory": { "model": "mekanismnuclear:fission/casing" }
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/logic_adapter" },
"inventory": { "model": "mekanismnuclear:fission/logic_adapter" }
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/port_input" },
"inventory": { "model": "mekanismnuclear:fission/port_input" }
}
}
@@ -0,0 +1,6 @@
{
"variants": {
"normal": { "model": "mekanismnuclear:fission/reactor_glass" },
"inventory": { "model": "mekanismnuclear:fission/reactor_glass" }
}
}
@@ -2,6 +2,12 @@ tile.IsotopicCentrifuge.name=Isotopic Centrifuge
tile.RadioactiveWasteBarrel.name=Radioactive Waste Barrel
tile.UraniumOre.name=Uranium Ore
tile.FluoriteOre.name=Fluorite Ore
tile.FissionReactorCasing.name=Fission Reactor Casing
tile.ReactorGlass.name=Reactor Glass
tile.FissionReactorPort.name=Fission Reactor Port
tile.FissionReactorLogicAdapter.name=Fission Reactor Logic Adapter
tile.FissionFuelAssembly.name=Fission Fuel Assembly
tile.ControlRodAssembly.name=Control Rod Assembly
item.UraniumIngot.name=Uranium Ingot
item.UraniumDust.name=Uranium Dust
item.FluoriteGem.name=Fluorite
@@ -38,3 +44,16 @@ message.mekanismnuclear.radiation.environment=Environmental radiation: %1$s
message.mekanismnuclear.radiation.dose=%1$s's radiation dose: %2$s
message.mekanismnuclear.radiation.dose_target=%1$s's radiation dose: %2$s
message.mekanismnuclear.radiation.decay=Estimated time below hazardous levels: %1$s
fission.mekanismnuclear.formed=Fission Reactor formed: %1$s x %2$s x %3$s with %4$s fuel assemblies.
fission.mekanismnuclear.invalid_not_port=Couldn't form, the selected block is not a Fission Reactor Port at %1$s.
fission.mekanismnuclear.invalid_too_large=Couldn't form, the reactor exceeds 18 blocks on an axis near %1$s.
fission.mekanismnuclear.invalid_size=Couldn't form, reactor dimensions must each be between 3 and 18 blocks at %1$s.
fission.mekanismnuclear.invalid_frame=Couldn't form, reactor frame edges require Fission Reactor Casing at %1$s.
fission.mekanismnuclear.invalid_face=Couldn't form, invalid reactor wall block at %1$s.
fission.mekanismnuclear.invalid_inner=Couldn't form, invalid block inside the reactor at %1$s.
fission.mekanismnuclear.invalid_missing_fuel_assembly=Couldn't form, no fuel assembly structures present.
fission.mekanismnuclear.invalid_extra_control_rod=Couldn't form, found extra Control Rod Assembly at %1$s.
fission.mekanismnuclear.invalid_bad_fuel_assembly=Couldn't form, missing fuel assembly for control rod at %1$s.
fission.mekanismnuclear.invalid_malformed_fuel_assembly=Couldn't form, invalid Fission Fuel Assembly placement at %1$s.
fission.mekanismnuclear.invalid_missing_control_rod=Couldn't form, missing control rod for fuel assembly at %1$s.
fission.mekanismnuclear.invalid_bad_control_rod=Couldn't form, improper placement for Control Rod Assembly at %1$s.
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "mekanismnuclear:block/fission_reactor_casing"
}
}
@@ -0,0 +1,349 @@
{
"credit": "Model by CyanideX",
"parent": "block/cube_all",
"textures": {
"1": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_rods_top",
"5": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_side",
"6": "mekanismnuclear:block/model/fuel_assembly/control_rod_assembly_components",
"7": "mekanismnuclear:block/model/fuel_assembly/control_rod_assembly",
"particle": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_side"
},
"elements": [
{
"name": "connector_1",
"from": [4, 7, 4],
"to": [6, 15, 6],
"faces": {
"north": {"uv": [0, 0, 2, 8], "texture": "#6"},
"east": {"uv": [0, 0, 2, 8], "texture": "#6"},
"south": {"uv": [0, 0, 2, 8], "texture": "#6"},
"west": {"uv": [0, 0, 2, 8], "texture": "#6"},
"up": {"uv": [0, 11, 2, 13], "texture": "#6"}
}
},
{
"name": "connector_2",
"from": [10, 8, 4],
"to": [12, 16, 6],
"faces": {
"north": {"uv": [0, 0, 2, 8], "texture": "#6"},
"east": {"uv": [0, 0, 2, 8], "texture": "#6"},
"south": {"uv": [0, 0, 2, 8], "texture": "#6"},
"west": {"uv": [0, 0, 2, 8], "texture": "#6"},
"up": {"uv": [0, 11, 2, 13], "texture": "#6", "cullface": "up"}
}
},
{
"name": "connector_3",
"from": [10, 7, 10],
"to": [12, 15, 12],
"faces": {
"north": {"uv": [0, 0, 2, 8], "texture": "#6"},
"east": {"uv": [0, 0, 2, 8], "texture": "#6"},
"south": {"uv": [0, 0, 2, 8], "texture": "#6"},
"west": {"uv": [0, 0, 2, 8], "texture": "#6"},
"up": {"uv": [0, 11, 2, 13], "texture": "#6"}
}
},
{
"name": "connector_4",
"from": [4, 8, 10],
"to": [6, 16, 12],
"faces": {
"north": {"uv": [0, 0, 2, 8], "texture": "#6"},
"east": {"uv": [0, 0, 2, 8], "texture": "#6"},
"south": {"uv": [0, 0, 2, 8], "texture": "#6"},
"west": {"uv": [0, 0, 2, 8], "texture": "#6"},
"up": {"uv": [0, 11, 2, 13], "texture": "#6", "cullface": "up"}
}
},
{
"name": "connector_5",
"from": [7, 4, 7],
"to": [9, 12, 9],
"faces": {
"north": {"uv": [0, 0, 2, 8], "texture": "#6"},
"east": {"uv": [0, 0, 2, 8], "texture": "#6"},
"south": {"uv": [0, 0, 2, 8], "texture": "#6"},
"west": {"uv": [0, 0, 2, 8], "texture": "#6"},
"up": {"uv": [0, 11, 2, 13], "texture": "#6"}
}
},
{
"name": "rod_1",
"from": [1, 3, 1],
"to": [3, 7, 3],
"faces": {
"north": {"uv": [13, 3, 15, 7], "texture": "#5"},
"east": {"uv": [1, 3, 3, 7], "texture": "#5"},
"south": {"uv": [1, 3, 3, 7], "texture": "#5"},
"west": {"uv": [1, 3, 3, 7], "texture": "#5"}
}
},
{
"name": "rod_2",
"from": [1, 3, 5],
"to": [15, 7, 7],
"faces": {
"north": {"uv": [1, 3, 3, 7], "texture": "#5"},
"east": {"uv": [9, 3, 11, 7], "texture": "#5"},
"south": {"uv": [1, 3, 3, 7], "texture": "#5"},
"west": {"uv": [5, 3, 7, 7], "texture": "#5"}
}
},
{
"name": "rod_3",
"from": [1, 3, 9],
"to": [15, 7, 11],
"faces": {
"north": {"uv": [1, 3, 3, 7], "texture": "#5"},
"east": {"uv": [5, 3, 7, 7], "texture": "#5"},
"south": {"uv": [1, 3, 3, 7], "texture": "#5"},
"west": {"uv": [9, 3, 11, 7], "texture": "#5"}
}
},
{
"name": "rod_4",
"from": [1, 3, 13],
"to": [3, 7, 15],
"faces": {
"north": {"uv": [1, 3, 3, 7], "texture": "#5"},
"east": {"uv": [1, 3, 3, 7], "texture": "#5"},
"south": {"uv": [1, 3, 3, 7], "texture": "#5"},
"west": {"uv": [13, 3, 15, 7], "texture": "#5"}
}
},
{
"name": "rod_5",
"from": [5, 3, 1],
"to": [7, 7, 15],
"faces": {
"north": {"uv": [9, 3, 11, 7], "texture": "#5"},
"east": {"uv": [1, 3, 3, 7], "texture": "#5"},
"south": {"uv": [5, 3, 7, 7], "texture": "#5"},
"west": {"uv": [1, 3, 3, 7], "texture": "#5"}
}
},
{
"name": "rod_6",
"from": [9, 3, 1],
"to": [11, 7, 15],
"faces": {
"north": {"uv": [5, 3, 7, 7], "texture": "#5"},
"east": {"uv": [1, 3, 3, 7], "texture": "#5"},
"south": {"uv": [9, 3, 11, 7], "texture": "#5"},
"west": {"uv": [1, 3, 3, 7], "texture": "#5"}
}
},
{
"name": "rod_7",
"from": [13, 3, 13],
"to": [15, 7, 15],
"faces": {
"north": {"uv": [1, 3, 3, 7], "texture": "#5"},
"east": {"uv": [1, 3, 3, 7], "texture": "#5"},
"south": {"uv": [13, 3, 15, 7], "texture": "#5"},
"west": {"uv": [1, 3, 3, 7], "texture": "#5"}
}
},
{
"name": "rod_8",
"from": [13, 3, 1],
"to": [15, 7, 3],
"faces": {
"north": {"uv": [1, 3, 3, 7], "texture": "#5"},
"east": {"uv": [13, 3, 15, 7], "texture": "#5"},
"south": {"uv": [1, 3, 3, 7], "texture": "#5"},
"west": {"uv": [1, 3, 3, 7], "texture": "#5"}
}
},
{
"name": "core",
"from": [2, 3, 2],
"to": [14, 8, 14],
"faces": {
"north": {"uv": [2, 3, 14, 8], "texture": "#5"},
"east": {"uv": [2, 3, 14, 8], "texture": "#5"},
"south": {"uv": [2, 3, 14, 8], "texture": "#5"},
"west": {"uv": [2, 3, 14, 8], "texture": "#5"},
"up": {"uv": [2, 2, 14, 14], "texture": "#1"}
}
},
{
"name": "control_rod_frame1",
"from": [13, 9, 0],
"to": [16, 14, 3],
"faces": {
"north": {"uv": [0, 5, 3, 10], "texture": "#7", "cullface": "north"},
"east": {"uv": [13, 5, 16, 10], "texture": "#7", "cullface": "east"},
"south": {"uv": [13, 5, 16, 10], "texture": "#7"},
"west": {"uv": [0, 5, 3, 10], "texture": "#7"}
}
},
{
"name": "control_rod_frame2",
"from": [13, 9, 13],
"to": [16, 14, 16],
"faces": {
"north": {"uv": [0, 5, 3, 10], "texture": "#7"},
"east": {"uv": [0, 5, 3, 10], "texture": "#7", "cullface": "east"},
"south": {"uv": [13, 5, 16, 10], "texture": "#7", "cullface": "south"},
"west": {"uv": [13, 5, 16, 10], "texture": "#7"}
}
},
{
"name": "control_rod_frame3",
"from": [0, 9, 0],
"to": [3, 14, 3],
"faces": {
"north": {"uv": [13, 5, 16, 10], "texture": "#7", "cullface": "north"},
"east": {"uv": [13, 5, 16, 10], "texture": "#7"},
"south": {"uv": [0, 5, 3, 10], "texture": "#7"},
"west": {"uv": [0, 5, 3, 10], "texture": "#7", "cullface": "west"}
}
},
{
"name": "control_rod_frame4",
"from": [0, 9, 13],
"to": [3, 14, 16],
"faces": {
"north": {"uv": [13, 5, 16, 10], "texture": "#7"},
"east": {"uv": [0, 5, 3, 10], "texture": "#7"},
"south": {"uv": [0, 5, 3, 10], "texture": "#7", "cullface": "south"},
"west": {"uv": [13, 5, 16, 10], "texture": "#7", "cullface": "west"}
}
},
{
"name": "control_rod_frame5",
"from": [0, 7, 0],
"to": [16, 9, 3],
"faces": {
"north": {"uv": [0, 10, 16, 12], "texture": "#7", "cullface": "north"},
"east": {"uv": [13, 10, 16, 12], "texture": "#7", "cullface": "east"},
"south": {"uv": [0, 13, 16, 15], "texture": "#7"},
"west": {"uv": [0, 10, 3, 12], "texture": "#7", "cullface": "west"},
"up": {"uv": [0, 16, 16, 13], "texture": "#7"},
"down": {"uv": [0, 9, 16, 12], "texture": "#7"}
}
},
{
"name": "control_rod_frame6",
"from": [0, 14, 0],
"to": [16, 16, 3],
"faces": {
"north": {"uv": [0, 3, 16, 5], "texture": "#7", "cullface": "north"},
"east": {"uv": [13, 3, 16, 5], "texture": "#7", "cullface": "east"},
"south": {"uv": [0, 3, 16, 5], "texture": "#7"},
"west": {"uv": [0, 3, 3, 5], "texture": "#7", "cullface": "west"},
"up": {"uv": [0, 3, 16, 0], "texture": "#7", "cullface": "up"},
"down": {"uv": [0, 13, 16, 16], "texture": "#7"}
}
},
{
"name": "control_rod_frame7",
"from": [0, 7, 3],
"to": [3, 9, 13],
"faces": {
"east": {"uv": [3, 13, 13, 15], "texture": "#7"},
"west": {"uv": [3, 10, 13, 12], "texture": "#7", "cullface": "west"},
"up": {"uv": [3, 16, 13, 13], "rotation": 270, "texture": "#7"},
"down": {"uv": [3, 9, 13, 12], "rotation": 90, "texture": "#7"}
}
},
{
"name": "control_rod_frame8",
"from": [0, 14, 3],
"to": [3, 16, 13],
"faces": {
"east": {"uv": [3, 3, 13, 5], "texture": "#7"},
"west": {"uv": [3, 3, 13, 5], "texture": "#7", "cullface": "west"},
"up": {"uv": [3, 0, 13, 3], "rotation": 270, "texture": "#7", "cullface": "up"},
"down": {"uv": [3, 13, 13, 16], "rotation": 90, "texture": "#7"}
}
},
{
"name": "control_rod_frame9",
"from": [13, 7, 3],
"to": [16, 9, 13],
"faces": {
"east": {"uv": [3, 10, 13, 12], "texture": "#7", "cullface": "east"},
"west": {"uv": [3, 13, 13, 15], "texture": "#7"},
"up": {"uv": [3, 16, 13, 13], "rotation": 90, "texture": "#7"},
"down": {"uv": [3, 9, 13, 12], "rotation": 270, "texture": "#7"}
}
},
{
"name": "control_rod_frame10",
"from": [13, 14, 3],
"to": [16, 16, 13],
"faces": {
"east": {"uv": [3, 3, 13, 5], "texture": "#7", "cullface": "east"},
"west": {"uv": [3, 3, 13, 5], "texture": "#7"},
"up": {"uv": [3, 0, 13, 3], "rotation": 90, "texture": "#7", "cullface": "up"},
"down": {"uv": [3, 13, 13, 16], "rotation": 270, "texture": "#7"}
}
},
{
"name": "control_rod_frame11",
"from": [0, 7, 13],
"to": [16, 9, 16],
"faces": {
"north": {"uv": [0, 13, 16, 15], "texture": "#7"},
"east": {"uv": [0, 10, 3, 12], "texture": "#7", "cullface": "east"},
"south": {"uv": [0, 10, 16, 12], "texture": "#7", "cullface": "south"},
"west": {"uv": [13, 10, 16, 12], "texture": "#7", "cullface": "west"},
"up": {"uv": [0, 13, 16, 16], "texture": "#7"},
"down": {"uv": [0, 12, 16, 9], "texture": "#7"}
}
},
{
"name": "control_rod_frame12",
"from": [0, 14, 13],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 3, 16, 5], "texture": "#7"},
"east": {"uv": [0, 3, 3, 5], "texture": "#7", "cullface": "east"},
"south": {"uv": [0, 3, 16, 5], "texture": "#7", "cullface": "south"},
"west": {"uv": [13, 3, 16, 5], "texture": "#7", "cullface": "west"},
"up": {"uv": [0, 0, 16, 3], "texture": "#7", "cullface": "up"},
"down": {"uv": [0, 16, 16, 13], "texture": "#7"}
}
},
{
"name": "connector_ring_bottom",
"from": [0, 0, 0],
"to": [16, 3, 16],
"faces": {
"north": {"uv": [0, 13, 16, 16], "texture": "#5", "cullface": "north"},
"east": {"uv": [0, 13, 16, 16], "texture": "#5", "cullface": "east"},
"south": {"uv": [0, 13, 16, 16], "texture": "#5", "cullface": "south"},
"west": {"uv": [0, 13, 16, 16], "texture": "#5", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
"down": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "down"}
}
}
],
"groups": [
{
"name": "control_rod_assembly",
"origin": [10, 5, 10],
"children": [
{
"name": "connectors",
"origin": [0, 12, 18],
"children": [0, 1, 2, 3, 4]
},
{
"name": "rods",
"origin": [8, 8, 8],
"children": [5, 6, 7, 8, 9, 10, 11, 12]
}, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25,
{
"name": "connector_rings",
"origin": [8, 8, 8],
"children": [26]
}
]
}
]
}
@@ -0,0 +1,155 @@
{
"credit": "Model by CyanideX",
"parent": "block/cube_all",
"textures": {
"1": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_rods_top",
"4": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_side",
"5": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_base",
"particle": "mekanismnuclear:block/model/fuel_assembly/fuel_rod_assembly_side"
},
"elements": [
{
"name": "core",
"from": [2, 3, 2],
"to": [14, 13, 14],
"faces": {
"north": {"uv": [2, 3, 14, 13], "texture": "#4"},
"east": {"uv": [2, 3, 14, 13], "texture": "#4"},
"south": {"uv": [2, 3, 14, 13], "texture": "#4"},
"west": {"uv": [2, 3, 14, 13], "texture": "#4"}
}
},
{
"name": "rod_1",
"from": [13, 1, 1],
"to": [15, 15, 3],
"faces": {
"north": {"uv": [1, 3, 3, 13], "texture": "#4"},
"east": {"uv": [13, 3, 15, 13], "texture": "#4"},
"south": {"uv": [1, 3, 3, 13], "texture": "#4"},
"west": {"uv": [1, 3, 3, 13], "texture": "#4"}
}
},
{
"name": "rod_2",
"from": [9, 1, 1],
"to": [11, 15, 15],
"faces": {
"north": {"uv": [5, 3, 7, 13], "texture": "#4"},
"east": {"uv": [1, 3, 3, 13], "texture": "#4"},
"south": {"uv": [9, 3, 11, 13], "texture": "#4"},
"west": {"uv": [5, 3, 7, 13], "texture": "#4"}
}
},
{
"name": "rod_3",
"from": [5, 1, 1],
"to": [7, 15, 15],
"faces": {
"north": {"uv": [9, 3, 11, 13], "texture": "#4"},
"east": {"uv": [5, 3, 7, 13], "texture": "#4"},
"south": {"uv": [5, 3, 7, 13], "texture": "#4"},
"west": {"uv": [9, 3, 11, 13], "texture": "#4"}
}
},
{
"name": "rod_4",
"from": [1, 1, 1],
"to": [3, 15, 3],
"faces": {
"north": {"uv": [13, 3, 15, 13], "texture": "#4"},
"east": {"uv": [1, 3, 3, 13], "texture": "#4"},
"south": {"uv": [1, 3, 3, 13], "texture": "#4"},
"west": {"uv": [1, 3, 3, 13], "texture": "#4"}
}
},
{
"name": "rod_5",
"from": [1, 1, 5],
"to": [15, 15, 7],
"faces": {
"north": {"uv": [5, 3, 7, 13], "texture": "#4"},
"east": {"uv": [9, 3, 11, 13], "texture": "#4"},
"south": {"uv": [1, 3, 3, 13], "texture": "#4"},
"west": {"uv": [5, 3, 7, 13], "texture": "#4"}
}
},
{
"name": "rod_6",
"from": [1, 1, 9],
"to": [15, 15, 11],
"faces": {
"north": {"uv": [9, 3, 11, 13], "texture": "#4"},
"east": {"uv": [5, 3, 7, 13], "texture": "#4"},
"south": {"uv": [1, 3, 3, 13], "texture": "#4"},
"west": {"uv": [9, 3, 11, 13], "texture": "#4"}
}
},
{
"name": "rod_7",
"from": [1, 1, 13],
"to": [3, 15, 15],
"faces": {
"north": {"uv": [1, 3, 3, 13], "texture": "#4"},
"east": {"uv": [1, 3, 3, 13], "texture": "#4"},
"south": {"uv": [1, 3, 3, 13], "texture": "#4"},
"west": {"uv": [13, 3, 15, 13], "texture": "#4"}
}
},
{
"name": "rod_8",
"from": [13, 1, 13],
"to": [15, 15, 15],
"faces": {
"north": {"uv": [1, 3, 3, 13], "texture": "#4"},
"east": {"uv": [1, 3, 3, 13], "texture": "#4"},
"south": {"uv": [13, 3, 15, 13], "texture": "#4"},
"west": {"uv": [1, 3, 3, 13], "texture": "#4"}
}
},
{
"name": "connector_ring_top",
"from": [0, 13, 0],
"to": [16, 16, 16],
"faces": {
"north": {"uv": [0, 0, 16, 3], "texture": "#4", "cullface": "north"},
"east": {"uv": [0, 0, 16, 3], "texture": "#4", "cullface": "east"},
"south": {"uv": [0, 0, 16, 3], "texture": "#4", "cullface": "south"},
"west": {"uv": [0, 0, 16, 3], "texture": "#4", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#1", "cullface": "up"},
"down": {"uv": [0, 0, 16, 16], "texture": "#1"}
}
},
{
"name": "connector_ring_bottom",
"from": [0, 0, 0],
"to": [16, 3, 16],
"faces": {
"north": {"uv": [0, 13, 16, 16], "texture": "#4", "cullface": "north"},
"east": {"uv": [0, 13, 16, 16], "texture": "#4", "cullface": "east"},
"south": {"uv": [0, 13, 16, 16], "texture": "#4", "cullface": "south"},
"west": {"uv": [0, 13, 16, 16], "texture": "#4", "cullface": "west"},
"up": {"uv": [0, 0, 16, 16], "texture": "#1"},
"down": {"uv": [0, 0, 16, 16], "texture": "#5", "cullface": "down"}
}
}
],
"groups": [
{
"name": "fuel_rod_assembly",
"origin": [8, 4, 8],
"children": [0,
{
"name": "rods",
"origin": [8, 8, 8],
"children": [1, 2, 3, 4, 5, 6, 7, 8]
},
{
"name": "connector_rings",
"origin": [8, 8, 8],
"children": [9, 10]
}
]
}
]
}
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "mekanismnuclear:block/fission_reactor_logic_adapter"
}
}
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "mekanismnuclear:block/fission_reactor_port_input"
}
}
@@ -0,0 +1,6 @@
{
"parent": "block/cube_all",
"textures": {
"all": "mekanismnuclear:block/reactor_glass"
}
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/control_rod_assembly"
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/fuel_assembly"
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/casing"
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/logic_adapter"
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/port_input"
}
@@ -0,0 +1,3 @@
{
"parent": "mekanismnuclear:block/fission/reactor_glass"
}
@@ -0,0 +1,10 @@
{
"type": "mekanism:ore_shaped",
"pattern": ["ICI", "SIS", "SIS"],
"key": {
"I": { "type": "forge:ore_dict", "ore": "ingotLead" },
"S": { "type": "forge:ore_dict", "ore": "ingotSteel" },
"C": { "type": "forge:ore_dict", "ore": "circuitElite" }
},
"result": { "item": "mekanismnuclear:control_rod_assembly" }
}
@@ -0,0 +1,15 @@
{
"type": "mekanism:ore_shaped",
"pattern": ["ISI", "ITI", "ISI"],
"key": {
"I": { "type": "forge:ore_dict", "ore": "ingotLead" },
"S": { "type": "forge:ore_dict", "ore": "ingotSteel" },
"T": {
"type": "mekanism:item_nbt",
"item": "mekanism:gastank",
"data": 0,
"nbt": { "tier": 0 }
}
},
"result": { "item": "mekanismnuclear:fission_fuel_assembly" }
}
@@ -0,0 +1,9 @@
{
"type": "mekanism:ore_shaped",
"pattern": [" I ", "IXI", " I "],
"key": {
"I": { "type": "forge:ore_dict", "ore": "ingotLead" },
"X": { "item": "mekanism:basicblock", "data": 8 }
},
"result": { "item": "mekanismnuclear:fission_reactor_casing", "count": 4 }
}
@@ -0,0 +1,9 @@
{
"type": "mekanism:ore_shaped",
"pattern": [" R ", "RFR", " R "],
"key": {
"F": { "item": "mekanismnuclear:fission_reactor_casing" },
"R": { "type": "forge:ore_dict", "ore": "dustRedstone" }
},
"result": { "item": "mekanismnuclear:fission_reactor_logic_adapter" }
}
@@ -0,0 +1,9 @@
{
"type": "mekanism:ore_shaped",
"pattern": [" F ", "FCF", " F "],
"key": {
"F": { "item": "mekanismnuclear:fission_reactor_casing" },
"C": { "type": "forge:ore_dict", "ore": "circuitElite" }
},
"result": { "item": "mekanismnuclear:fission_reactor_port", "count": 2 }
}
@@ -0,0 +1,10 @@
{
"type": "mekanism:ore_shaped",
"pattern": ["SIS", "IGI", "SIS"],
"key": {
"S": { "item": "mekanism:enrichediron" },
"I": { "type": "forge:ore_dict", "ore": "ingotLead" },
"G": { "type": "forge:ore_dict", "ore": "blockGlass" }
},
"result": { "item": "mekanismnuclear:reactor_glass", "count": 4 }
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 503 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 561 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 478 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 251 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 278 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 272 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 660 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 747 B