Skip to content

Commit

Permalink
Pests Destroyer:
Browse files Browse the repository at this point in the history
 + Support poor (first) tier of Vacuum, as Hypixel added ability to it
  • Loading branch information
May2Beez committed Apr 21, 2024
1 parent a778eef commit 7dd893b
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 37 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.6.0
version=2.6.1
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -251,14 +251,6 @@ public boolean canEnableMacro(boolean manually) {
LogUtils.sendError("[Pests Destroyer] Pests Destroyer won't activate during Jacob's Contest!");
return false;
}
if (InventoryUtils.hasItemInHotbar("SkyMart Vacuum")) {
LogUtils.sendError("[Pests Destroyer] You need higher tier (at least second) of Vacuum to use Pests Destroyer!");
if (FarmHelperConfig.pestsDestroyerAfkInfiniteMode) {
LogUtils.sendWarning("[Pests Destroyer] Disabling Pests Destroyer AFK Infinite Mode!");
FarmHelperConfig.pestsDestroyerAfkInfiniteMode = false;
}
return false;
}
if (!mc.thePlayer.capabilities.allowFlying) {
LogUtils.sendError("[Pests Destroyer] You need to be able to fly!");
if (FarmHelperConfig.pestsDestroyerAfkInfiniteMode) {
Expand Down Expand Up @@ -1041,28 +1033,25 @@ public void onRender(RenderWorldLastEvent event) {
if (entity instanceof EntityArmorStand) {
if (killedEntities.contains(entity)) return false;
ItemStack itemStack = ((EntityArmorStand) entity).getEquipmentInSlot(4);
if (itemStack != null && itemStack.hasTagCompound()) {
String displayName = itemStack.getTagCompound().toString();
if (!displayName.contains("display:")) {
if (this.pests.stream().anyMatch(pest -> displayName.contains(pest.getSecond()))) {
if (killedEntities.contains(entity)) return false;
Entity realEntity = PlayerUtils.getEntityCuttingOtherEntity(entity, (e) -> e instanceof EntityBat || e instanceof EntitySilverfish);
Entity nameEntity = PlayerUtils.getEntityCuttingOtherEntity(entity, (e) -> e instanceof EntityArmorStand && e != entity);
if (realEntity != null && (killedEntities.contains(realEntity) || realEntity.isDead)) {
return false;
}
if (nameEntity != null && (killedEntities.contains(nameEntity))) {
return false;
}
if (killedEntities.stream().noneMatch(ke -> ke.getDistanceToEntity(entity) < 1.5)) {
if (!FarmHelperConfig.streamerMode)
drawESP(entity);
return true;
}
return false;
}
}
if (itemStack == null || !itemStack.hasTagCompound()) return false;
String displayName = itemStack.getTagCompound().toString();
if (displayName.contains("display:")) return false;
if (this.pests.stream().noneMatch(pest -> displayName.contains(pest.getSecond()))) return false;
if (killedEntities.contains(entity)) return false;
Entity realEntity = PlayerUtils.getEntityCuttingOtherEntity(entity, (e) -> e instanceof EntityBat || e instanceof EntitySilverfish);
Entity nameEntity = PlayerUtils.getEntityCuttingOtherEntity(entity, (e) -> e instanceof EntityArmorStand && e != entity);
if (realEntity != null && (killedEntities.contains(realEntity) || realEntity.isDead)) {
return false;
}
if (nameEntity != null && (killedEntities.contains(nameEntity))) {
return false;
}
if (killedEntities.stream().noneMatch(ke -> ke.getDistanceToEntity(entity) < 1.5)) {
if (!FarmHelperConfig.streamerMode)
drawESP(entity);
return true;
}
return false;
}
return false;
}).collect(Collectors.toList());
Expand Down
15 changes: 8 additions & 7 deletions src/main/java/com/jelly/farmhelperv2/macro/AbstractMacro.java
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,6 @@ public void onTick() {
return;
}

if (FarmHelperConfig.autoSwitchTool) {
FarmHelperConfig.CropEnum crop = PlayerUtils.getCropBasedOnMouseOver();
if (crop != FarmHelperConfig.CropEnum.NONE && crop != MacroHandler.getInstance().getCrop()) {
LogUtils.sendWarning("Crop changed from " + MacroHandler.getInstance().getCrop() + " to " + crop);
MacroHandler.getInstance().setCrop(crop);
}
}

if (getRotation().isRotating()) {
if (!mc.gameSettings.keyBindSneak.isKeyDown())
Expand All @@ -175,6 +168,14 @@ public void onTick() {
return;
}

if (FarmHelperConfig.autoSwitchTool) {
FarmHelperConfig.CropEnum crop = PlayerUtils.getCropBasedOnMouseOver();
if (crop != FarmHelperConfig.CropEnum.NONE && crop != MacroHandler.getInstance().getCrop()) {
LogUtils.sendWarning("Crop changed from " + MacroHandler.getInstance().getCrop() + " to " + crop);
MacroHandler.getInstance().setCrop(crop);
}
}

if (rewarpDelay.isScheduled() && !rewarpDelay.passed()) {
return;
}
Expand Down

0 comments on commit 7dd893b

Please sign in to comment.