mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Update TileEntityCoreEmitter.java
This commit is contained in:
parent
dec5e80e0f
commit
65276ac0b2
@ -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[] {};
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user