Started with fixing passenger offsets

This commit is contained in:
FlorianMichael 2023-09-23 20:23:36 +02:00
parent 6ac8ec625d
commit d01f2913fb
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
2 changed files with 2 additions and 9 deletions

View File

@ -36,11 +36,11 @@ public abstract class MixinAllayEntity extends PathAwareEntity {
} }
@Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true) @Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true)
public void changeHeightOffset(CallbackInfoReturnable<Double> cir) { public void changeHeightOffset(CallbackInfoReturnable<Float> cir) {
final var ver = ProtocolHack.getTargetVersion(); final var ver = ProtocolHack.getTargetVersion();
if (ver.isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) { if (ver.isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
cir.setReturnValue(ver.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2) ? 0.0 : 0.4); cir.setReturnValue(ver.isOlderThanOrEqualTo(VersionEnum.r1_19_1tor1_19_2) ? 0.0F : 0.4F);
} }
} }
} }

View File

@ -133,11 +133,4 @@ public abstract class MixinPlayerEntity extends LivingEntity {
} }
return instance.isSprinting(); return instance.isSprinting();
} }
@Inject(method = "getUnscaledRidingOffset", at = @At("HEAD"), cancellable = true)
public void setStaticScale(Entity vehicle, CallbackInfoReturnable<Float> cir) {
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_20tor1_20_1)) {
cir.setReturnValue(-0.35F);
}
}
} }