mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Added a bit more OC compat, along with individual OC fields for grabbing singular fields.
This commit is contained in:
parent
edb94e966f
commit
a2b798c1e2
@ -151,9 +151,27 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
return "rbmk_cooler";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getHeat(Context context, Arguments args) {
|
||||
return new Object[]{heat};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getCryoMax(Context context, Arguments args) {
|
||||
return new Object[]{tank.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{heat, tank.getMaxFill(), tank.getFill()};
|
||||
return new Object[]{heat, tank.getFill(), tank.getMaxFill()};
|
||||
}
|
||||
}
|
||||
|
||||
@ -27,8 +27,14 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
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;
|
||||
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver {
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, SimpleComponent {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -268,6 +274,19 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
return new FluidTank[] {feed};
|
||||
}
|
||||
|
||||
//opencomputers stuff
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "rbmk_control_rod";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, feed.getFill(), feed.getMaxFill(), steam.getFill(), steam.getMaxFill(), feed.getTankType().getID(), steam.getTankType().getID()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKHeater(player.inventory, this);
|
||||
|
||||
@ -226,6 +226,25 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
public String getComponentName() {
|
||||
return "rbmk_outgasser";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getGas(Context context, Arguments args) {
|
||||
return new Object[] {gas.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getGasMax(Context context, Arguments args) {
|
||||
return new Object[] {gas.getMaxFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getProgress(Context context, Arguments args) {
|
||||
return new Object[] {progress};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
|
||||
@ -388,6 +388,12 @@ public class TileEntityMachineBattery extends TileEntityMachineBase implements I
|
||||
return new Object[] {getMaxPower()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {getPower(), getMaxPower()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeNBT(NBTTagCompound nbt) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user