Added a pony skin for the alex model and fixed head positioning when posed as swimming

This commit is contained in:
Sollace 2019-12-03 14:15:28 +02:00
parent a8ccee47e1
commit 5804e09187
7 changed files with 32 additions and 10 deletions

View file

@ -7,11 +7,12 @@ import com.minelittlepony.hdskins.dummy.DummyPlayer;
import com.minelittlepony.hdskins.dummy.TextureProxy; import com.minelittlepony.hdskins.dummy.TextureProxy;
import com.minelittlepony.hdskins.profile.SkinType; import com.minelittlepony.hdskins.profile.SkinType;
import com.minelittlepony.hdskins.resources.LocalTexture; import com.minelittlepony.hdskins.resources.LocalTexture;
import com.minelittlepony.model.IRotatedSwimmer;
/** /**
* Dummy model used for the skin uploading screen. * Dummy model used for the skin uploading screen.
*/ */
class DummyPony extends DummyPlayer { class DummyPony extends DummyPlayer implements IRotatedSwimmer {
public static EntityType<DummyPony> TYPE = EntityType.Builder public static EntityType<DummyPony> TYPE = EntityType.Builder
.<DummyPony>create((t, w) -> new DummyPony(t, null), EntityCategory.MISC) .<DummyPony>create((t, w) -> new DummyPony(t, null), EntityCategory.MISC)
@ -30,11 +31,7 @@ class DummyPony extends DummyPlayer {
LocalTexture skin = getTextures().get(SkinType.SKIN); LocalTexture skin = getTextures().get(SkinType.SKIN);
if (wet && skin.getId() == PonyPreview.NO_SKIN_PONY) { if (wet != (skin.getId() == PonyPreview.NO_SKIN_SEAPONY)) {
skin.reset();
}
if (!wet && skin.getId() == PonyPreview.NO_SKIN_SEAPONY) {
skin.reset(); skin.reset();
} }
} }

View file

@ -0,0 +1,10 @@
package com.minelittlepony.client.hdskins;
import com.minelittlepony.client.model.entity.race.EarthPonyModel;
public class DummyPonyModel extends EarthPonyModel<DummyPony> {
public DummyPonyModel(boolean smallArms) {
super(smallArms);
}
}

View file

@ -11,7 +11,8 @@ import com.minelittlepony.pony.meta.Race;
class PonyPreview extends PlayerPreview { class PonyPreview extends PlayerPreview {
public static final Identifier NO_SKIN_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png"); public static final Identifier NO_SKIN_STEVE_PONY = new Identifier("minelittlepony", "textures/mob/noskin.png");
public static final Identifier NO_SKIN_ALEX_PONY = new Identifier("minelittlepony", "textures/mob/noskin_alex.png");
public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png"); public static final Identifier NO_SKIN_SEAPONY = new Identifier("minelittlepony", "textures/mob/noskin_seapony.png");
private final DummyPony localPony = new DummyPony(DummyPony.TYPE, localTextures); private final DummyPony localPony = new DummyPony(DummyPony.TYPE, localTextures);
@ -27,11 +28,20 @@ class PonyPreview extends PlayerPreview {
if (type == SkinType.SKIN) { if (type == SkinType.SKIN) {
// Initialization order means this method might be called before class members have been initialized. // Initialization order means this method might be called before class members have been initialized.
// This is something that needs to be fixed in HDSkins // This is something that needs to be fixed in HDSkins
return localPony != null && localPony.wet ? NO_SKIN_SEAPONY : NO_SKIN_PONY; return localPony != null && localPony.wet ? NO_SKIN_SEAPONY : NO_SKIN_STEVE_PONY;
} }
return super.getBlankSteveSkin(type); return super.getBlankSteveSkin(type);
} }
@Override
public Identifier getBlankAlexSkin(SkinType type) {
if (type == SkinType.SKIN) {
return localPony != null && localPony.wet ? NO_SKIN_SEAPONY : NO_SKIN_ALEX_PONY;
}
return getBlankSteveSkin(type);
}
protected DummyPlayer ponify(DummyPlayer human, DummyPlayer pony) { protected DummyPlayer ponify(DummyPlayer human, DummyPlayer pony) {
Identifier loc = human.getTextures().get(SkinType.SKIN).getId(); Identifier loc = human.getTextures().get(SkinType.SKIN).getId();

View file

@ -93,7 +93,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
} }
if (attributes.isSwimmingRotated) { if (attributes.isSwimmingRotated) {
head.setPivot(0, -2, -2); head.setPivot(0, -2, -4);
} else { } else {
head.setPivot(0, 0, 0); head.setPivot(0, 0, 0);
} }

View file

@ -0,0 +1,5 @@
package com.minelittlepony.model;
public interface IRotatedSwimmer {
}

View file

@ -97,7 +97,7 @@ public class ModelAttributes<T extends LivingEntity> {
isFlying = mode == Mode.THIRD_PERSON && pony.isFlying(entity); isFlying = mode == Mode.THIRD_PERSON && pony.isFlying(entity);
isGliding = entity.isFallFlying(); isGliding = entity.isFallFlying();
isSwimming = mode == Mode.THIRD_PERSON && pony.isSwimming(entity); isSwimming = mode == Mode.THIRD_PERSON && pony.isSwimming(entity);
isSwimmingRotated = mode == Mode.THIRD_PERSON && isSwimming && entity instanceof PlayerEntity; isSwimmingRotated = mode == Mode.THIRD_PERSON && isSwimming && (entity instanceof PlayerEntity || entity instanceof IRotatedSwimmer);
hasHeadGear = pony.isWearingHeadgear(entity); hasHeadGear = pony.isWearingHeadgear(entity);
isSitting = pony.isRidingInteractive(entity); isSitting = pony.isRidingInteractive(entity);
interpolatorId = entity.getUuid(); interpolatorId = entity.getUuid();

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB