more betterer rotations (bigger?)
All checks were successful
/ Build BaseBand DSM & Broadway (push) Successful in 2m15s

This commit is contained in:
Jess H 2024-06-17 10:25:13 +01:00
parent 3b6390c4a4
commit 3cfcf255fc
Signed by: UnixSystemV
GPG key ID: 9B21C50B68D67F19

View file

@ -20,28 +20,25 @@ public class AutoMount extends Feature {
Entity entity = null;
public void preMotion(MotionUpdateEvent.Pre event) {
if (mc.player.getRidingEntity() != null)
return;
for (Entity e : mc.world.loadedEntityList) {
if (valid(e)) {
Vec2f rot = RotationUtil.getRotationTo(e.getPositionVector());
event.pitch = rot.y;
event.yaw = rot.x;
entity = e;
break;
}
if(entity != null && mc.player.getRidingEntity() == null) {
Vec2f rot = RotationUtil.getRotationTo(entity.getPositionVector());
event.pitch = rot.y;
event.yaw = rot.x;
}
}
public void postMotion(MotionUpdateEvent.Post event) {
if (mc.player.getRidingEntity() != null)
return;
if(entity != null) {
if(entity != null && mc.player.getRidingEntity() == null) {
mc.playerController.interactWithEntity(mc.player, entity, EnumHand.MAIN_HAND);
entity = null;
}
for (Entity e : mc.world.loadedEntityList) {
if (valid(e)) {
entity = e;
break;
}
}
}
boolean valid(Entity entity) {