mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the commit
This commit is contained in:
parent
3323356c73
commit
32d3b6722f
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.oil;
|
|||||||
|
|
||||||
import com.hbm.handler.pollution.PollutionHandler;
|
import com.hbm.handler.pollution.PollutionHandler;
|
||||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||||
|
import com.hbm.handler.CompatHandler.OCComponent;
|
||||||
import com.hbm.inventory.FluidStack;
|
import com.hbm.inventory.FluidStack;
|
||||||
import com.hbm.inventory.container.ContainerMachineCoker;
|
import com.hbm.inventory.container.ContainerMachineCoker;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
@ -18,9 +19,14 @@ import com.hbm.util.fauxpointtwelve.DirPos;
|
|||||||
|
|
||||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||||
import api.hbm.tile.IHeatSource;
|
import api.hbm.tile.IHeatSource;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
|
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;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -29,7 +35,8 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class TileEntityMachineCoker extends TileEntityMachineBase implements IFluidStandardTransceiver, IGUIProvider, IFluidCopiable {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "opencomputers")})
|
||||||
|
public class TileEntityMachineCoker extends TileEntityMachineBase implements SimpleComponent, OCComponent, IFluidStandardTransceiver, IGUIProvider, IFluidCopiable {
|
||||||
|
|
||||||
public boolean wasOn;
|
public boolean wasOn;
|
||||||
public int progress;
|
public int progress;
|
||||||
@ -295,4 +302,60 @@ public class TileEntityMachineCoker extends TileEntityMachineBase implements IFl
|
|||||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
return new GUIMachineCoker(player.inventory, this);
|
return new GUIMachineCoker(player.inventory, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_coker";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getTypeStored(Context context, Arguments args) {
|
||||||
|
return new Object[] {tanks[0].getTankType().getName(), tanks[1].getTankType().getName()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getFluidStored(Context context, Arguments args) {
|
||||||
|
return new Object[] {tanks[0].getFill(), tanks[1].getFill()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getHeat(Context context, Arguments args) {
|
||||||
|
return new Object[] {this.heat};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {tanks[0].getTankType().getName(), tanks[1].getTankType().getName(), tanks[0].getFill(), tanks[1].getFill(), this.heat};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getFluidStored",
|
||||||
|
"getTypeStored",
|
||||||
|
"getHeat",
|
||||||
|
"getInfo"};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getFluidStored":
|
||||||
|
return getFluidStored(context, args);
|
||||||
|
case "getTypeStored":
|
||||||
|
return getTypeStored(context, args);
|
||||||
|
case "getHeat":
|
||||||
|
return getHeat(context, args);
|
||||||
|
case "getInfo":
|
||||||
|
return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user