diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityChungus.java b/src/main/java/com/hbm/tileentity/machine/TileEntityChungus.java index db9394516..16121b0cb 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityChungus.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityChungus.java @@ -297,29 +297,35 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr } } - @Callback(direct = true) + @Callback(direct = true, doc = "function():table -- Gets current tanks state. The format is the following: , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getFluid(Context context, Arguments args) { return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill()}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the current input tank fluid type. 0 stands for steam, 1 for dense steam, 2 for super dense steam and 3 for ultra dense steam.") @Optional.Method(modid = "OpenComputers") public Object[] getType(Context context, Arguments args) { return CompatHandler.steamTypeToInt(tanks[0].getTankType()); } - @Callback(direct = true, limit = 4) + @Callback(direct = true, limit = 4, doc = "function(type:number) -- Sets the input tank fluid type. Refer getType() for the accepted values information.") @Optional.Method(modid = "OpenComputers") public Object[] setType(Context context, Arguments args) { tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0))); return new Object[] {}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.") + @Optional.Method(modid = "OpenComputers") + public Object[] getPower(Context context, Arguments args) { + return new Object[] {power}; + } + + @Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: , , , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getInfo(Context context, Arguments args) { - return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())}; + return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power}; } @Override @@ -329,6 +335,7 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr "getFluid", "getType", "setType", + "getPower", "getInfo" }; } @@ -343,6 +350,8 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IEnergyPr return getType(context, args); case ("setType"): return setType(context, args); + case ("getPower"): + return getPower(context, args); case ("getInfo"): return getInfo(context, args); } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLargeTurbine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLargeTurbine.java index dc238dce9..a4655c162 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLargeTurbine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineLargeTurbine.java @@ -302,29 +302,35 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme } } - @Callback(direct = true) + @Callback(direct = true, doc = "function():table -- Gets current tanks state. The format is the following: , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getFluid(Context context, Arguments args) { return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill()}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the current input tank fluid type. 0 stands for steam, 1 for dense steam, 2 for super dense steam and 3 for ultra dense steam.") @Optional.Method(modid = "OpenComputers") public Object[] getType(Context context, Arguments args) { return CompatHandler.steamTypeToInt(tanks[0].getTankType()); } - @Callback(direct = true, limit = 4) + @Callback(direct = true, limit = 4, doc = "function(type:number) -- Sets the input tank fluid type. Refer getType() for the accepted values information.") @Optional.Method(modid = "OpenComputers") public Object[] setType(Context context, Arguments args) { tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0))); return new Object[] {}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.") + @Optional.Method(modid = "OpenComputers") + public Object[] getPower(Context context, Arguments args) { + return new Object[] {power}; + } + + @Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: , , , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getInfo(Context context, Arguments args) { - return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())}; + return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power}; } @Override @@ -334,6 +340,7 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme "getFluid", "getType", "setType", + "getPower", "getInfo" }; } diff --git a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java index 0b89eb6d9..3180fbefa 100644 --- a/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java +++ b/src/main/java/com/hbm/tileentity/machine/TileEntityMachineTurbine.java @@ -355,29 +355,35 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS return "ntm_turbine"; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():table -- Gets current tanks state. The format is the following: , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getFluid(Context context, Arguments args) { return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill()}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the current input tank fluid type. 0 stands for steam, 1 for dense steam, 2 for super dense steam and 3 for ultra dense steam.") @Optional.Method(modid = "OpenComputers") public Object[] getType(Context context, Arguments args) { return CompatHandler.steamTypeToInt(tanks[0].getTankType()); } - @Callback(direct = true, limit = 4) + @Callback(direct = true, limit = 4, doc = "function(type:number) -- Sets the input tank fluid type. Refer getType() for the accepted values information.") @Optional.Method(modid = "OpenComputers") public Object[] setType(Context context, Arguments args) { tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0))); return new Object[] {true}; } - @Callback(direct = true) + @Callback(direct = true, doc = "function():number -- Gets the power buffer of the turbine.") + @Optional.Method(modid = "OpenComputers") + public Object[] getPower(Context context, Arguments args) { + return new Object[] {power}; + } + + @Callback(direct = true, doc = "function():table -- Gets information about this turbine. The format is the following: , , , , , ") @Optional.Method(modid = "OpenComputers") public Object[] getInfo(Context context, Arguments args) { - return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())}; + return new Object[] {tanks[0].getFill(), tanks[0].getMaxFill(), tanks[1].getFill(), tanks[1].getMaxFill(), CompatHandler.steamTypeToInt(tanks[0].getTankType())[0], power}; } @Override