mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2024-11-22 11:56:21 +01:00
Started with fixing passenger offsets
This commit is contained in:
parent
6ac8ec625d
commit
d01f2913fb
@ -36,11 +36,11 @@ public abstract class MixinAllayEntity extends PathAwareEntity {
|
||||
}
|
||||
|
||||
@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();
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -133,11 +133,4 @@ public abstract class MixinPlayerEntity extends LivingEntity {
|
||||
}
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user