version 0.0.8-hotfix
This commit is contained in:
parent
64e45d3000
commit
bff4a8bfdf
|
|
@ -27,6 +27,7 @@ import net.minecraft.world.entity.Entity;
|
||||||
import net.minecraft.world.entity.player.Player;
|
import net.minecraft.world.entity.player.Player;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
import net.minecraftforge.common.util.FakePlayer;
|
||||||
import net.minecraftforge.eventbus.api.IEventBus;
|
import net.minecraftforge.eventbus.api.IEventBus;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
|
@ -71,6 +72,7 @@ public class AnimationUtils {
|
||||||
return ANIMATION_RUNNER.testLoadedAndCall(() -> {
|
return ANIMATION_RUNNER.testLoadedAndCall(() -> {
|
||||||
if(isAnimationLayerPresent(layer) && (animation == null || isAnimationPresent(animation))) {
|
if(isAnimationLayerPresent(layer) && (animation == null || isAnimationPresent(animation))) {
|
||||||
if(player instanceof ServerPlayer serverPlayer) {
|
if(player instanceof ServerPlayer serverPlayer) {
|
||||||
|
if(serverPlayer instanceof FakePlayer) return false;
|
||||||
return AnimationPlayer.serverPlayAnimation(serverPlayer, layer, animation);
|
return AnimationPlayer.serverPlayAnimation(serverPlayer, layer, animation);
|
||||||
}else if(player == null || player instanceof AbstractClientPlayer) {
|
}else if(player == null || player instanceof AbstractClientPlayer) {
|
||||||
AnimationPlayer.requestAnimationToServer((AbstractClientPlayer) player, layer, animation);
|
AnimationPlayer.requestAnimationToServer((AbstractClientPlayer) player, layer, animation);
|
||||||
|
|
@ -119,10 +121,10 @@ public class AnimationUtils {
|
||||||
Animation anim = AnimationUtils.getAnimation(animation);
|
Animation anim = AnimationUtils.getAnimation(animation);
|
||||||
if(anim != null && anim.getRide() == null) return false;
|
if(anim != null && anim.getRide() == null) return false;
|
||||||
if(serverPlayer != null) {
|
if(serverPlayer != null) {
|
||||||
|
if(serverPlayer instanceof FakePlayer) return false;
|
||||||
if(serverPlayer.getVehicle() != null && force) serverPlayer.unRide();
|
if(serverPlayer.getVehicle() != null && force) serverPlayer.unRide();
|
||||||
else if(serverPlayer.getVehicle() != null) return false;
|
else if(serverPlayer.getVehicle() != null) return false;
|
||||||
return AnimationPlayer.playAnimationWithRide(serverPlayer, layer, animation, true);
|
return AnimationPlayer.playAnimationWithRide(serverPlayer, layer, animation, true);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
AnimationPlayer.requestAnimationRideToServer(layer, animation, force);
|
AnimationPlayer.requestAnimationRideToServer(layer, animation, force);
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||||
|
|
||||||
@Mixin(Entity.class)
|
@Mixin(Entity.class)
|
||||||
public abstract class MixinEntity {
|
public abstract class MixinEntity {
|
||||||
@Shadow
|
|
||||||
private float eyeHeight;
|
|
||||||
|
|
||||||
@Shadow public abstract float getEyeHeight(Pose pPose);
|
@Shadow public abstract float getEyeHeight(Pose pPose);
|
||||||
|
|
||||||
@Shadow private AABB bb;
|
@Shadow private AABB bb;
|
||||||
|
|
@ -46,8 +43,7 @@ public abstract class MixinEntity {
|
||||||
camYModifier = Math.min(camYModifier, animationCamY);
|
camYModifier = Math.min(camYModifier, animationCamY);
|
||||||
}
|
}
|
||||||
if(camYModifier != null){
|
if(camYModifier != null){
|
||||||
this.eyeHeight = this.getEyeHeight(Pose.STANDING) + camYModifier;
|
cir.setReturnValue(this.getEyeHeight(Pose.STANDING) + camYModifier);
|
||||||
cir.setReturnValue(this.eyeHeight);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user