mirror of
https://github.com/ViaVersion/ViaFabricPlus.git
synced 2025-02-02 23:31:36 +01:00
This commit is contained in:
parent
023708dd3c
commit
4e6ed57fa5
@ -178,12 +178,9 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
|||||||
@Redirect(method = "autoJump", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;inverseSqrt(F)F"))
|
@Redirect(method = "autoJump", at = @At(value = "INVOKE", target = "Lnet/minecraft/util/math/MathHelper;inverseSqrt(F)F"))
|
||||||
public float useFastInverse(float x) {
|
public float useFastInverse(float x) {
|
||||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) {
|
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_19_3)) {
|
||||||
final float var1 = 0.5F * x;
|
x = Float.intBitsToFloat(1597463007 - (Float.floatToIntBits(x) >> 1));
|
||||||
int var2 = Float.floatToIntBits(x);
|
|
||||||
var2 = 1597463007 - (var2 >> 1);
|
|
||||||
x = Float.intBitsToFloat(var2);
|
|
||||||
|
|
||||||
return x * (1.5F - var1 * x * x);
|
return x * (1.5F - (0.5F * x) * x * x);
|
||||||
}
|
}
|
||||||
return MathHelper.inverseSqrt(x);
|
return MathHelper.inverseSqrt(x);
|
||||||
}
|
}
|
||||||
@ -191,6 +188,7 @@ public abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity
|
|||||||
@Override
|
@Override
|
||||||
public boolean isCreative() {
|
public boolean isCreative() {
|
||||||
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) {
|
if (ProtocolHack.getTargetVersion().isOlderThanOrEqualTo(VersionEnum.r1_7_6tor1_7_10)) {
|
||||||
|
if (client.interactionManager == null) return super.isCreative(); // Fixes https://github.com/ViaVersion/ViaFabricPlus/issues/216
|
||||||
return client.interactionManager.getCurrentGameMode() == GameMode.CREATIVE;
|
return client.interactionManager.getCurrentGameMode() == GameMode.CREATIVE;
|
||||||
}
|
}
|
||||||
return super.isCreative();
|
return super.isCreative();
|
||||||
|
Loading…
Reference in New Issue
Block a user