mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added more info to getColumnData, added control rod targets
This commit is contained in:
parent
9f849e8c2d
commit
6f314c3996
@ -602,10 +602,11 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
|
||||
LinkedHashMap<String, Object> data_table = new LinkedHashMap<>();
|
||||
data_table.put("type", column.getConsoleType().name());
|
||||
data_table.put("hullTemp", column_data.getDouble("heat"));
|
||||
data_table.put("realSimWater", column_data.getDouble("water"));
|
||||
data_table.put("realSimSteam", column_data.getDouble("steam"));
|
||||
data_table.put("realSimWater", column.reasimWater);
|
||||
data_table.put("realSimSteam", column.reasimSteam);
|
||||
data_table.put("moderated", column_data.getBoolean("moderated"));
|
||||
data_table.put("level", column_data.getDouble("level"));
|
||||
data_table.put("targetLevel", column_data.getDouble("targetLevel"));
|
||||
data_table.put("color", column_data.getShort("color"));
|
||||
data_table.put("enrichment", column_data.getDouble("enrichment"));
|
||||
data_table.put("xenon", column_data.getDouble("xenon"));
|
||||
@ -613,16 +614,31 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
|
||||
data_table.put("coreTemp", column_data.getDouble("c_coreHeat"));
|
||||
data_table.put("coreMaxTemp", column_data.getDouble("c_maxHeat"));
|
||||
|
||||
if (te instanceof TileEntityRBMKControlAuto){
|
||||
TileEntityRBMKControlAuto controlAuto = (TileEntityRBMKControlAuto) te;
|
||||
data_table.put("function", controlAuto.function.toString());
|
||||
data_table.put("heatUpper", controlAuto.heatUpper);
|
||||
data_table.put("heatLower", controlAuto.heatLower);
|
||||
data_table.put("levelUpper", controlAuto.levelUpper);
|
||||
data_table.put("levelLower",controlAuto.levelLower);
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityRBMKRod){
|
||||
TileEntityRBMKRod fuelChannel = (TileEntityRBMKRod)te;
|
||||
data_table.put("fluxQuantity", fuelChannel.lastFluxQuantity);
|
||||
data_table.put("fluxRatio", fuelChannel.fluxFastRatio);
|
||||
ItemStack rod = fuelChannel.getStackInSlot(0);
|
||||
if (rod != null)
|
||||
data_table.put("rodName", rod.getUnlocalizedName());
|
||||
else
|
||||
data_table.put("rodName", "");
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityRBMKBoiler){
|
||||
TileEntityRBMKBoiler boiler = (TileEntityRBMKBoiler)te;
|
||||
data_table.put("water", boiler.feed.getFill());
|
||||
data_table.put("steam", boiler.steam.getFill());
|
||||
data_table.put("steamType", Fluids.fromID(column_data.getShort("type")).getUnlocalizedName());
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityRBMKOutgasser){
|
||||
@ -644,6 +660,13 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
|
||||
TileEntityRBMKHeater heaterChannel = (TileEntityRBMKHeater)te;
|
||||
data_table.put("coolant", heaterChannel.feed.getFill());
|
||||
data_table.put("hotcoolant", heaterChannel.steam.getFill());
|
||||
data_table.put("coldtype", Fluids.fromID(column_data.getShort("type")).getUnlocalizedName());
|
||||
data_table.put("hottype", Fluids.fromID(column_data.getShort("hottype")).getUnlocalizedName());
|
||||
}
|
||||
|
||||
if (te instanceof TileEntityRBMKCooler){
|
||||
TileEntityRBMKCooler coolerChannel = (TileEntityRBMKCooler) te;
|
||||
data_table.put("cryogel", coolerChannel.getAllTanks()[0].getFill());
|
||||
}
|
||||
|
||||
return new Object[] {data_table};
|
||||
|
||||
@ -26,54 +26,54 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
public TileEntityRBMKControl() {
|
||||
super(0);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isLidRemovable() {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
|
||||
|
||||
this.lastLevel = this.level;
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if(level < targetLevel) {
|
||||
|
||||
|
||||
level += speed * RBMKDials.getControlSpeed(worldObj);
|
||||
|
||||
|
||||
if(level > targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
|
||||
|
||||
if(level > targetLevel) {
|
||||
|
||||
|
||||
level -= speed * RBMKDials.getControlSpeed(worldObj);
|
||||
|
||||
|
||||
if(level < targetLevel)
|
||||
level = targetLevel;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
|
||||
public void setTarget(double target) {
|
||||
this.targetLevel = target;
|
||||
}
|
||||
|
||||
|
||||
public double getMult() {
|
||||
return this.level;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int trackingRange() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
@ -81,7 +81,7 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
this.level = nbt.getDouble("level");
|
||||
this.targetLevel = nbt.getDouble("targetLevel");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
@ -103,31 +103,31 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
this.level = buf.readDouble();
|
||||
this.targetLevel = buf.readDouble();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onMelt(int reduce) {
|
||||
|
||||
|
||||
if(this.isModerated()) {
|
||||
|
||||
|
||||
int count = 2 + worldObj.rand.nextInt(2);
|
||||
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
spawnDebris(DebrisType.GRAPHITE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
int count = 2 + worldObj.rand.nextInt(2);
|
||||
|
||||
|
||||
for(int i = 0; i < count; i++) {
|
||||
spawnDebris(DebrisType.ROD);
|
||||
}
|
||||
|
||||
|
||||
this.standardMelt(reduce);
|
||||
}
|
||||
|
||||
@ -140,9 +140,10 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
public NBTTagCompound getNBTForConsole() {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setDouble("level", this.level);
|
||||
data.setDouble("targetLevel", this.targetLevel);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user