mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-16 17:44:23 +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
|
@Override
|
||||||
public Pony getPony(PlayerEntity player) {
|
public Pony getPony(PlayerEntity player) {
|
||||||
final UUID id = player instanceof ForcedPony ? null : player.getGameProfile() == null ? player.getUuid() : player.getGameProfile().getId();
|
final UUID id = player instanceof ForcedPony ? null : player.getGameProfile() == null ? player.getUuid() : player.getGameProfile().getId();
|
||||||
|
@Nullable
|
||||||
Identifier skin = getSkin(player);
|
Identifier skin = getSkin(player);
|
||||||
|
if (skin != null) {
|
||||||
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(player, s -> getPony(s, id), skin), skin);
|
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(player, s -> getPony(s, id), skin), skin);
|
||||||
|
}
|
||||||
return getPony(skin, id);
|
return getPony(skin, id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -63,8 +66,11 @@ public class PonyManagerImpl implements PonyManager, SimpleSynchronousResourceRe
|
||||||
if (entity instanceof PlayerEntity player) {
|
if (entity instanceof PlayerEntity player) {
|
||||||
return Optional.of(getPony(player));
|
return Optional.of(getPony(player));
|
||||||
}
|
}
|
||||||
|
@Nullable
|
||||||
Identifier skin = getSkin(entity);
|
Identifier skin = getSkin(entity);
|
||||||
|
if (skin != null) {
|
||||||
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(entity, s -> getPony(s, null), skin), skin);
|
skin = MoreObjects.firstNonNull(PonySkinResolver.EVENT.invoker().onPonySkinResolving(entity, s -> getPony(s, null), skin), skin);
|
||||||
|
}
|
||||||
return skin == null ? Optional.empty() : Optional.of(getPony(skin, null));
|
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;
|
import com.minelittlepony.api.pony.Pony;
|
||||||
|
|
||||||
@Mixin(LivingEntity.class)
|
@Mixin(PlayerEntity.class)
|
||||||
abstract class MixinLivingEntity {
|
abstract class MixinPlayerEntity {
|
||||||
@Inject(method = "getBaseDimensions", at = @At("RETURN"), cancellable = true)
|
@Inject(method = "getBaseDimensions", at = @At("RETURN"), cancellable = true)
|
||||||
private void onGetBaseDimensions(EntityPose pose, CallbackInfoReturnable<EntityDimensions> info) {
|
private void onGetBaseDimensions(EntityPose pose, CallbackInfoReturnable<EntityDimensions> info) {
|
||||||
if (((Object)this) instanceof PlayerEntity player) {
|
Pony pony = Pony.getManager().getPony((PlayerEntity)(Object)this);
|
||||||
Pony pony = Pony.getManager().getPony(player);
|
|
||||||
|
|
||||||
if (!pony.race().isHuman()) {
|
if (!pony.race().isHuman()) {
|
||||||
float factor = pony.size().eyeHeightFactor();
|
float factor = pony.size().eyeHeightFactor();
|
||||||
|
@ -26,4 +25,3 @@ abstract class MixinLivingEntity {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
|
@ -12,7 +12,7 @@
|
||||||
"MixinSkullBlockEntityRenderer",
|
"MixinSkullBlockEntityRenderer",
|
||||||
"MixinHeldItemRenderer",
|
"MixinHeldItemRenderer",
|
||||||
"MixinClientPlayerEntity",
|
"MixinClientPlayerEntity",
|
||||||
"MixinLivingEntity",
|
"MixinPlayerEntity",
|
||||||
"MixinPlayerMoveC2SPacket",
|
"MixinPlayerMoveC2SPacket",
|
||||||
"MixinPlayerPositionLookS2CPacket",
|
"MixinPlayerPositionLookS2CPacket",
|
||||||
"MixinVertextConsumers",
|
"MixinVertextConsumers",
|
||||||
|
|
Loading…
Reference in a new issue