Skip to content

Commit ee9a58f

Browse files
committed
new antistuck
1 parent 82c0473 commit ee9a58f

File tree

4 files changed

+28
-22
lines changed

4 files changed

+28
-22
lines changed

src/main/java/com/jelly/farmhelper/FarmHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
public class FarmHelper {
2424
public static final String MODID = "farmhelper";
2525
public static final String NAME = "Farm Helper";
26-
public static final String VERSION = "3.0-beta5.0.2";
26+
public static final String VERSION = "4.0";
2727
public static int tickCount = 0;
2828
public static boolean openedGUI = false;
2929
private static final Minecraft mc = Minecraft.getMinecraft();

src/main/java/com/jelly/farmhelper/features/Failsafe.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package com.jelly.farmhelper.features;
22

3-
import com.jelly.farmhelper.FarmHelper;
43
import com.jelly.farmhelper.config.interfaces.JacobConfig;
5-
import com.jelly.farmhelper.config.interfaces.MiscConfig;
64
import com.jelly.farmhelper.macros.MacroHandler;
75
import com.jelly.farmhelper.utils.Clock;
86
import com.jelly.farmhelper.utils.LogUtils;

src/main/java/com/jelly/farmhelper/macros/Macro.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,6 @@ public void toggle() {
2727
public abstract void onChatMessageReceived(String msg);
2828

2929
public abstract void onOverlayRender(RenderGameOverlayEvent event);
30+
31+
3032
}

src/main/java/com/jelly/farmhelper/macros/SugarcaneMacro.java

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,19 @@ enum State {
4444

4545
@Override
4646
public void onEnable() {
47-
initializeVariables();
47+
LogUtils.scriptLog("Enabling");
48+
pushedOff = false;
49+
stuck = false;
50+
setspawnLag = false;
4851
mc.thePlayer.closeScreen();
49-
enabled = true;
50-
playerYaw = AngleUtils.get360RotationYaw(AngleUtils.getClosest());
51-
rotation.easeTo(playerYaw, 0, 500);
52+
if(gameState.currentLocation == GameState.location.ISLAND) {
53+
playerYaw = AngleUtils.get360RotationYaw(AngleUtils.getClosest());
54+
rotation.easeTo(playerYaw, 0, 500);
55+
}
5256
currentState = State.NONE;
5357
lastState = State.NONE;
5458
targetBlockPos = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ);
59+
enabled = true;
5560
}
5661

5762
@Override
@@ -164,26 +169,26 @@ public void onTick() {
164169
return;
165170
}
166171
case DROPPING: {
167-
LogUtils.debugFullLog("Rotating");
172+
LogUtils.debugFullLog("Dropping - Rotating");
168173
if (!rotation.completed) {
169174
if (!rotation.rotating) {
170175
if (mc.thePlayer.posY - mc.thePlayer.lastTickPosY == 0) {
171-
LogUtils.debugFullLog("Rotating " + getRotateAmount());
176+
LogUtils.debugFullLog("Dropping - Rotating " + getRotateAmount());
172177
rotation.reset();
173178
playerYaw = AngleUtils.get360RotationYaw(playerYaw + getRotateAmount());
174179
rotation.easeTo(playerYaw, 0, 2000);
175180
}
176181
}
177-
LogUtils.debugFullLog("Waiting Rotating");
182+
LogUtils.debugFullLog("Dropping - Waiting Rotating");
178183
updateKeys(false, false, false, false, false);
179184
} else {
180185
if (mc.thePlayer.posY % 1 == 0) {
181-
LogUtils.debugFullLog("Dropped, resuming");
186+
LogUtils.debugFullLog("Dropping - Dropped, resuming");
182187
targetBlockPos = new BlockPos(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ);
183188
currentState = State.NONE;
184189
lastState = State.NONE;
185190
} else {
186-
LogUtils.debugFullLog("Falling");
191+
LogUtils.debugFullLog("Dropping - Falling");
187192
}
188193
updateKeys(false, false, false, false, false);
189194
}
@@ -246,11 +251,19 @@ private void updateState() {
246251
try {
247252
Thread.sleep(20);
248253
updateKeys(false, true, false, false, false);
249-
Thread.sleep(500);
254+
Thread.sleep(200);
250255
updateKeys(false, false, false, false, false);
251256
Thread.sleep(200);
252257
updateKeys(true, false, false, false, false);
253-
Thread.sleep(500);
258+
Thread.sleep(200);
259+
updateKeys(false, false, false, false, false);
260+
Thread.sleep(200);
261+
updateKeys(false, false, true, false, false);
262+
Thread.sleep(200);
263+
updateKeys(false, false, false, false, false);
264+
Thread.sleep(200);
265+
updateKeys(false, false, false, true, false);
266+
Thread.sleep(200);
254267
updateKeys(false, false, false, false, false);
255268
Thread.sleep(200);
256269
stuck = false;
@@ -319,17 +332,10 @@ int getRotateAmount() {
319332
LogUtils.scriptLog("Unknown rotation case, if you are not in failsafe, " +
320333
"tell this to JellyLab#2505 and provide a screenshot of your drop system" + BlockUtils.getRelativeBlock(-1, 0, -5) + " " + BlockUtils.getRelativeBlock(1, 0, -5) +
321334
" " + BlockUtils.getRelativeBlock(-2, 0, -1) + " " + BlockUtils.getRelativeBlock(2, 0, -1));
322-
return 0;
335+
return 180;
323336
}
324337

325338

326-
void initializeVariables() {
327-
pushedOff = false;
328-
currentState = calculateDirection();
329-
stuck = false;
330-
setspawnLag = false;
331-
}
332-
333339
public static boolean isInCenterOfBlock() {
334340
return (Math.round(AngleUtils.get360RotationYaw()) == 180 || Math.round(AngleUtils.get360RotationYaw()) == 0) ? Math.abs(Minecraft.getMinecraft().thePlayer.posZ) % 1 > 0.3f && Math.abs(Minecraft.getMinecraft().thePlayer.posZ) % 1 < 0.7f :
335341
Math.abs(Minecraft.getMinecraft().thePlayer.posX) % 1 > 0.3f && Math.abs(Minecraft.getMinecraft().thePlayer.posX) % 1 < 0.7f;

0 commit comments

Comments
 (0)