mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 12:37:59 +01:00
Fix fillycam
This commit is contained in:
parent
eeea8ee184
commit
85726e8c8d
3 changed files with 17 additions and 13 deletions
|
@ -53,8 +53,11 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe
|
|||
@Override
|
||||
public Pony getPony(PlayerEntity player) {
|
||||
final UUID id = player instanceof ForcedPony ? null : player.getGameProfile() == null ? player.getUuid() : player.getGameProfile().getId();
|
||||
@Nullable
|
||||
Identifier skin = getSkin(player);
|
||||
if (skin != null) {
|
||||
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(player, s -> getPony(s, id), skin), skin);
|
||||
}
|
||||
return getPony(skin, id);
|
||||
}
|
||||
|
||||
|
@ -63,8 +66,11 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe
|
|||
if (entity instanceof PlayerEntity player) {
|
||||
return Optional.of(getPony(player));
|
||||
}
|
||||
@Nullable
|
||||
Identifier skin = getSkin(entity);
|
||||
if (skin != null) {
|
||||
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(entity, s -> getPony(s, null), skin), skin);
|
||||
}
|
||||
return skin == null ? Optional.empty() : Optional.of(getPony(skin, null));
|
||||
}
|
||||
|
||||
|
|
|
@ -10,12 +10,11 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
|||
|
||||
import com.minelittlepony.api.pony.Pony;
|
||||
|
||||
@Mixin(LivingEntity.class)
|
||||
abstract class MixinLivingEntity {
|
||||
@Mixin(PlayerEntity.class)
|
||||
abstract class MixinPlayerEntity {
|
||||
@Inject(method = "getBaseDimensions", at = @At("RETURN"), cancellable = true)
|
||||
private void onGetBaseDimensions(EntityPose pose, CallbackInfoReturnable<EntityDimensions> info) {
|
||||
if (((Object)this) instanceof PlayerEntity player) {
|
||||
Pony pony = Pony.getManager().getPony(player);
|
||||
Pony pony = Pony.getManager().getPony((PlayerEntity)(Object)this);
|
||||
|
||||
if (!pony.race().isHuman()) {
|
||||
float factor = pony.size().eyeHeightFactor();
|
||||
|
@ -26,4 +25,3 @@ abstract class MixinLivingEntity {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,7 +12,7 @@
|
|||
"MixinSkullBlockEntityRenderer",
|
||||
"MixinHeldItemRenderer",
|
||||
"MixinClientPlayerEntity",
|
||||
"MixinLivingEntity",
|
||||
"MixinPlayerEntity",
|
||||
"MixinPlayerMoveC2SPacket",
|
||||
"MixinPlayerPositionLookS2CPacket",
|
||||
"MixinVertextConsumers",
|
||||
|
|
Loading…
Reference in a new issue