mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Remove the boolean argument from Pony.getRace
This commit is contained in:
parent
9b12a08936
commit
da2ccc75fc
11 changed files with 19 additions and 15 deletions
|
@ -28,7 +28,7 @@ public interface IPony {
|
||||||
* Returns true if this pony has wings and the will to use them.
|
* Returns true if this pony has wings and the will to use them.
|
||||||
*/
|
*/
|
||||||
default boolean canFly() {
|
default boolean canFly() {
|
||||||
return getMetadata().getRace().hasWings();
|
return getRace().hasWings();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,12 +75,15 @@ public interface IPony {
|
||||||
*/
|
*/
|
||||||
boolean isPartiallySubmerged(LivingEntity entity);
|
boolean isPartiallySubmerged(LivingEntity entity);
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
|
default Race getRace(boolean ignorePony) {
|
||||||
|
return com.minelittlepony.client.pony.Pony.getEffectiveRace(getMetadata().getRace(), ignorePony);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the race associated with this pony.
|
* Gets the race associated with this pony.
|
||||||
*
|
|
||||||
* @param ignorePony True to ignore the client's current pony level setting.
|
|
||||||
*/
|
*/
|
||||||
Race getRace(boolean ignorePony);
|
Race getRace();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if an entity is sitting as when riding a vehicle or
|
* Returns true if an entity is sitting as when riding a vehicle or
|
||||||
|
|
|
@ -47,7 +47,7 @@ public class HorseCam {
|
||||||
|
|
||||||
IPony pony = MineLittlePony.getInstance().getManager().getPony(player);
|
IPony pony = MineLittlePony.getInstance().getManager().getPony(player);
|
||||||
|
|
||||||
if (!pony.getRace(false).isHuman()) {
|
if (!pony.getRace().isHuman()) {
|
||||||
float factor = pony.getMetadata().getSize().getEyeHeightFactor();
|
float factor = pony.getMetadata().getSize().getEyeHeightFactor();
|
||||||
pitch = rescaleCameraPitch(player.getStandingEyeHeight() / factor, pitch);
|
pitch = rescaleCameraPitch(player.getStandingEyeHeight() / factor, pitch);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,8 @@ class DummyPony extends DummyPlayer implements IPreviewModel, ModelAttributes.Sw
|
||||||
}
|
}
|
||||||
return MineLittlePony.getInstance().getManager()
|
return MineLittlePony.getInstance().getManager()
|
||||||
.getPony(this)
|
.getPony(this)
|
||||||
.getRace(true)
|
.getMetadata()
|
||||||
|
.getRace()
|
||||||
.getModelId(super.getModel().contains("slim"));
|
.getModelId(super.getModel().contains("slim"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@ abstract class MixinCamera {
|
||||||
|
|
||||||
IPony pony = MineLittlePony.getInstance().getManager().getPony(MinecraftClient.getInstance().player);
|
IPony pony = MineLittlePony.getInstance().getManager().getPony(MinecraftClient.getInstance().player);
|
||||||
|
|
||||||
if (!pony.getRace(false).isHuman()) {
|
if (!pony.getRace().isHuman()) {
|
||||||
value *= pony.getMetadata().getSize().getEyeDistanceFactor();
|
value *= pony.getMetadata().getSize().getEyeDistanceFactor();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,7 +46,7 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implem
|
||||||
|
|
||||||
IPony pony = MineLittlePony.getInstance().getManager().getPony(this);
|
IPony pony = MineLittlePony.getInstance().getManager().getPony(this);
|
||||||
|
|
||||||
if (!pony.getRace(false).isHuman()) {
|
if (!pony.getRace().isHuman()) {
|
||||||
float factor = pony.getMetadata().getSize().getEyeHeightFactor();
|
float factor = pony.getMetadata().getSize().getEyeHeightFactor();
|
||||||
if (factor != 1) {
|
if (factor != 1) {
|
||||||
value *= factor;
|
value *= factor;
|
||||||
|
|
|
@ -41,7 +41,7 @@ abstract class MixinDefaultPlayerSkin {
|
||||||
|
|
||||||
cir.setReturnValue(MineLittlePony.getInstance().getManager()
|
cir.setReturnValue(MineLittlePony.getInstance().getManager()
|
||||||
.getPony(IPonyManager.getDefaultSkin(uuid), uuid)
|
.getPony(IPonyManager.getDefaultSkin(uuid), uuid)
|
||||||
.getRace(false)
|
.getRace()
|
||||||
.getModelId(IPonyManager.isSlimSkin(uuid)));
|
.getModelId(IPonyManager.isSlimSkin(uuid)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,7 +23,7 @@ abstract class MixinEntityRenderDispatcher {
|
||||||
}
|
}
|
||||||
return MineLittlePony.getInstance().getManager()
|
return MineLittlePony.getInstance().getManager()
|
||||||
.getPony(player)
|
.getPony(player)
|
||||||
.getRace(false)
|
.getRace()
|
||||||
.getModelId(player.getModel().contains("slim"));
|
.getModelId(player.getModel().contains("slim"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -158,8 +158,8 @@ public class Pony implements IPony {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Race getRace(boolean ignorePony) {
|
public Race getRace() {
|
||||||
return getEffectiveRace(getMetadata().getRace(), ignorePony);
|
return getEffectiveRace(getMetadata().getRace(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -36,7 +36,7 @@ public interface IPonyRenderContext<T extends LivingEntity, M extends EntityMode
|
||||||
* Called by riders to have their transportation adjust their position.
|
* Called by riders to have their transportation adjust their position.
|
||||||
*/
|
*/
|
||||||
default void translateRider(T entity, IPony entityPony, LivingEntity passenger, IPony passengerPony, MatrixStack stack, float ticks) {
|
default void translateRider(T entity, IPony entityPony, LivingEntity passenger, IPony passengerPony, MatrixStack stack, float ticks) {
|
||||||
if (!passengerPony.getRace(false).isHuman()) {
|
if (!passengerPony.getRace().isHuman()) {
|
||||||
float yaw = MathUtil.interpolateDegress((float)entity.prevY, (float)entity.getY(), ticks);
|
float yaw = MathUtil.interpolateDegress((float)entity.prevY, (float)entity.getY(), ticks);
|
||||||
|
|
||||||
getModelWrapper().applyMetadata(entityPony.getMetadata());
|
getModelWrapper().applyMetadata(entityPony.getMetadata());
|
||||||
|
|
|
@ -53,7 +53,7 @@ public class PlayerPonySkull implements ISkull {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean bindPony(IPony pony) {
|
public boolean bindPony(IPony pony) {
|
||||||
Race race = pony.getRace(false);
|
Race race = pony.getRace();
|
||||||
if (race.isHuman()) {
|
if (race.isHuman()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -57,7 +57,7 @@ abstract class AbstractNpcRenderer<T extends MobEntity & VillagerDataContainer>
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(T entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
|
public void render(T entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
|
||||||
model = manager.setModel(models.computeIfAbsent(getEntityPony(entity).getRace(false), this::createModel)).body();
|
model = manager.setModel(models.computeIfAbsent(getEntityPony(entity).getRace(), this::createModel)).body();
|
||||||
|
|
||||||
super.render(entity, entityYaw, tickDelta, stack, renderContext, lightUv);
|
super.render(entity, entityYaw, tickDelta, stack, renderContext, lightUv);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue