mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-08-10 17:55:44 +00:00
commit
6f52fb8e37
@ -15,6 +15,7 @@ import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.redstoneoverradio.IRORValueProvider;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -28,7 +29,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, IFluidStandardTransceiver, IGUIProvider, IControlReceiver, IFluidCopiable {
|
||||
public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHeatSource, IFluidStandardTransceiver, IGUIProvider, IControlReceiver, IFluidCopiable, IRORValueProvider {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public int amountToCool = 24_000;
|
||||
@ -267,4 +268,21 @@ public class TileEntityHeaterHeatex extends TileEntityMachineBase implements IHe
|
||||
}
|
||||
if(nbt.hasKey("toCool")) amountToCool = nbt.getInteger("toCool");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFunctionInfo() {
|
||||
return new String[] {
|
||||
PREFIX_VALUE + "hotfluid",
|
||||
PREFIX_VALUE + "coldfluid",
|
||||
PREFIX_VALUE + "heat"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String provideRORValue(String name) {
|
||||
if((PREFIX_VALUE + "hotfluid").equals(name)) return "" + tanks[0].getFill();
|
||||
if((PREFIX_VALUE + "coldfluid").equals(name)) return "" + tanks[1].getFill();
|
||||
if((PREFIX_VALUE + "heat").equals(name)) return "" + heatEnergy;
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,6 +14,8 @@ import com.hbm.tileentity.TileEntityMachinePolluting;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import api.hbm.redstoneoverradio.IRORInteractive;
|
||||
import api.hbm.redstoneoverradio.IRORValueProvider;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -24,7 +26,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implements IGUIProvider, IFluidStandardTransceiver, IHeatSource, IControlReceiver, IFluidCopiable {
|
||||
public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implements IGUIProvider, IFluidStandardTransceiver, IHeatSource, IControlReceiver, IFluidCopiable, IRORValueProvider, IRORInteractive {
|
||||
|
||||
public boolean isOn = false;
|
||||
public FluidTank tank;
|
||||
@ -234,4 +236,47 @@ public class TileEntityHeaterOilburner extends TileEntityMachinePolluting implem
|
||||
if(nbt.hasKey("isOn")) isOn = nbt.getBoolean("isOn");
|
||||
if(nbt.hasKey("burnRate")) setting = nbt.getInteger("burnRate");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getFunctionInfo() {
|
||||
return new String[] {
|
||||
PREFIX_VALUE + "heat",
|
||||
PREFIX_VALUE + "fuel",
|
||||
PREFIX_VALUE + "burnRate",
|
||||
PREFIX_VALUE + "state",
|
||||
PREFIX_FUNCTION + "setState" + NAME_SEPARATOR + "active",
|
||||
PREFIX_FUNCTION + "setBurnRate" + NAME_SEPARATOR + "rate"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String provideRORValue(String name) {
|
||||
if((PREFIX_VALUE + "heat").equals(name)) return "" + heatEnergy;
|
||||
if((PREFIX_VALUE + "fuel").equals(name)) return "" + tank.getFill();
|
||||
if((PREFIX_VALUE + "burnRate").equals(name)) return "" + setting;
|
||||
if((PREFIX_VALUE + "state").equals(name)) return isOn ? "1" : "0";
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String runRORFunction(String name, String[] params) {
|
||||
if((PREFIX_FUNCTION + "setState").equals(name)) {
|
||||
this.isOn = params[0].equals("1");
|
||||
this.markChanged();
|
||||
return null;
|
||||
}
|
||||
if((PREFIX_FUNCTION + "setBurnRate").equals(name)) {
|
||||
try {
|
||||
int rate = Integer.parseInt(params[0]);
|
||||
if(rate < 1) rate = 1;
|
||||
if(rate > 10) rate = 10;
|
||||
this.setting = rate;
|
||||
this.markChanged();
|
||||
return null;
|
||||
} catch (NumberFormatException e) {
|
||||
return "Invalid number";
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user