Skip to content

Commit

Permalink
= Dirt Check - Spam fix
Browse files Browse the repository at this point in the history
= Pests Destroyer - Small distance tweak
  • Loading branch information
May2Beez committed Jan 13, 2024
1 parent 9a4b600 commit 0ae399a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ baseGroup=com.jelly.farmhelperv2
mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.4.1-pre9
version=2.4.1-pre10
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public boolean shouldAltTab() {
@Override
public void onBlockChange(BlockChangeEvent event) {
if (FailsafeManager.getInstance().firstCheckReturn()) return;
if (event.update.getBlock() == null || event.update.getBlock().equals(Blocks.air) || CropUtils.isCrop(event.update.getBlock()))
if ((!event.old.getBlock().equals(Blocks.air) && !CropUtils.isCrop(event.old.getBlock())) || event.update.getBlock() == null || event.update.getBlock().equals(Blocks.air) || CropUtils.isCrop(event.update.getBlock()))
return;

LogUtils.sendWarning("[Failsafe] Someone put a block on your garden! Block pos: " + event.pos);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ public void onTickReconnect(TickEvent.ClientTickEvent event) {
for (Map.Entry<String, JsonElement> header : headers.entrySet()) {
client.addHeader(header.getKey(), header.getValue().getAsString());
}
lastReceivedPacket = System.currentTimeMillis();
client.connect();
}, 0, TimeUnit.MILLISECONDS);
} catch (Exception e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -991,7 +991,7 @@ private void manipulateHeight(Entity entity, double distance, double distanceWit
Vec3 playerPos = new Vec3(mc.thePlayer.posX, mc.thePlayer.posY, mc.thePlayer.posZ);
List<KeyBinding> keyBindings = new ArrayList<>(KeyBindUtils.getNeededKeyPresses(playerPos, target));
if (objectsInFrontOfPlayer() || entity.posY + entity.getEyeHeight() + 1 - mc.thePlayer.posY >= 2) {
if (distanceWithoutY <= 2.5) {
if (distanceWithoutY <= 1.5) {
keyBindings.clear();
keyBindings.addAll(KeyBindUtils.getKeyPressesToDecelerate());
}
Expand All @@ -1014,7 +1014,7 @@ private void manipulateHeight(Entity entity, double distance, double distanceWit
KeyBindUtils.holdThese(distance < 6 ? mc.gameSettings.keyBindUseItem : null, !mc.thePlayer.onGround ? mc.gameSettings.keyBindSneak : null, distanceWithoutY > 6 && yawDifference < 25 ? mc.gameSettings.keyBindForward : null, distanceWithoutY < 1 && (GameStateHandler.getInstance().getDx() > 0.04 || GameStateHandler.getInstance().getDz() > 0.04) ? mc.gameSettings.keyBindBack : null, distanceWithoutY > 7 && yawDifference < 25 ? FarmHelperConfig.sprintWhileFlying ? mc.gameSettings.keyBindSprint : null : null);
}
} else {
if (distanceWithoutY <= 2.5 || distance <= 3.5) {
if (distanceWithoutY <= 1.5 || distance <= 3.5) {
keyBindings.clear();
keyBindings.addAll(KeyBindUtils.getKeyPressesToDecelerate());
}
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/com/jelly/farmhelperv2/util/CropUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ public static void updateCocoaBeansHitbox(IBlockState blockState) {
}

public static boolean isCrop(Block block) {
return block instanceof BlockCrops || block instanceof BlockPotato || block instanceof BlockCarrot || block instanceof BlockNetherWart || block instanceof BlockCocoa || block instanceof BlockCactus || block instanceof BlockReed;
return block instanceof BlockCrops ||
block instanceof BlockPotato ||
block instanceof BlockCarrot ||
block instanceof BlockNetherWart ||
block instanceof BlockCocoa ||
block instanceof BlockCactus ||
block instanceof BlockReed ||
block instanceof BlockPumpkin ||
block instanceof BlockMelon ||
block instanceof BlockStem;
}
}

0 comments on commit 0ae399a

Please sign in to comment.