fix CCGT allowing throttle over max when using OpenComputers callbacks

This commit is contained in:
PewPewCricket 2025-07-17 14:46:57 -05:00
parent 5fb88801ec
commit 8686a64141

View File

@ -619,8 +619,11 @@ public class TileEntityMachineTurbineGas extends TileEntityMachineBase implement
@Callback(direct = true, limit = 4) @Callback(direct = true, limit = 4)
@Optional.Method(modid = "OpenComputers") @Optional.Method(modid = "OpenComputers")
public Object[] setThrottle(Context context, Arguments args) { public Object[] setThrottle(Context context, Arguments args) {
powerSliderPos = (int) (args.checkInteger(0) * 60D / 100D); double input = args.checkInteger(0) * 60D / 100D;
return new Object[] {}; if (input < 0 || input > 100)
return new Object[] {null, "Input out of range."};
powerSliderPos = (int) (input);
return new Object[] {true};
} }
@Callback(direct = true, limit = 4) @Callback(direct = true, limit = 4)