mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
commit
c019c4a923
@ -72,6 +72,7 @@ dependencies {
|
||||
compileOnly 'codechicken:NotEnoughItems:1.7.10-1.0.3.74:src'
|
||||
|
||||
//compileOnly 'inventory-tweaks:InventoryTweaks:1.62+beta.84:api'
|
||||
compile "li.cil.oc:OpenComputers:MC1.7.10-1.5.+:api"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
||||
@ -24,7 +24,14 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, ILaserable, IFluidStandardReceiver {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, ILaserable, IFluidStandardReceiver, SimpleComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000000L;
|
||||
@ -287,4 +294,58 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tank};
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "dfc_emitter";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {getPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {getMaxPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryogel(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {watts};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] isActive(Context context, Arguments args) {
|
||||
return new Object[] {isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setActive(Context context, Arguments args) {
|
||||
isOn = Boolean.parseBoolean(args.checkString(0));
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setInput(Context context, Arguments args) {
|
||||
int newOutput = Integer.parseInt(args.checkString(0));
|
||||
if (newOutput > 100) {
|
||||
newOutput = 100;
|
||||
}
|
||||
watts = newOutput;
|
||||
return new Object[] {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public static final int range = 15;
|
||||
@ -175,5 +182,22 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tanks[0], tanks[1]};
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "dfc_injector";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFirstFuel(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getSecondFuel(Context context, Arguments args) {
|
||||
return new Object[] {tanks[1].getFill()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -21,7 +21,14 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, ILaserable, IFluidStandardReceiver {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyGenerator, IFluidAcceptor, ILaserable, IFluidStandardReceiver, SimpleComponent {
|
||||
|
||||
public long power;
|
||||
public long joules;
|
||||
@ -170,4 +177,28 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { tank };
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "dfc_receiver";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {joules};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getOutput(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryogel(Context context, Arguments args) {
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,14 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyUser {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyUser, SimpleComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 2500000000L;
|
||||
@ -154,4 +161,47 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
nbt.setInteger("watts", watts);
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "dfc_stabilizer";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {maxPower};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInput(Context context, Arguments args) {
|
||||
return new Object[] {watts};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDurability(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.ams_lens && ItemLens.getLensDamage(slots[0]) < ((ItemLens)ModItems.ams_lens).maxDamage) {
|
||||
return new Object[] {ItemLens.getLensDamage(slots[0])};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setInput(Context context, Arguments args) {
|
||||
int newOutput = Integer.parseInt(args.checkString(0));
|
||||
if (newOutput > 100) {
|
||||
newOutput = 100;
|
||||
}
|
||||
watts = newOutput;
|
||||
return new Object[] {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase implements SimpleComponent {
|
||||
|
||||
public int flux;
|
||||
public float progress;
|
||||
@ -201,4 +208,22 @@ public class TileEntityMachineReactorBreeding extends TileEntityMachineBase {
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "breeding_reactor";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFlux(Context context, Arguments args) {
|
||||
return new Object[] {flux};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getProgress(Context context, Arguments args) {
|
||||
return new Object[] {progress};
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,8 +38,15 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
//TODO: fix reactor control;
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver {
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver, SimpleComponent {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
@ -386,4 +393,45 @@ public class TileEntityReactorResearch extends TileEntityMachineBase implements
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "research_reactor";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTemp(Context context, Arguments args) { // or getHeat, whatever.
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getLevel(Context context, Arguments args) {
|
||||
return new Object[] {level};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTargetLevel(Context context, Arguments args) {
|
||||
return new Object[] {targetLevel};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFlux(Context context, Arguments args) {
|
||||
return new Object[] {totalFlux};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setLevel(Context context, Arguments args) {
|
||||
double newLevel = Double.parseDouble(args.checkString(0))/100.0;
|
||||
if (newLevel > 1) { // check if its above 100 so the control rod wont do funny things
|
||||
newLevel = 1;
|
||||
}
|
||||
targetLevel = newLevel;
|
||||
return new Object[] {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -38,7 +38,14 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityReactorZirnox extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityReactorZirnox extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent {
|
||||
|
||||
public int heat;
|
||||
public static final int maxHeat = 100000;
|
||||
@ -510,5 +517,47 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] { water, carbonDioxide };
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "zirnox_reactor";
|
||||
}
|
||||
|
||||
}
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTemp(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getPressure(Context context, Arguments args) {
|
||||
return new Object[] {pressure};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getWater(Context context, Arguments args) {
|
||||
return new Object[] {water.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCarbonDioxide(Context context, Arguments args) {
|
||||
return new Object[] {carbonDioxide.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] isActive(Context context, Arguments args) {
|
||||
return new Object[] {isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setActive(Context context, Arguments args) {
|
||||
isOn = Boolean.parseBoolean(args.checkString(0));
|
||||
return new Object[] {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,14 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCraneConsole extends TileEntity implements INBTPacketReceiver {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCraneConsole extends TileEntity implements INBTPacketReceiver, SimpleComponent {
|
||||
|
||||
public int centerX;
|
||||
public int centerY;
|
||||
@ -327,4 +334,64 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_crane";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] move(Context context, Arguments args) {
|
||||
if (setUpCrane == true) {
|
||||
String textbruh = args.checkString(0);
|
||||
|
||||
switch(textbruh) {
|
||||
case "up":
|
||||
tiltFront = 30;
|
||||
if(!worldObj.isRemote) posFront += speed;
|
||||
case "down":
|
||||
tiltFront = -30;
|
||||
if(!worldObj.isRemote) posFront -= speed;
|
||||
case "left":
|
||||
tiltLeft = 30;
|
||||
if(!worldObj.isRemote) posLeft += speed;
|
||||
case "right":
|
||||
tiltLeft = -30;
|
||||
if(!worldObj.isRemote) posLeft -= speed;
|
||||
}
|
||||
|
||||
return new Object[] {};
|
||||
}
|
||||
return new Object[] {"Crane not found"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] load(Context context, Arguments args) {
|
||||
if (setUpCrane == true) {
|
||||
goesDown = true;
|
||||
return new Object[] {};
|
||||
}
|
||||
return new Object[] {"Crane not found"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDepletion(Context context, Arguments args) {
|
||||
if(loadedItem != null && loadedItem.getItem() instanceof ItemRBMKRod) {
|
||||
return new Object[] {ItemRBMKRod.getEnrichment(loadedItem)};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getXenonPoison(Context context, Arguments args) {
|
||||
if(loadedItem != null && loadedItem.getItem() instanceof ItemRBMKRod) {
|
||||
return new Object[] {ItemRBMKRod.getPoison(loadedItem)};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,7 +6,14 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
|
||||
public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase implements SimpleComponent {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
@ -105,4 +112,40 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase {
|
||||
data.setDouble("level", this.level);
|
||||
return data;
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_control_rod";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getLevel(Context context, Arguments args) {
|
||||
return new Object[] {getMult()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getTargetLevel(Context context, Arguments args) {
|
||||
return new Object[] {targetLevel};
|
||||
}
|
||||
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setLevel(Context context, Arguments args) {
|
||||
double newLevel = Double.parseDouble(args.checkString(0))/100.0;
|
||||
if (newLevel > 1) { // check if its above 100 so the control rod wont do funny things
|
||||
newLevel = 1;
|
||||
}
|
||||
targetLevel = newLevel;
|
||||
return new Object[] {};
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,7 +16,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, SimpleComponent {
|
||||
|
||||
//amount of "neutron energy" buffered for the next tick to use for the reaction
|
||||
public double fluxFast;
|
||||
@ -343,4 +350,49 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
slots[0] = null;
|
||||
this.markDirty();
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
if (isModerated() == true) {
|
||||
return "rbmk_moderated_fuel_rod";
|
||||
}
|
||||
return "rbmk_fuel_rod";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[] {heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluxSlow(Context context, Arguments args) {
|
||||
return new Object[] {fluxSlow};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluxFast(Context context, Arguments args) {
|
||||
return new Object[] {fluxFast};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getDepletion(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
return new Object[] {ItemRBMKRod.getEnrichment(slots[0])};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getXenonPoison(Context context, Arguments args) {
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
return new Object[] {ItemRBMKRod.getPoison(slots[0])};
|
||||
}
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
}
|
||||
|
||||
@ -52,4 +52,13 @@ public class TileEntityRBMKRodReaSim extends TileEntityRBMKRod {
|
||||
public ColumnType getConsoleType() {
|
||||
return ColumnType.FUEL_SIM;
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
if (isModerated() == true) {
|
||||
return "rbmk_moderated_fuel_rod_reasim";
|
||||
}
|
||||
return "rbmk_fuel_rod_reasim";
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,14 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyUser {
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyUser, SimpleComponent {
|
||||
|
||||
public long[] log = new long[20];
|
||||
public long power = 0;
|
||||
@ -295,4 +302,22 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
public void setPower(long power) {
|
||||
this.power = power;
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "ntm_energy_storage"; // need a way to somehow detect the first word of the energy storage block so people wont get confused when it comes to multiple energy storage blocks
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEnergyStored(Context context, Arguments args) {
|
||||
return new Object[] {getPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getMaxEnergy(Context context, Arguments args) {
|
||||
return new Object[] {getMaxPower()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -124,4 +124,10 @@ public class TileEntityMachineFENSU extends TileEntityMachineBattery {
|
||||
{
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
// override the name because when connecting the machine to opencomputers it's gonna say "ntm_energy_storage"
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "ntm_fensu";
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user