Skip to content

Commit

Permalink
Added new coolant and components
Browse files Browse the repository at this point in the history
- Added pseudo-crystalline naquadah, which is a better coolant
- Added coolant heat exchangers, which are heat vents that only work in
  fluid reactors
- Added cells for all four fluids
- Added scanner info to reactors & access hatches
- Added better heat plate
  • Loading branch information
RecursivePineapple committed Oct 13, 2024
1 parent d5c1b89 commit bc4de91
Show file tree
Hide file tree
Showing 34 changed files with 563 additions and 103 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.gtnewhorizons.modularui.common.peripheral.ModularUIPeripheralInputHandler;
import com.gtnewhorizons.modularui.integration.nei.ModularUIContainerObjectHandler;
import com.recursive_pineapple.nuclear_horizons.reactors.fluids.IconLoader;

import codechicken.nei.guihook.GuiContainerManager;
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
Expand All @@ -18,6 +19,8 @@ public Side getSide() {
public void preInit(FMLPreInitializationEvent event) {
super.preInit(event);

IconLoader.INSTANCE.register();

GuiContainerManager.addInputHandler(new ModularUIPeripheralInputHandler());
GuiContainerManager.addObjectHandler(new ModularUIContainerObjectHandler());
// NetworkRegistry.INSTANCE.registerGuiHandler(NuclearHorizons.instance, new GuiHandler());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public void preInit(FMLPreInitializationEvent event) {

Config.synchronizeConfiguration(event.getSuggestedConfigurationFile());

FluidList.registerFluids();
BlockList.registerBlocks();
ItemList.registerItems();
BlockList.registerBlocks();
FluidList.registerFluids();
}

// load "Do your mod setup. Build whatever data structures you care about. Register recipes." (Remove if not needed)
Expand All @@ -36,12 +36,14 @@ public void init(FMLInitializationEvent event) {

// postInit "Handle interaction with other mods, complete your setup based on this." (Remove if not needed)
public void postInit(FMLPostInitializationEvent event) {
FluidList.registerContainers();
FluidList.registerCoolants();
SimulationItems.registerSimulationItems();
ForeignItems.registerForeignReactorItems();
}

// register server commands in this event handler (Remove if not needed)
public void serverStarting(FMLServerStartingEvent event) {
SimulationItems.registerSimulationItems();
ForeignItems.registerForeignReactorItems();

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class Config {
public static double MOX_EU_COEFFICIENT = 4;
public static int REACTOR_EU_MULTIPLIER = 100;
public static int FLUID_NUKE_HU_MULTIPLIER = 2;
public static int COOLANT_SPECIFIC_HEAT = 1;
public static int NAQ_COOLANT_SPECIFIC_HEAT = 8;

public static void synchronizeConfiguration(File configFile) {
Configuration configuration = new Configuration(configFile);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,6 @@
import static cpw.mods.fml.common.registry.GameRegistry.registerBlock;
import static cpw.mods.fml.common.registry.GameRegistry.registerTileEntity;

import net.minecraft.block.material.Material;

import com.recursive_pineapple.nuclear_horizons.NuclearHorizons;
import com.recursive_pineapple.nuclear_horizons.reactors.fluids.FluidList;
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileAccessHatch;
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileFluidPort;
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorChamber;
Expand All @@ -25,8 +21,6 @@ public class BlockList {
public static final String REACTOR_REDSTONE_PORT_NAME = "reactor_redstone_port";
public static final String REACTOR_THERMAL_SENSOR_NAME = "reactor_thermal_sensor";
public static final String REACTOR_SIMULATOR_NAME = "reactor_simulator";
public static final String COOLANT_BLOCK_NAME = "nh_coolant";
public static final String HOT_COOLANT_BLOCK_NAME = "nh_hot_coolant";

public static ReactorCore REACTOR_CORE;
public static ReactorChamber REACTOR_CHAMBER;
Expand All @@ -37,9 +31,6 @@ public class BlockList {
public static ReactorThermalSensor REACTOR_THERMAL_SENSOR;
public static ReactorSimulator REACTOR_SIMULATOR;

public static FluidBlock COOLANT_BLOCK;
public static FluidBlock HOT_COOLANT_BLOCK;

public static void registerBlocks() {
REACTOR_CORE = new ReactorCore();
REACTOR_CHAMBER = new ReactorChamber();
Expand All @@ -50,21 +41,6 @@ public static void registerBlocks() {
REACTOR_THERMAL_SENSOR = new ReactorThermalSensor();
REACTOR_SIMULATOR = new ReactorSimulator();

COOLANT_BLOCK = new FluidBlock(
FluidList.COOLANT,
Material.water,
NuclearHorizons.MODID + ":coolant_still",
NuclearHorizons.MODID + ":coolant_flow");
COOLANT_BLOCK.setBlockName(COOLANT_BLOCK_NAME);

HOT_COOLANT_BLOCK = new FluidBlock(
FluidList.HOT_COOLANT,
Material.water,
NuclearHorizons.MODID + ":hot_coolant_still",
NuclearHorizons.MODID + ":hot_coolant_flow");
HOT_COOLANT_BLOCK.setBurnsEntities(true);
HOT_COOLANT_BLOCK.setBlockName(HOT_COOLANT_BLOCK_NAME);

registerBlock(REACTOR_CORE, REACTOR_CORE_NAME);
registerTileEntity(TileReactorCore.class, REACTOR_CORE_NAME);

Expand All @@ -87,8 +63,5 @@ public static void registerBlocks() {

registerBlock(REACTOR_SIMULATOR, REACTOR_SIMULATOR_NAME);
registerTileEntity(TileReactorSimulator.class, REACTOR_SIMULATOR_NAME);

registerBlock(COOLANT_BLOCK, COOLANT_BLOCK_NAME);
registerBlock(HOT_COOLANT_BLOCK, HOT_COOLANT_BLOCK_NAME);
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;

import java.util.ArrayList;

import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -9,7 +11,10 @@
import com.gtnewhorizons.modularui.api.UIInfos;
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileAccessHatch;

public class ReactorAccessHatch extends BlockContainer {
import gregtech.api.interfaces.IDebugableBlock;
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;

public class ReactorAccessHatch extends BlockContainer implements IDebugableBlock {

public ReactorAccessHatch() {
super(Material.rock);
Expand Down Expand Up @@ -39,4 +44,14 @@ public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer
return false;
}
}

@Override
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
if (aPlayer.getEntityWorld()
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
return te.getDebugInfo(aPlayer, aLogLevel);
} else {
return new ArrayList<>();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;

import java.util.ArrayList;

import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
Expand All @@ -18,7 +20,10 @@
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorCore;
import com.recursive_pineapple.nuclear_horizons.utils.DirectionUtil;

public class ReactorChamber extends BlockContainer {
import gregtech.api.interfaces.IDebugableBlock;
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;

public class ReactorChamber extends BlockContainer implements IDebugableBlock {

private IIcon iconTop, iconSide;

Expand Down Expand Up @@ -115,4 +120,13 @@ private static int getAttachedReactors(World worldIn, int x, int y, int z) {
return reactorCount;
}

@Override
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
if (aPlayer.getEntityWorld()
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
return te.getDebugInfo(aPlayer, aLogLevel);
} else {
return new ArrayList<>();
}
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;

import java.util.ArrayList;

import net.minecraft.block.BlockContainer;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
Expand All @@ -11,7 +13,10 @@
import com.gtnewhorizons.modularui.api.UIInfos;
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorCore;

public class ReactorCore extends BlockContainer {
import gregtech.api.interfaces.IDebugableBlock;
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;

public class ReactorCore extends BlockContainer implements IDebugableBlock {

private IIcon iconTop, iconSideInactive, iconSideActive, iconBottom;

Expand Down Expand Up @@ -67,4 +72,14 @@ public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer
public void onBlockPreDestroy(World worldIn, int x, int y, int z, int meta) {
((TileReactorCore) worldIn.getTileEntity(x, y, z)).dropInventory();
}

@Override
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
if (aPlayer.getEntityWorld()
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
return te.getDebugInfo(aPlayer, aLogLevel);
} else {
return new ArrayList<>();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@

public class HeatMoverAdapter implements IComponentAdapter {

private final IReactorGrid reactor;
private final int x, y;
private final ItemStack itemStack;
private final IHeatMover heatMover;
protected final IReactorGrid reactor;
protected final int x, y;
protected final ItemStack itemStack;
protected final IHeatMover heatMover;

private SimulationComponentResult simResult;
protected SimulationComponentResult simResult;

public HeatMoverAdapter(IReactorGrid reactor, int x, int y, ItemStack itemStack, IHeatMover heatMover) {
this.reactor = reactor;
Expand Down Expand Up @@ -67,16 +67,32 @@ public void onSimulationFinished(SimulationResult result, int componentIndex) {

}

protected int getTransferFromReactor() {
return this.heatMover.getTransferFromReactor(itemStack, reactor);
}

protected int getTransferToAir() {
return this.heatMover.getTransferToAir(itemStack, reactor);
}

protected int getTransferNeighbourToAir(IComponentAdapter neighbour) {
return this.heatMover.getTransferNeighbourToAir(itemStack, reactor, neighbour);
}

protected int getTransferFromNeighbour(IComponentAdapter neighbour) {
return this.heatMover.getTransferFromNeighbour(itemStack, reactor, neighbour);
}

@Override
public void onHeatTick() {
int fromReactor = this.heatMover.getTransferFromReactor(itemStack, reactor);
int fromReactor = getTransferFromReactor();

if (fromReactor != 0) {
this.reactor.addHullHeat(-fromReactor);
this.addHeat(fromReactor);
}

int toAir = this.heatMover.getTransferToAir(itemStack, reactor);
int toAir = getTransferToAir();

if (toAir != 0) {
this.addHeat(-toAir);
Expand All @@ -98,7 +114,7 @@ public void onHeatTick() {
var neighbour = reactor.getComponent(x2, y2);

if (neighbour != null && neighbour.containsHeat()) {
int fromNeighbourToAir = this.heatMover.getTransferNeighbourToAir(itemStack, reactor, neighbour);
int fromNeighbourToAir = getTransferNeighbourToAir(neighbour);

if (fromNeighbourToAir != 0) {
neighbour.addHeat(-fromNeighbourToAir);
Expand All @@ -109,7 +125,7 @@ public void onHeatTick() {
}
}

int fromNeighbour = this.heatMover.getTransferFromNeighbour(itemStack, reactor, neighbour);
int fromNeighbour = getTransferFromNeighbour(neighbour);

if (fromNeighbour != 0) {
neighbour.addHeat(-fromNeighbour);
Expand Down
Loading

0 comments on commit bc4de91

Please sign in to comment.