Skip to content

Commit bc4de91

Browse files
Added new coolant and components
- 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
1 parent d5c1b89 commit bc4de91

34 files changed

Lines changed: 563 additions & 103 deletions

src/main/java/com/recursive_pineapple/nuclear_horizons/ClientProxy.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import com.gtnewhorizons.modularui.common.peripheral.ModularUIPeripheralInputHandler;
44
import com.gtnewhorizons.modularui.integration.nei.ModularUIContainerObjectHandler;
5+
import com.recursive_pineapple.nuclear_horizons.reactors.fluids.IconLoader;
56

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

22+
IconLoader.INSTANCE.register();
23+
2124
GuiContainerManager.addInputHandler(new ModularUIPeripheralInputHandler());
2225
GuiContainerManager.addObjectHandler(new ModularUIContainerObjectHandler());
2326
// NetworkRegistry.INSTANCE.registerGuiHandler(NuclearHorizons.instance, new GuiHandler());

src/main/java/com/recursive_pineapple/nuclear_horizons/CommonProxy.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ public void preInit(FMLPreInitializationEvent event) {
2424

2525
Config.synchronizeConfiguration(event.getSuggestedConfigurationFile());
2626

27-
FluidList.registerFluids();
28-
BlockList.registerBlocks();
2927
ItemList.registerItems();
28+
BlockList.registerBlocks();
29+
FluidList.registerFluids();
3030
}
3131

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

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

4245
// register server commands in this event handler (Remove if not needed)
4346
public void serverStarting(FMLServerStartingEvent event) {
44-
SimulationItems.registerSimulationItems();
45-
ForeignItems.registerForeignReactorItems();
47+
4648
}
4749
}

src/main/java/com/recursive_pineapple/nuclear_horizons/Config.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ public class Config {
1111
public static double MOX_EU_COEFFICIENT = 4;
1212
public static int REACTOR_EU_MULTIPLIER = 100;
1313
public static int FLUID_NUKE_HU_MULTIPLIER = 2;
14+
public static int COOLANT_SPECIFIC_HEAT = 1;
15+
public static int NAQ_COOLANT_SPECIFIC_HEAT = 8;
1416

1517
public static void synchronizeConfiguration(File configFile) {
1618
Configuration configuration = new Configuration(configFile);

src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/blocks/BlockList.java

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
import static cpw.mods.fml.common.registry.GameRegistry.registerBlock;
44
import static cpw.mods.fml.common.registry.GameRegistry.registerTileEntity;
55

6-
import net.minecraft.block.material.Material;
7-
8-
import com.recursive_pineapple.nuclear_horizons.NuclearHorizons;
9-
import com.recursive_pineapple.nuclear_horizons.reactors.fluids.FluidList;
106
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileAccessHatch;
117
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileFluidPort;
128
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorChamber;
@@ -25,8 +21,6 @@ public class BlockList {
2521
public static final String REACTOR_REDSTONE_PORT_NAME = "reactor_redstone_port";
2622
public static final String REACTOR_THERMAL_SENSOR_NAME = "reactor_thermal_sensor";
2723
public static final String REACTOR_SIMULATOR_NAME = "reactor_simulator";
28-
public static final String COOLANT_BLOCK_NAME = "nh_coolant";
29-
public static final String HOT_COOLANT_BLOCK_NAME = "nh_hot_coolant";
3024

3125
public static ReactorCore REACTOR_CORE;
3226
public static ReactorChamber REACTOR_CHAMBER;
@@ -37,9 +31,6 @@ public class BlockList {
3731
public static ReactorThermalSensor REACTOR_THERMAL_SENSOR;
3832
public static ReactorSimulator REACTOR_SIMULATOR;
3933

40-
public static FluidBlock COOLANT_BLOCK;
41-
public static FluidBlock HOT_COOLANT_BLOCK;
42-
4334
public static void registerBlocks() {
4435
REACTOR_CORE = new ReactorCore();
4536
REACTOR_CHAMBER = new ReactorChamber();
@@ -50,21 +41,6 @@ public static void registerBlocks() {
5041
REACTOR_THERMAL_SENSOR = new ReactorThermalSensor();
5142
REACTOR_SIMULATOR = new ReactorSimulator();
5243

53-
COOLANT_BLOCK = new FluidBlock(
54-
FluidList.COOLANT,
55-
Material.water,
56-
NuclearHorizons.MODID + ":coolant_still",
57-
NuclearHorizons.MODID + ":coolant_flow");
58-
COOLANT_BLOCK.setBlockName(COOLANT_BLOCK_NAME);
59-
60-
HOT_COOLANT_BLOCK = new FluidBlock(
61-
FluidList.HOT_COOLANT,
62-
Material.water,
63-
NuclearHorizons.MODID + ":hot_coolant_still",
64-
NuclearHorizons.MODID + ":hot_coolant_flow");
65-
HOT_COOLANT_BLOCK.setBurnsEntities(true);
66-
HOT_COOLANT_BLOCK.setBlockName(HOT_COOLANT_BLOCK_NAME);
67-
6844
registerBlock(REACTOR_CORE, REACTOR_CORE_NAME);
6945
registerTileEntity(TileReactorCore.class, REACTOR_CORE_NAME);
7046

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

8864
registerBlock(REACTOR_SIMULATOR, REACTOR_SIMULATOR_NAME);
8965
registerTileEntity(TileReactorSimulator.class, REACTOR_SIMULATOR_NAME);
90-
91-
registerBlock(COOLANT_BLOCK, COOLANT_BLOCK_NAME);
92-
registerBlock(HOT_COOLANT_BLOCK, HOT_COOLANT_BLOCK_NAME);
9366
}
9467
}

src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/blocks/ReactorAccessHatch.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;
22

3+
import java.util.ArrayList;
4+
35
import net.minecraft.block.BlockContainer;
46
import net.minecraft.block.material.Material;
57
import net.minecraft.entity.player.EntityPlayer;
@@ -9,7 +11,10 @@
911
import com.gtnewhorizons.modularui.api.UIInfos;
1012
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileAccessHatch;
1113

12-
public class ReactorAccessHatch extends BlockContainer {
14+
import gregtech.api.interfaces.IDebugableBlock;
15+
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;
16+
17+
public class ReactorAccessHatch extends BlockContainer implements IDebugableBlock {
1318

1419
public ReactorAccessHatch() {
1520
super(Material.rock);
@@ -39,4 +44,14 @@ public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer
3944
return false;
4045
}
4146
}
47+
48+
@Override
49+
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
50+
if (aPlayer.getEntityWorld()
51+
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
52+
return te.getDebugInfo(aPlayer, aLogLevel);
53+
} else {
54+
return new ArrayList<>();
55+
}
56+
}
4257
}

src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/blocks/ReactorChamber.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;
22

3+
import java.util.ArrayList;
4+
35
import net.minecraft.block.Block;
46
import net.minecraft.block.BlockContainer;
57
import net.minecraft.block.material.Material;
@@ -18,7 +20,10 @@
1820
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorCore;
1921
import com.recursive_pineapple.nuclear_horizons.utils.DirectionUtil;
2022

21-
public class ReactorChamber extends BlockContainer {
23+
import gregtech.api.interfaces.IDebugableBlock;
24+
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;
25+
26+
public class ReactorChamber extends BlockContainer implements IDebugableBlock {
2227

2328
private IIcon iconTop, iconSide;
2429

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

123+
@Override
124+
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
125+
if (aPlayer.getEntityWorld()
126+
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
127+
return te.getDebugInfo(aPlayer, aLogLevel);
128+
} else {
129+
return new ArrayList<>();
130+
}
131+
}
118132
}

src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/blocks/ReactorCore.java

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
package com.recursive_pineapple.nuclear_horizons.reactors.blocks;
22

3+
import java.util.ArrayList;
4+
35
import net.minecraft.block.BlockContainer;
46
import net.minecraft.block.material.Material;
57
import net.minecraft.client.renderer.texture.IIconRegister;
@@ -11,7 +13,10 @@
1113
import com.gtnewhorizons.modularui.api.UIInfos;
1214
import com.recursive_pineapple.nuclear_horizons.reactors.tile.TileReactorCore;
1315

14-
public class ReactorCore extends BlockContainer {
16+
import gregtech.api.interfaces.IDebugableBlock;
17+
import gregtech.api.interfaces.tileentity.IDebugableTileEntity;
18+
19+
public class ReactorCore extends BlockContainer implements IDebugableBlock {
1520

1621
private IIcon iconTop, iconSideInactive, iconSideActive, iconBottom;
1722

@@ -67,4 +72,14 @@ public boolean onBlockActivated(World worldIn, int x, int y, int z, EntityPlayer
6772
public void onBlockPreDestroy(World worldIn, int x, int y, int z, int meta) {
6873
((TileReactorCore) worldIn.getTileEntity(x, y, z)).dropInventory();
6974
}
75+
76+
@Override
77+
public ArrayList<String> getDebugInfo(EntityPlayer aPlayer, int aX, int aY, int aZ, int aLogLevel) {
78+
if (aPlayer.getEntityWorld()
79+
.getTileEntity(aX, aY, aZ) instanceof IDebugableTileEntity te) {
80+
return te.getDebugInfo(aPlayer, aLogLevel);
81+
} else {
82+
return new ArrayList<>();
83+
}
84+
}
7085
}

src/main/java/com/recursive_pineapple/nuclear_horizons/reactors/components/adapters/HeatMoverAdapter.java

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,12 @@
1111

1212
public class HeatMoverAdapter implements IComponentAdapter {
1313

14-
private final IReactorGrid reactor;
15-
private final int x, y;
16-
private final ItemStack itemStack;
17-
private final IHeatMover heatMover;
14+
protected final IReactorGrid reactor;
15+
protected final int x, y;
16+
protected final ItemStack itemStack;
17+
protected final IHeatMover heatMover;
1818

19-
private SimulationComponentResult simResult;
19+
protected SimulationComponentResult simResult;
2020

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

6868
}
6969

70+
protected int getTransferFromReactor() {
71+
return this.heatMover.getTransferFromReactor(itemStack, reactor);
72+
}
73+
74+
protected int getTransferToAir() {
75+
return this.heatMover.getTransferToAir(itemStack, reactor);
76+
}
77+
78+
protected int getTransferNeighbourToAir(IComponentAdapter neighbour) {
79+
return this.heatMover.getTransferNeighbourToAir(itemStack, reactor, neighbour);
80+
}
81+
82+
protected int getTransferFromNeighbour(IComponentAdapter neighbour) {
83+
return this.heatMover.getTransferFromNeighbour(itemStack, reactor, neighbour);
84+
}
85+
7086
@Override
7187
public void onHeatTick() {
72-
int fromReactor = this.heatMover.getTransferFromReactor(itemStack, reactor);
88+
int fromReactor = getTransferFromReactor();
7389

7490
if (fromReactor != 0) {
7591
this.reactor.addHullHeat(-fromReactor);
7692
this.addHeat(fromReactor);
7793
}
7894

79-
int toAir = this.heatMover.getTransferToAir(itemStack, reactor);
95+
int toAir = getTransferToAir();
8096

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

100116
if (neighbour != null && neighbour.containsHeat()) {
101-
int fromNeighbourToAir = this.heatMover.getTransferNeighbourToAir(itemStack, reactor, neighbour);
117+
int fromNeighbourToAir = getTransferNeighbourToAir(neighbour);
102118

103119
if (fromNeighbourToAir != 0) {
104120
neighbour.addHeat(-fromNeighbourToAir);
@@ -109,7 +125,7 @@ public void onHeatTick() {
109125
}
110126
}
111127

112-
int fromNeighbour = this.heatMover.getTransferFromNeighbour(itemStack, reactor, neighbour);
128+
int fromNeighbour = getTransferFromNeighbour(neighbour);
113129

114130
if (fromNeighbour != 0) {
115131
neighbour.addHeat(-fromNeighbour);

0 commit comments

Comments
 (0)