forked from virt-mirrors/Sit
fixed sitting height update for 1.20.2+
This commit is contained in:
parent
ac9dc8943c
commit
9b51b1c0ec
1 changed files with 4 additions and 2 deletions
|
@ -159,10 +159,12 @@ public class Events {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
entity.updatePositionAndAngles(entity.getX(),entity.getY(),entity.getZ(),0,0);
|
//1.20.2 mounting pos change (shifts everything down by .25)
|
||||||
|
double oneTwentyTwo = .25;
|
||||||
|
entity.updatePositionAndAngles(entity.getX(),entity.getY()+oneTwentyTwo,entity.getZ(),0,0);
|
||||||
entity.setBoundingBox(Box.of(Vec3d.of(pos),1.5,hitBoxY,1.5));
|
entity.setBoundingBox(Box.of(Vec3d.of(pos),1.5,hitBoxY,1.5));
|
||||||
//change pitch based on if player is sitting below block height or not
|
//change pitch based on if player is sitting below block height or not
|
||||||
if (entity.getY() <= pos.getY()+.35) entity.setPitch(90); // below
|
if (entity.getY() <= pos.getY()+.35+oneTwentyTwo) entity.setPitch(90); // below
|
||||||
else entity.setPitch(-90); // above
|
else entity.setPitch(-90); // above
|
||||||
}
|
}
|
||||||
public static void register() {
|
public static void register() {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue