Finishing touches.

This commit is contained in:
BallOfEnergy 2023-11-30 18:45:13 -06:00
parent b61d92a998
commit d4f8de4a54
7 changed files with 55 additions and 18 deletions

View File

@ -283,13 +283,13 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcc
@Override
public String getComponentName() {
return "ntm_large_turbine";
return "ntm_turbine";
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getFluid(Context context, Arguments args) {
return new Object[] {tanks[0].getFill(), tanks[1].getFill()};
return new Object[] {tanks[0].getFill(), tanks[1].getFill(), tanks[1].getFill(), tanks[1].getMaxFill()};
}
@Callback(direct = true)
@ -301,10 +301,15 @@ public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcc
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] setType(Context context, Arguments args) {
tanks[1].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
return new Object[] {true};
}
@Callback(direct = true)
@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())};
}
@Override
public FluidTank[] getSendingTanks() {

View File

@ -304,19 +304,19 @@ public class TileEntityMachineLargeTurbine extends TileEntityMachineBase impleme
return CompatHandler.steamTypeToInt(tanks[1].getTankType());
}
@Callback(direct = true)
@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(), tanks[1].getTankType()};
}
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] setType(Context context, Arguments args) {
tanks[1].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
return new Object[] {true};
}
@Callback(direct = true)
@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())};
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerMachineLargeTurbine(player.inventory, this);

View File

@ -385,13 +385,13 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
@Override
public String getComponentName() {
return "ntm_small_turbine";
return "ntm_turbine";
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getFluid(Context context, Arguments args) {
return new Object[] {tanks[0].getFill(), tanks[1].getFill()};
return new Object[] {tanks[0].getFill(), tanks[1].getFill(), tanks[1].getFill(), tanks[1].getMaxFill()};
}
@Callback(direct = true)
@ -403,10 +403,16 @@ public class TileEntityMachineTurbine extends TileEntityLoadedBase implements IS
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] setType(Context context, Arguments args) {
tanks[1].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
tanks[0].setTankType(CompatHandler.intToSteamType(args.checkInteger(0)));
return new Object[] {true};
}
@Callback(direct = true)
@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())};
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerMachineTurbine(player.inventory, this);

View File

@ -34,7 +34,6 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.MathHelper;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
@ -602,7 +601,7 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] setThrottle(Context context, Arguments args) {
powerSliderPos = MathHelper.clamp_int(args.checkInteger(0) / 100 * 60, 0 , 60);
throttle = args.checkInteger(0);
return new Object[] {true};
}
@ -613,6 +612,21 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
return new Object[] {true};
}
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] start(Context context, Arguments args) {
stopIfNotReady();
startup();
return new Object[] {true};
}
@Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers")
public Object[] stop(Context context, Arguments args) {
shutdown();
return new Object[] {true};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getInfo(Context context, Arguments args) {

View File

@ -399,7 +399,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers") //if this doesnt work im going to die
public Object[] getBoundPos(Context context, Arguments args) {
public Object[] getCranePos(Context context, Arguments args) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
ForgeDirection left = dir.getRotation(ForgeDirection.DOWN);
int x = (int)Math.floor(this.centerX - dir.offsetX * this.posFront - left.offsetX * this.posLeft + 0.5D);

View File

@ -443,6 +443,15 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
return new Object[] {"N/A"};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getType(Context context, Arguments args) {
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
return new Object[] {slots[0].getItem().getUnlocalizedName()};
}
return new Object[] {"N/A"};
}
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getInfo(Context context, Arguments args) {
@ -450,18 +459,21 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
Object OC_poison_buf;
Object OC_hull_buf;
Object OC_core_buf;
String OC_type;
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
OC_enrich_buf = ItemRBMKRod.getEnrichment(slots[0]);
OC_poison_buf = ItemRBMKRod.getPoison(slots[0]);
OC_hull_buf = ItemRBMKRod.getHullHeat(slots[0]);
OC_core_buf = ItemRBMKRod.getCoreHeat(slots[0]);
OC_type = slots[0].getItem().getUnlocalizedName();
} else {
OC_enrich_buf = "N/A";
OC_poison_buf = "N/A";
OC_hull_buf = "N/A";
OC_core_buf = "N/A";
OC_type = "N/A";
}
return new Object[] {heat, OC_hull_buf, OC_core_buf, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf, ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord};
return new Object[] {heat, OC_hull_buf, OC_core_buf, fluxSlow, fluxFast, OC_enrich_buf, OC_poison_buf, OC_type, ((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord};
}
@Callback(direct = true)

View File

@ -470,7 +470,7 @@ public class TileEntityMachineFluidTank extends TileEntityMachineBase implements
@Override
public String getComponentName() {
return "ntm_tank";
return "ntm_fluid_tank";
}
@Callback(direct = true)