Skip to content

Commit

Permalink
Pests Destroyer:
Browse files Browse the repository at this point in the history
 = Jiggling at the end fixed
  • Loading branch information
May2Beez committed Mar 8, 2024
1 parent 74c5ef5 commit 1300155
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ mcVersion=1.8.9
modid=farmhelperv2
modName=FarmHelper
version=2.4.5-pre27
shouldRelease=false
shouldRelease=true
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.settings.KeyBinding;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityArmorStand;
import net.minecraft.pathfinding.PathEntity;
import net.minecraft.pathfinding.PathFinder;
import net.minecraft.pathfinding.PathPoint;
Expand Down Expand Up @@ -369,10 +370,16 @@ public void onTickNeededYaw(TickEvent.ClientTickEvent event) {
}
if (targetEntity != null) {
float velocity = (float) Math.sqrt(mc.thePlayer.motionX * mc.thePlayer.motionX + mc.thePlayer.motionZ * mc.thePlayer.motionZ);
if (targetEntity instanceof EntityArmorStand) {
Entity properEntity = PlayerUtils.getEntityCuttingOtherEntity(targetEntity, e -> !(e instanceof EntityArmorStand));
if (properEntity != null) {
targetEntity = properEntity;
}
}
float entityVelocity = (float) Math.sqrt(targetEntity.motionX * targetEntity.motionX + targetEntity.motionZ * targetEntity.motionZ);
Vec3 targetPos = targetEntity.getPositionVector().addVector(0, this.yModifier, 0);
if (entityVelocity > 0.12) {
targetPos = targetPos.addVector(targetEntity.motionX * 1, targetEntity.motionY, targetEntity.motionZ * 1);
if (entityVelocity > 0.1) {
targetPos = targetPos.addVector(targetEntity.motionX * 1.3, targetEntity.motionY, targetEntity.motionZ * 1.3);
}
float distance = (float) mc.thePlayer.getPositionVector().distanceTo(targetPos);
float distancePath = (float) mc.thePlayer.getPositionVector().distanceTo(copyPath.get(copyPath.size() - 1));
Expand Down

0 comments on commit 1300155

Please sign in to comment.