mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Finished up most OC compatibility, tested and ready for merge.
This commit is contained in:
parent
8a57f66fa8
commit
54be75f71f
@ -335,6 +335,12 @@ public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEne
|
||||
return new Object[] {watts};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {getPower(), getMaxPower(), tank.getFill(), watts, isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] isActive(Context context, Arguments args) {
|
||||
|
||||
@ -212,6 +212,12 @@ public class TileEntityCoreInjector extends TileEntityMachineBase implements IFl
|
||||
return new Object[] {tanks[1].getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {tanks[0].getFill(), tanks[1].getFill()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerCoreInjector(player.inventory, this);
|
||||
|
||||
@ -209,6 +209,12 @@ public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEn
|
||||
return new Object[] {tank.getFill()};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {joules, power, tank.getFill()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerCoreReceiver(player.inventory, this);
|
||||
|
||||
@ -200,6 +200,18 @@ public class TileEntityCoreStabilizer extends TileEntityMachineBase implements I
|
||||
return new Object[] {"N/A"};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
Object lens_damage_buf;
|
||||
if(slots[0] != null && slots[0].getItem() == ModItems.ams_lens && ItemLens.getLensDamage(slots[0]) < ((ItemLens)ModItems.ams_lens).maxDamage) {
|
||||
lens_damage_buf = ItemLens.getLensDamage(slots[0]);
|
||||
} else {
|
||||
lens_damage_buf = "N/A";
|
||||
}
|
||||
return new Object[] {power, maxPower, watts, lens_damage_buf};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setInput(Context context, Arguments args) {
|
||||
|
||||
@ -14,6 +14,8 @@ import com.hbm.tileentity.TileEntityTickingBase;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.entity.IRadarDetectable;
|
||||
import api.hbm.entity.IRadarDetectable.RadarTargetType;
|
||||
import cpw.mods.fml.client.config.GuiEditArrayEntries;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
@ -25,8 +27,13 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
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 TileEntityMachineRadar extends TileEntityTickingBase implements IEnergyUser, IGUIProvider {
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineRadar extends TileEntityTickingBase implements IEnergyUser, IGUIProvider, SimpleComponent {
|
||||
|
||||
public List<Entity> entList = new ArrayList();
|
||||
public List<int[]> nearbyMissiles = new ArrayList();
|
||||
@ -285,6 +292,44 @@ public class TileEntityMachineRadar extends TileEntityTickingBase implements IEn
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
// do some opencomputer stuff
|
||||
|
||||
@Override
|
||||
public String getComponentName() {
|
||||
return "ntm_radar";
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getPower(Context context, Arguments args) {
|
||||
return new Object[] {power};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] isJammed(Context context, Arguments args) {
|
||||
return new Object[] {jammed};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getEntities(Context context, Arguments args) {
|
||||
int index = args.checkInteger(0);
|
||||
boolean raw = args.checkBoolean(1);
|
||||
if(!raw && !jammed) {
|
||||
Entity e = entList.get(index);
|
||||
double a = (e.posX);
|
||||
double b = (e.posY);
|
||||
double c = (e.posZ);
|
||||
boolean d = (e instanceof EntityPlayer);
|
||||
return new Object[] {a, b, c, d};
|
||||
} else if (!jammed) {
|
||||
return new Object[] {entList};
|
||||
} else {
|
||||
return new Object[] {"Radar jammed!"};
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineRadar(player.inventory, this);
|
||||
|
||||
@ -233,6 +233,12 @@ public class TileEntityMachineReactorBreeding extends TileEntityMachineBase impl
|
||||
return new Object[] {progress};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {flux, progress};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineReactorBreeding(player.inventory, this);
|
||||
|
||||
@ -415,6 +415,12 @@ public class TileEntityReactorResearch extends TileEntityMachineBase implements
|
||||
return new Object[] {totalFlux};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, level, targetLevel, totalFlux};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setLevel(Context context, Arguments args) {
|
||||
|
||||
@ -581,6 +581,12 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
return new Object[] {isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, pressure, water.getFill(), steam.getFill(), carbonDioxide.getFill(), isOn};
|
||||
}
|
||||
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setActive(Context context, Arguments args) {
|
||||
|
||||
@ -364,7 +364,14 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
@Callback
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[] {heat, steam.getFill(), steam.getMaxFill(), feed.getFill(), feed.getMaxFill()};
|
||||
FluidType type = steam.getTankType();
|
||||
Object type_1;
|
||||
if(type == Fluids.STEAM) {type_1 = "0";}
|
||||
else if(type == Fluids.HOTSTEAM) {type_1 = "1";}
|
||||
else if(type == Fluids.SUPERHOTSTEAM) {type_1 = "2";}
|
||||
else if(type == Fluids.ULTRAHOTSTEAM) {type_1 = "3";}
|
||||
else {type_1 = "Unknown Error";}
|
||||
return new Object[] {heat, steam.getFill(), steam.getMaxFill(), feed.getFill(), feed.getMaxFill(), type_1};
|
||||
}
|
||||
|
||||
@Callback
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user