Skip to content

Commit

Permalink
Implemented yOffset change in 1.19 -> 1.18.2
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Nov 12, 2023
1 parent aa71918 commit 37c9112
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -177,9 +177,10 @@ public void revertOnLanding(Entity instance) {

@Inject(method = "getPosWithYOffset", at = @At("HEAD"), cancellable = true)
public void changeLogic(float offset, CallbackInfoReturnable<BlockPos> cir) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
final VersionEnum target = ProtocolHack.getTargetVersion();
if (target.isOlderThanOrEqualTo(VersionEnum.r1_19_4)) {
int i = MathHelper.floor(this.pos.x);
int j = MathHelper.floor(this.pos.y - (double)offset);
int j = MathHelper.floor(this.pos.y - (double) (target.isOlderThanOrEqualTo(VersionEnum.r1_18_2) && offset == 1.0E-5F ? 0.2F : offset));
int k = MathHelper.floor(this.pos.z);
BlockPos blockPos = new BlockPos(i, j, k);
if (this.world.getBlockState(blockPos).isAir()) {
Expand Down

0 comments on commit 37c9112

Please sign in to comment.