From 69a01f00e6287a7c039a3b895745092017be34f6 Mon Sep 17 00:00:00 2001 From: LemADEC Date: Sat, 6 Sep 2014 19:32:52 +0200 Subject: [PATCH] Fixed energy exploit Fixed energy gain when using negative distance in jump core --- src/cr0s/WarpDrive/machines/TileEntityProtocol.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cr0s/WarpDrive/machines/TileEntityProtocol.java b/src/cr0s/WarpDrive/machines/TileEntityProtocol.java index 9de04878..228f8656 100644 --- a/src/cr0s/WarpDrive/machines/TileEntityProtocol.java +++ b/src/cr0s/WarpDrive/machines/TileEntityProtocol.java @@ -304,7 +304,7 @@ public class TileEntityProtocol extends TileEntity implements IPeripheral } public void setDistance(int distance) { - this.distance = Math.min(WarpDriveConfig.WC_MAX_JUMP_DISTANCE, distance); + this.distance = Math.max(1, Math.min(WarpDriveConfig.WC_MAX_JUMP_DISTANCE, distance)); WarpDrive.debugPrint(this + " Jump distance updated to " + distance); } @@ -495,6 +495,7 @@ public class TileEntityProtocol extends TileEntity implements IPeripheral setDistance(argInt0); + return new Integer[] { getDistance() }; } else if (methodName.equals("set_direction")) {// set_direction (dir) if (arguments.length != 1) { return new Integer[] { -1 };