pretty important fix where crane consoles would move 4x faster than possible

This commit is contained in:
BallOfEnergy 2023-11-28 21:28:54 -06:00
parent 533c87eb1a
commit c86e52f5c0
2 changed files with 14 additions and 5 deletions

View File

@ -10,12 +10,14 @@ import com.hbm.inventory.fluid.Fluids;
* Mostly just functions used across many TEs. * Mostly just functions used across many TEs.
*/ */
public class CompatHandler { public class CompatHandler {
public static Object[] steamTypeToInt(FluidType type) { public static Object[] steamTypeToInt(FluidType type) {
if(type == Fluids.STEAM) {return new Object[] {0};} if(type == Fluids.STEAM) {return new Object[] {0};} //switches break because objects
else if(type == Fluids.HOTSTEAM) {return new Object[] {1};} else if(type == Fluids.HOTSTEAM) {return new Object[] {1};}
else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};} else if(type == Fluids.SUPERHOTSTEAM) {return new Object[] {2};}
return new Object[] {3}; return new Object[] {3};
} }
public static FluidType intToSteamType(int arg) { public static FluidType intToSteamType(int arg) {
switch(arg) { switch(arg) {
default: default:
@ -28,4 +30,5 @@ public class CompatHandler {
return Fluids.ULTRAHOTSTEAM; return Fluids.ULTRAHOTSTEAM;
} }
} }
} }

View File

@ -339,12 +339,13 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
return "rbmk_crane"; return "rbmk_crane";
} }
@Callback(direct = true, limit = 4) @Callback(direct = true, limit = 2) //yknow computers are more efficient than humans, lets give an incentive to use OC
@Optional.Method(modid = "OpenComputers") @Optional.Method(modid = "OpenComputers")
public Object[] move(Context context, Arguments args) { public Object[] move(Context context, Arguments args) {
if(setUpCrane) { if(setUpCrane) {
String textbruh = args.checkString(0); String direction = args.checkString(0);
switch(textbruh) {
switch(direction) {
case "up": case "up":
tiltFront = 30; tiltFront = 30;
if(!worldObj.isRemote) posFront += speed; if(!worldObj.isRemote) posFront += speed;
@ -368,7 +369,7 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
return new Object[] {"Crane not found"}; return new Object[] {"Crane not found"};
} }
@Callback(direct = true, limit = 4) @Callback
@Optional.Method(modid = "OpenComputers") @Optional.Method(modid = "OpenComputers")
public Object[] load(Context context, Arguments args) { public Object[] load(Context context, Arguments args) {
if (setUpCrane) { if (setUpCrane) {
@ -395,4 +396,9 @@ public class TileEntityCraneConsole extends TileEntity implements INBTPacketRece
} }
return new Object[] {"N/A"}; return new Object[] {"N/A"};
} }
@Callback(direct = true)
@Optional.Method(modid = "OpenComputers")
public Object[] getCoords(Context context, Arguments args) {
return new Object[] {xCoord, yCoord, zCoord};
}
} }