mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
New OC Compatibility system!
This commit is contained in:
parent
9d1e20df0f
commit
6e5b689ed2
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
@ -104,7 +105,7 @@ public class BlockCableGauge extends BlockContainer implements IBlockMultiPass,
|
||||
}
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public static class TileEntityCableGauge extends TileEntityCableBaseNT implements INBTPacketReceiver, SimpleComponent {
|
||||
public static class TileEntityCableGauge extends TileEntityCableBaseNT implements INBTPacketReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
private long deltaTick = 0;
|
||||
private long deltaSecond = 0;
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.Locale;
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
@ -108,7 +109,7 @@ public class FluidDuctGauge extends FluidDuctBase implements IBlockMultiPass, IL
|
||||
}
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public static class TileEntityPipeGauge extends TileEntityPipeBaseNT implements INBTPacketReceiver, SimpleComponent {
|
||||
public static class TileEntityPipeGauge extends TileEntityPipeBaseNT implements INBTPacketReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
private BigInteger lastMeasurement = BigInteger.valueOf(10);
|
||||
private long deltaTick = 0;
|
||||
|
||||
@ -2,20 +2,32 @@ package com.hbm.handler;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.*;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
||||
/**
|
||||
* General handler for OpenComputers compatibility.
|
||||
* <p/>
|
||||
* Mostly just functions used across many TEs.
|
||||
* @author BallOfEnergy (Microwave)
|
||||
*/
|
||||
public class CompatHandler {
|
||||
|
||||
public static Object[] steamTypeToInt(FluidType type) {
|
||||
if(type == Fluids.STEAM) {return new Object[] {0};}
|
||||
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
|
||||
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
|
||||
return new Object[] {3};
|
||||
}
|
||||
|
||||
public static FluidType intToSteamType(int arg) {
|
||||
switch(arg) {
|
||||
default:
|
||||
@ -28,4 +40,82 @@ public class CompatHandler {
|
||||
return Fluids.ULTRAHOTSTEAM;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This is an interface made specifically for adding OC compatibility to NTM machines. The {@link li.cil.oc.api.network.SimpleComponent} interface must also be implemented in the TE.
|
||||
* <br>
|
||||
* This interface is not required to be defined as an optional interface, though the {@link li.cil.oc.api.network.SimpleComponent} interface must be declared as an optional interface.
|
||||
* <br>
|
||||
* Pseudo multiblocks will automatically receive compatibility with their ports by proxying their `methods()` and `invoke()` functions. This is the only time they need to be defined.
|
||||
*
|
||||
**/
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.SidedComponent", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.Analyzable", modid = "OpenComputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.ManagedPeripheral", modid = "OpenComputers"),
|
||||
})
|
||||
@SimpleComponent.SkipInjection
|
||||
public interface OCComponent extends SimpleComponent, SidedComponent, Analyzable, ManagedPeripheral {
|
||||
|
||||
/**
|
||||
* Must be overridden in the implemented TE, or it will default to "ntm_null".
|
||||
* <br>
|
||||
* Dictates the component name exposed to the computer.
|
||||
* @return String
|
||||
*/
|
||||
@Override
|
||||
default String getComponentName() {
|
||||
return "ntm_null";
|
||||
}
|
||||
|
||||
/**
|
||||
* Tells OC which sides of the block cables should connect to.
|
||||
* @param side Side to check
|
||||
* @return If the side should be able to connect.
|
||||
*/
|
||||
@Override
|
||||
default boolean canConnectNode(ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function to give more information when analyzing the block. Multiple entries in the array will be sent to the user in the order of the array.
|
||||
* @return Additional text to add in the form of lang entries (ex: "analyze.basic2").
|
||||
*/
|
||||
default String[] getExtraInfo() {return new String[] {"analyze.noInfo"};}
|
||||
|
||||
@Override
|
||||
default Node[] onAnalyze(EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic1").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic2").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.basic3").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.name", this.getComponentName()).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GOLD)));
|
||||
String[] extraInfo = getExtraInfo();
|
||||
for (String info : extraInfo) {
|
||||
if(!info.equals(""))
|
||||
player.addChatComponentMessage(new ChatComponentTranslation(info).setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)));
|
||||
}
|
||||
TileEntity te = player.worldObj.getTileEntity((int) hitX, (int) hitY, (int) hitZ);
|
||||
OCComponent component = (OCComponent) te;
|
||||
if((component.methods() == null && te instanceof TileEntityProxyCombo) || component.getComponentName().equals("ntm_null")) {
|
||||
player.addChatComponentMessage(new ChatComponentTranslation("analyze.error").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard methods array from {@link li.cil.oc.api.network.ManagedPeripheral} extending {@link li.cil.oc.api.network.SimpleComponent}.
|
||||
* @return Array of methods to expose to the computer.
|
||||
*/
|
||||
@Override
|
||||
default String[] methods() {return null;}
|
||||
|
||||
/**
|
||||
* Standard invoke function from {@link li.cil.oc.api.network.ManagedPeripheral} extending {@link li.cil.oc.api.network.SimpleComponent}.
|
||||
* @return Data to the computer as a return from the function.
|
||||
*/
|
||||
@Override
|
||||
default Object[] invoke(String method, Context context, Arguments args) throws Exception {return null;}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity;
|
||||
|
||||
|
||||
import api.hbm.block.ICrucibleAcceptor;
|
||||
import com.hbm.handler.CompatHandler.OCComponent;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -10,6 +11,10 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import api.hbm.tile.IHeatSource;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -18,7 +23,11 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergyReceiverMK2, IFluidAcceptor, ISidedInventory, IFluidConnector, IHeatSource, ICrucibleAcceptor {
|
||||
@Optional.InterfaceList({
|
||||
@Optional.Interface(iface = "com.hbm.handler.CompatHandler.OCComponent", modid = "opencomputers"),
|
||||
@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")
|
||||
})
|
||||
public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergyReceiverMK2, IFluidAcceptor, ISidedInventory, IFluidConnector, IHeatSource, ICrucibleAcceptor, SimpleComponent, OCComponent {
|
||||
|
||||
TileEntity tile;
|
||||
boolean inventory;
|
||||
@ -537,4 +546,39 @@ public class TileEntityProxyCombo extends TileEntityProxyBase implements IEnergy
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override // please work
|
||||
public String getComponentName() {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return ((OCComponent) this.getTile()).getComponentName();
|
||||
return OCComponent.super.getComponentName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) { //thank you vaer
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return (this.getTile().getBlockMetadata() & 6) == 6 && ((OCComponent) this.getTile()).canConnectNode(side);
|
||||
return OCComponent.super.canConnectNode(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getExtraInfo() {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return new String[] {"analyze.dummy"};
|
||||
return OCComponent.super.getExtraInfo();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] methods() {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return ((OCComponent) this.getTile()).methods();
|
||||
return OCComponent.super.methods();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
if(this.getTile() instanceof OCComponent)
|
||||
return ((OCComponent) this.getTile()).invoke(method, context, args);
|
||||
return OCComponent.super.invoke(null, null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
@ -55,7 +56,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public abstract class TileEntityLaunchPadBase extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver, SimpleComponent {
|
||||
public abstract class TileEntityLaunchPadBase extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiver, IGUIProvider, IRadarCommandReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
/** Automatic instantiation of generic missiles, i.e. everything that both extends EntityMissileBaseNT and needs a designator */
|
||||
public static final HashMap<ComparableStack, Class<? extends EntityMissileBaseNT>> missiles = new HashMap();
|
||||
@ -523,4 +524,32 @@ public abstract class TileEntityLaunchPadBase extends TileEntityMachineBase impl
|
||||
}
|
||||
return new Object[] {false};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getEnergyInfo",
|
||||
"getFluid",
|
||||
"canLaunch",
|
||||
"getTier",
|
||||
"launch"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getEnergyInfo"):
|
||||
return getEnergyInfo(context, args);
|
||||
case ("getFluid"):
|
||||
return getFluid(context, args);
|
||||
case ("canLaunch"):
|
||||
return canLaunch(context, args);
|
||||
case ("getTier"):
|
||||
return getTier(context, args);
|
||||
case ("launch"):
|
||||
return launch(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.bomb;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.entity.missile.EntityMissileCustom;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.MissileStruct;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -53,7 +54,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, SimpleComponent, IRadarCommandReceiver {
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyReceiverMK2, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, SimpleComponent, IRadarCommandReceiver, CompatHandler.OCComponent {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
@ -713,6 +714,35 @@ public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISide
|
||||
return new Object[] {false};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getEnergyInfo",
|
||||
"getContents",
|
||||
"getLaunchInfo",
|
||||
"getCoords",
|
||||
"setCoords",
|
||||
"launch"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getEnergyInfo"):
|
||||
return getEnergyInfo(context, args);
|
||||
case ("getContents"):
|
||||
return getContents(context, args);
|
||||
case ("getLaunchInfo"):
|
||||
return getLaunchInfo(context, args);
|
||||
case ("getCoords"):
|
||||
return getCoords(context, args);
|
||||
case ("setCoords"):
|
||||
return setCoords(context, args);
|
||||
case ("launch"):
|
||||
return launch(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerLaunchTable(player.inventory, this);
|
||||
|
||||
@ -41,7 +41,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcceptor, IFluidSource, IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcceptor, IFluidSource, IEnergyProviderMK2, INBTPacketReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000000L;
|
||||
@ -358,7 +358,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcc
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setType(Context context, Arguments args) {
|
||||
tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
@ -367,6 +367,29 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcc
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getFluid",
|
||||
"getType",
|
||||
"setType",
|
||||
"getInfo"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getFluid"):
|
||||
return getFluid(context, args);
|
||||
case ("getType"):
|
||||
return getType(context, args);
|
||||
case ("setType"):
|
||||
return setType(context, args);
|
||||
case ("getInfo"):
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] {tanks[1]};
|
||||
|
||||
@ -5,6 +5,7 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerCoreEmitter;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
@ -37,7 +38,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyReceiverMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityCoreEmitter extends TileEntityMachineBase implements IEnergyReceiverMK2, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000000L;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.container.ContainerCoreInjector;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -27,7 +28,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent, IGUIProvider {
|
||||
public class TileEntityCoreInjector extends TileEntityMachineBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent, IGUIProvider, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public static final int range = 15;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.container.ContainerCoreReceiver;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
@ -32,7 +33,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidAcceptor, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityCoreReceiver extends TileEntityMachineBase implements IEnergyProviderMK2, IFluidAcceptor, ILaserable, IFluidStandardReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public long joules;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerCoreStabilizer;
|
||||
import com.hbm.inventory.gui.GUICoreStabilizer;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -28,7 +29,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyReceiverMK2, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityCoreStabilizer extends TileEntityMachineBase implements IEnergyReceiverMK2, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 2500000000L;
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
@ -17,7 +18,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityGeiger extends TileEntity implements SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityGeiger extends TileEntity implements SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
int timer = 0;
|
||||
int ticker = 0;
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerICF;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
@ -38,7 +39,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider, IFluidStandardTransceiver, IInfoProviderEC, SimpleComponent {
|
||||
public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider, IFluidStandardTransceiver, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public long laser;
|
||||
public long maxLaser;
|
||||
@ -344,4 +345,32 @@ public class TileEntityICF extends TileEntityMachineBase implements IGUIProvider
|
||||
};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getHeat",
|
||||
"getHeatingRate",
|
||||
"getMaxHeat",
|
||||
"getPower",
|
||||
"getFluid",
|
||||
"getPelletStats"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch (method) {
|
||||
case ("getHeat"):
|
||||
return getHeat(context, args);
|
||||
case ("getHeatingRate"):
|
||||
return getHeatingRate(context, args);
|
||||
case ("getMaxHeat"):
|
||||
return getMaxHeat(context, args);
|
||||
case ("getPower"):
|
||||
return getPower(context, args);
|
||||
case ("getFluid"):
|
||||
return getFluid(context, args);
|
||||
case ("getPelletStats"):
|
||||
return getPelletStats(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.blocks.machine.MachineITER;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.explosion.ExplosionNT;
|
||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.container.ContainerITER;
|
||||
@ -52,7 +53,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent {
|
||||
public class TileEntityITER extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, IGUIProvider, IInfoProviderEC, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10000000;
|
||||
@ -722,4 +723,36 @@ public class TileEntityITER extends TileEntityMachineBase implements IEnergyRece
|
||||
return new Object[]{ItemFusionShield.getShieldDamage(slots[3]), ((ItemFusionShield)slots[3].getItem()).maxDamage};
|
||||
return new Object[] {"N/A", "N/A"};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getEnergyInfo",
|
||||
"isActive",
|
||||
"setActive",
|
||||
"getFluid",
|
||||
"getPlasmaTemp",
|
||||
"getMaxTemp",
|
||||
"getBlanketDamage"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch (method) {
|
||||
case ("getEnergyInfo"):
|
||||
return getEnergyInfo(context, args);
|
||||
case ("isActive"):
|
||||
return isActive(context, args);
|
||||
case ("setActive"):
|
||||
return setActive(context, args);
|
||||
case ("getFluid"):
|
||||
return getFluid(context, args);
|
||||
case ("getPlasmaTemp"):
|
||||
return getPlasmaTemp(context, args);
|
||||
case ("getMaxTemp"):
|
||||
return getMaxTemp(context, args);
|
||||
case ("getBlanketDamage"):
|
||||
return getBlanketDamage(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityMachineLargeTurbine extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000;
|
||||
@ -365,7 +365,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setType(Context context, Arguments args) {
|
||||
tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
@ -374,6 +374,29 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
|
||||
return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getFluid",
|
||||
"getType",
|
||||
"setType",
|
||||
"getInfo"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getFluid"):
|
||||
return getFluid(context, args);
|
||||
case ("getType"):
|
||||
return getType(context, args);
|
||||
case ("setType"):
|
||||
return setType(context, args);
|
||||
case ("getInfo"):
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineLargeTurbine(player.inventory, this);
|
||||
|
||||
@ -8,6 +8,7 @@ import java.util.function.Function;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerMachineRadarNT;
|
||||
import com.hbm.inventory.gui.GUIMachineRadarNT;
|
||||
@ -66,7 +67,7 @@ import net.minecraft.world.WorldServer;
|
||||
* @author hbm
|
||||
*/
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineRadarNT extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IConfigurableMachine, IControlReceiver, SimpleComponent {
|
||||
public class TileEntityMachineRadarNT extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, IConfigurableMachine, IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public boolean scanMissiles = true;
|
||||
public boolean scanShells = true;
|
||||
@ -674,4 +675,43 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
}
|
||||
return new Object[]{false, e.posX, e.posY, e.posZ, type};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getSettings",
|
||||
"getRange",
|
||||
"setSettings",
|
||||
"getEnergyInfo",
|
||||
"isJammed",
|
||||
"getAmount",
|
||||
"isIndexPlayer",
|
||||
"getIndexType",
|
||||
"getEntityAtIndex"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getSettings"):
|
||||
return getSettings(context, args);
|
||||
case ("getRange"):
|
||||
return getRange(context, args);
|
||||
case ("setSettings"):
|
||||
return setSettings(context, args);
|
||||
case ("getEnergyInfo"):
|
||||
return getEnergyInfo(context, args);
|
||||
case ("isJammed"):
|
||||
return isJammed(context, args);
|
||||
case ("getAmount"):
|
||||
return getAmount(context, args);
|
||||
case ("isIndexPlayer"):
|
||||
return isIndexPlayer(context, args);
|
||||
case ("getIndexType"):
|
||||
return getIndexType(context, args);
|
||||
case ("getEntityAtIndex"):
|
||||
return getEntityAtIndex(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.ReactorResearch;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineReactorBreeding;
|
||||
import com.hbm.inventory.gui.GUIMachineReactorBreeding;
|
||||
import com.hbm.inventory.recipes.BreederRecipes;
|
||||
@ -30,7 +31,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase implements SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineReactorBreeding extends TileEntityMachineBase implements SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public int flux;
|
||||
public float progress;
|
||||
|
||||
@ -39,7 +39,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityMachineTurbine extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IEnergyProviderMK2, IFluidStandardTransceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
@ -41,7 +42,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMachineTurbineGas extends TileEntityMachineBase implements IFluidStandardTransceiver, IEnergyProviderMK2, IControlReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityMachineTurbineGas extends TileEntityMachineBase implements IFluidStandardTransceiver, IEnergyProviderMK2, IControlReceiver, IGUIProvider, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000L;
|
||||
@ -605,14 +606,14 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setThrottle(Context context, Arguments args) {
|
||||
throttle = args.checkInteger(0);
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setAuto(Context context, Arguments args) {
|
||||
autoMode = args.checkBoolean(0);
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@ -620,20 +621,19 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
public Object[] start(Context context, Arguments args) {
|
||||
stopIfNotReady();
|
||||
startup();
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] stop(Context context, Arguments args) {
|
||||
shutdown();
|
||||
return new Object[] {true};
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
|
||||
return new Object[] {throttle, state,
|
||||
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||
tanks[1].getFill(), tanks[1].getMaxFill(),
|
||||
@ -641,6 +641,64 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
|
||||
tanks[3].getFill(), tanks[3].getMaxFill()};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getFluid",
|
||||
"getType",
|
||||
"getPower",
|
||||
"getThrottle",
|
||||
"getState",
|
||||
"getAuto",
|
||||
"setThrottle",
|
||||
"setAuto",
|
||||
"start",
|
||||
"stop",
|
||||
"getInfo"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getFluid"):
|
||||
return new Object[] {
|
||||
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||
tanks[1].getFill(), tanks[1].getMaxFill(),
|
||||
tanks[2].getFill(), tanks[2].getMaxFill(),
|
||||
tanks[3].getFill(), tanks[3].getMaxFill()
|
||||
};
|
||||
case ("getType"):
|
||||
return new Object[] {tanks[0].getTankType().getName()};
|
||||
case ("getPower"):
|
||||
return new Object[] {power};
|
||||
case ("getThrottle"):
|
||||
return new Object[] {throttle};
|
||||
case ("getState"):
|
||||
return new Object[] {state};
|
||||
case ("getAuto"):
|
||||
return new Object[] {autoMode};
|
||||
case ("setThrottle"):
|
||||
throttle = args.checkInteger(0);
|
||||
return new Object[] {};
|
||||
case ("setAuto"):
|
||||
autoMode = args.checkBoolean(0);
|
||||
return new Object[] {};
|
||||
case ("start"):
|
||||
stopIfNotReady();
|
||||
startup();
|
||||
return new Object[] {};
|
||||
case ("stop"):
|
||||
shutdown();
|
||||
return new Object[] {};
|
||||
case ("getInfo"):
|
||||
return new Object[] {throttle, state,
|
||||
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||
tanks[1].getFill(), tanks[1].getMaxFill(),
|
||||
tanks[2].getFill(), tanks[2].getMaxFill(),
|
||||
tanks[3].getFill(), tanks[3].getMaxFill()};
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerMachineTurbineGas(player.inventory, this);
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMicrowave;
|
||||
import com.hbm.inventory.gui.GUIMicrowave;
|
||||
import com.hbm.lib.Library;
|
||||
@ -28,7 +29,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityMicrowave extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, SimpleComponent {
|
||||
public class TileEntityMicrowave extends TileEntityMachineBase implements IEnergyReceiverMK2, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 50000;
|
||||
|
||||
@ -6,6 +6,7 @@ import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerPWR;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -43,7 +44,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, SimpleComponent, IFluidStandardTransceiver {
|
||||
public class TileEntityPWRController extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, SimpleComponent, IFluidStandardTransceiver, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public int coreHeat;
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.ReactorResearch;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerReactorControl;
|
||||
import com.hbm.inventory.gui.GUIReactorControl;
|
||||
@ -29,7 +30,7 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityReactorControl extends TileEntityMachineBase implements IControlReceiver, IGUIProvider, SimpleComponent {
|
||||
public class TileEntityReactorControl extends TileEntityMachineBase implements IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public TileEntityReactorControl() {
|
||||
super(1);
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
@ -41,7 +42,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
//TODO: fix reactor control;
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityReactorResearch extends TileEntityMachineBase implements IControlReceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
@ -430,6 +431,32 @@ public class TileEntityReactorResearch extends TileEntityMachineBase implements
|
||||
return new Object[] {heat, level, targetLevel, totalFlux};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getTemp",
|
||||
"getLevel",
|
||||
"getTargetLevel",
|
||||
"getFlux",
|
||||
"getInfo"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getTemp"):
|
||||
return getTemp(context, args);
|
||||
case ("getLevel"):
|
||||
return getLevel(context, args);
|
||||
case ("getTargetLevel"):
|
||||
return getTargetLevel(context, args);
|
||||
case ("getFlux"):
|
||||
return getFlux(context, args);
|
||||
case ("getInfo"):
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Callback(direct = true, limit = 4)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] setLevel(Context context, Arguments args) {
|
||||
|
||||
@ -10,6 +10,7 @@ import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.projectile.EntityZirnoxDebris;
|
||||
import com.hbm.entity.projectile.EntityZirnoxDebris.DebrisType;
|
||||
import com.hbm.explosion.ExplosionNukeGeneric;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -52,7 +53,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@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, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityReactorZirnox extends TileEntityMachineBase implements IFluidContainer, IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public int heat;
|
||||
public static final int maxHeat = 100000;
|
||||
@ -600,6 +601,41 @@ public class TileEntityReactorZirnox extends TileEntityMachineBase implements IF
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"getTemp",
|
||||
"getPressure",
|
||||
"getWater",
|
||||
"getSteam",
|
||||
"getCarbonDioxide",
|
||||
"isActive",
|
||||
"getInfo",
|
||||
"setActive"
|
||||
};
|
||||
}
|
||||
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch(method) {
|
||||
case ("getTemp"):
|
||||
return getTemp(context, args);
|
||||
case ("getPressure"):
|
||||
return getPressure(context, args);
|
||||
case ("getWater"):
|
||||
return getWater(context, args);
|
||||
case ("getSteam"):
|
||||
return getSteam(context, args);
|
||||
case ("getCarbonDioxide"):
|
||||
return getCarbonDioxide(context, args);
|
||||
case ("isActive"):
|
||||
return isActive(context, args);
|
||||
case ("getInfo"):
|
||||
return getInfo(context, args);
|
||||
case ("setActive"):
|
||||
return setActive(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerReactorZirnox(player.inventory, this);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
@ -28,7 +29,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityCraneConsole extends TileEntity implements INBTPacketReceiver, SimpleComponent {
|
||||
public class TileEntityCraneConsole extends TileEntity implements INBTPacketReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public int centerX;
|
||||
public int centerY;
|
||||
|
||||
@ -33,12 +33,13 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IControlReceiver, IFluidStandardTransceiver, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -403,6 +404,11 @@ public class TileEntityRBMKBoiler extends TileEntityRBMKSlottedBase implements I
|
||||
return new Object[] {true};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKGeneric(player.inventory);
|
||||
|
||||
@ -7,6 +7,7 @@ import java.util.Locale;
|
||||
import java.util.Set;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.gui.GUIRBMKConsole;
|
||||
@ -36,7 +37,7 @@ 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 TileEntityRBMKConsole extends TileEntityMachineBase implements IControlReceiver, IGUIProvider, SimpleComponent {
|
||||
public class TileEntityRBMKConsole extends TileEntityMachineBase implements IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
private int targetX;
|
||||
private int targetY;
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -10,9 +11,10 @@ import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase implements SimpleComponent {
|
||||
public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase implements SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public double lastLevel;
|
||||
@ -164,4 +166,9 @@ public abstract class TileEntityRBMKControl extends TileEntityRBMKSlottedBase im
|
||||
targetLevel = MathHelper.clamp_double(newLevel, 0, 1);
|
||||
return new Object[] {};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine.rbmk;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardReceiver;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -16,11 +17,12 @@ import net.minecraft.entity.Entity;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent {
|
||||
public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAcceptor, IFluidStandardReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
private FluidTank tank;
|
||||
private int lastCooled;
|
||||
@ -178,4 +180,9 @@ public class TileEntityRBMKCooler extends TileEntityRBMKBase implements IFluidAc
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{heat, tank.getFill(), tank.getMaxFill(), xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.container.ContainerRBMKHeater;
|
||||
@ -28,12 +29,13 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, SimpleComponent {
|
||||
public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements IFluidAcceptor, IFluidSource, IFluidStandardTransceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank feed;
|
||||
public FluidTank steam;
|
||||
@ -334,6 +336,11 @@ public class TileEntityRBMKHeater extends TileEntityRBMKSlottedBase implements I
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKHeater(player.inventory, this);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.rbmk;
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.container.ContainerRBMKOutgasser;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -26,9 +27,10 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IFluidStandardSender, SimpleComponent {
|
||||
public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IFluidStandardSender, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank gas;
|
||||
public double progress;
|
||||
@ -262,6 +264,11 @@ public class TileEntityRBMKOutgasser extends TileEntityRBMKSlottedBase implement
|
||||
return new Object[] {gas.getFill(), gas.getMaxFill(), progress, gas.getTankType().getID(), xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKOutgasser(player.inventory, this);
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKBase;
|
||||
import com.hbm.blocks.machine.rbmk.RBMKRod;
|
||||
import com.hbm.entity.projectile.EntityRBMKDebris.DebrisType;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.inventory.container.ContainerRBMKRod;
|
||||
import com.hbm.inventory.gui.GUIRBMKRod;
|
||||
@ -33,7 +34,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, SimpleComponent, IInfoProviderEC {
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
//amount of "neutron energy" buffered for the next tick to use for the reaction
|
||||
public double fluxFast;
|
||||
@ -495,6 +496,11 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
return new Object[] {xCoord, yCoord, zCoord};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerRBMKRod(player.inventory, this);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.storage;
|
||||
|
||||
import api.hbm.fluid.*;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidContainerRegistry;
|
||||
@ -44,7 +45,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource, SimpleComponent, IFluidStandardTransceiver, IPersistentNBT, IGUIProvider {
|
||||
public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcceptor, IFluidSource, SimpleComponent, IFluidStandardTransceiver, IPersistentNBT, IGUIProvider, CompatHandler.OCComponent {
|
||||
|
||||
public FluidTank tank;
|
||||
public short mode = 0;
|
||||
@ -427,4 +428,24 @@ public class TileEntityBarrel extends TileEntityMachineBase implements IFluidAcc
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill(), tank.getMaxFill(), tank.getTankType().getName()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] methods() {
|
||||
return new String[] {"getFluidStored", "getMaxStored", "getTypeStored", "getInfo"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch (method) {
|
||||
case "getFluidStored":
|
||||
return getFluidStored(context, args);
|
||||
case "getMaxStored":
|
||||
return getMaxStored(context, args);
|
||||
case "getTypeStored":
|
||||
return getTypeStored(context, args);
|
||||
case "getInfo":
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
import api.hbm.tile.IInfoProviderEC;
|
||||
|
||||
import com.hbm.blocks.machine.MachineBattery;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.inventory.container.ContainerMachineBattery;
|
||||
import com.hbm.inventory.gui.GUIMachineBattery;
|
||||
import com.hbm.lib.Library;
|
||||
@ -34,7 +35,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IPersistentNBT, SimpleComponent, IGUIProvider, IInfoProviderEC {
|
||||
public class TileEntityMachineBattery extends TileEntityMachineBase implements IEnergyConductorMK2, IEnergyProviderMK2, IEnergyReceiverMK2, IPersistentNBT, SimpleComponent, IGUIProvider, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
public long[] log = new long[20];
|
||||
public long delta = 0;
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.CompatHandler.OCComponent;
|
||||
import com.hbm.handler.MultiblockHandlerXR;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -55,7 +56,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||
public class TileEntityMachineFluidTank extends TileEntityMachineBase implements IFluidContainer, SimpleComponent, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable {
|
||||
public class TileEntityMachineFluidTank extends TileEntityMachineBase implements IFluidContainer, SimpleComponent, OCComponent, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IPersistentNBT, IOverpressurable, IGUIProvider, IRepairable {
|
||||
|
||||
public FluidTank tank;
|
||||
public short mode = 0;
|
||||
@ -514,4 +515,24 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
|
||||
public Object[] getInfo(Context context, Arguments args) {
|
||||
return new Object[]{tank.getFill(), tank.getMaxFill(), tank.getTankType().getName()};
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] methods() {
|
||||
return new String[] {"getFluidStored", "getMaxStored", "getTypeStored", "getInfo"};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch (method) {
|
||||
case "getFluidStored":
|
||||
return getFluidStored(context, args);
|
||||
case "getMaxStored":
|
||||
return getMaxStored(context, args);
|
||||
case "getTypeStored":
|
||||
return getTypeStored(context, args);
|
||||
case "getInfo":
|
||||
return getInfo(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.network;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.gui.GuiScreenRadioTelex;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
@ -29,7 +30,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRadioTelex extends TileEntity implements INBTPacketReceiver, IControlReceiver, IGUIProvider, SimpleComponent {
|
||||
public class TileEntityRadioTelex extends TileEntity implements INBTPacketReceiver, IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
public static final int lineWidth = 33;
|
||||
public String txChannel = "";
|
||||
|
||||
@ -14,6 +14,7 @@ import com.hbm.entity.train.EntityRailCarBase;
|
||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||
import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.handler.CasingEjector;
|
||||
import com.hbm.handler.CompatHandler;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.container.ContainerTurretBase;
|
||||
@ -65,7 +66,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
*
|
||||
*/
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IEnergyReceiverMK2, IControlReceiver, IGUIProvider, SimpleComponent {
|
||||
public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase implements IEnergyReceiverMK2, IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||
|
||||
@Override
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
@ -1012,4 +1013,55 @@ public abstract class TileEntityTurretBaseNT extends TileEntityMachineBase imple
|
||||
public Object[] isAligned(Context context, Arguments args) {
|
||||
return new Object[] {this.aligned};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnectNode(ForgeDirection side) {
|
||||
return side == ForgeDirection.DOWN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] methods() {
|
||||
return new String[] {
|
||||
"setActive",
|
||||
"isActive",
|
||||
"getEnergyInfo",
|
||||
"getWhitelisted",
|
||||
"addWhitelist",
|
||||
"removeWhitelist",
|
||||
"setTargeting",
|
||||
"getTargeting",
|
||||
"hasTarget",
|
||||
"getAngle",
|
||||
"isAligned"
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||
switch (method) {
|
||||
case "setActive":
|
||||
return setActive(context, args);
|
||||
case "isActive":
|
||||
return isActive(context, args);
|
||||
case "getEnergyInfo":
|
||||
return getEnergyInfo(context, args);
|
||||
case "getWhitelisted":
|
||||
return getWhitelisted(context, args);
|
||||
case "addWhitelist":
|
||||
return addWhitelist(context, args);
|
||||
case "removeWhitelist":
|
||||
return removeWhitelist(context, args);
|
||||
case "setTargeting":
|
||||
return setTargeting(context, args);
|
||||
case "getTargeting":
|
||||
return getTargeting(context, args);
|
||||
case "hasTarget":
|
||||
return hasTarget(context, args);
|
||||
case "getAngle":
|
||||
return getAngle(context, args);
|
||||
case "isAligned":
|
||||
return isAligned(context, args);
|
||||
}
|
||||
throw new NoSuchMethodException();
|
||||
}
|
||||
}
|
||||
|
||||
@ -131,6 +131,14 @@ achievement.witchtaunter=Witch Taunter
|
||||
achievement.ZIRNOXBoom.desc=cope, seethe, mald
|
||||
achievement.ZIRNOXBoom=CIRNOX
|
||||
|
||||
analyze.basic1======NTM Component=====
|
||||
analyze.basic2=More documentation can be found on the wiki.
|
||||
analyze.basic3====Extra Information===
|
||||
analyze.dummy=Type: Dummy Block
|
||||
analyze.error=This block's compatibility has not been set properly, this should be reported as a bug!
|
||||
analyze.name=Name: %s
|
||||
analyze.noInfo=No additional information.
|
||||
|
||||
armor.blastProtection=Damage modifier of %s against explosions
|
||||
armor.cap=Hard damage cap of %s
|
||||
armor.damageModifier=Damage modifier of %s against %s
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user