mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Added a pony skin for the alex model and fixed head positioning when posed as swimming
This commit is contained in:
parent
a8ccee47e1
commit
5804e09187
7 changed files with 32 additions and 10 deletions
|
@ -7,11 +7,12 @@ import com.minelittlepony.hdskins.dummy.DummyPlayer;
|
|||
import com.minelittlepony.hdskins.dummy.TextureProxy;
|
||||
import com.minelittlepony.hdskins.profile.SkinType;
|
||||
import com.minelittlepony.hdskins.resources.LocalTexture;
|
||||
import com.minelittlepony.model.IRotatedSwimmer;
|
||||
|
||||
/**
|
||||
* 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
|
||||
.<DummyPony>create((t, w) -> new DummyPony(t, null), EntityCategory.MISC)
|
||||
|
@ -30,11 +31,7 @@ class DummyPony extends DummyPlayer {
|
|||
|
||||
LocalTexture skin = getTextures().get(SkinType.SKIN);
|
||||
|
||||
if (wet && skin.getId() == PonyPreview.NO_SKIN_PONY) {
|
||||
skin.reset();
|
||||
}
|
||||
|
||||
if (!wet && skin.getId() == PonyPreview.NO_SKIN_SEAPONY) {
|
||||
if (wet != (skin.getId() == PonyPreview.NO_SKIN_SEAPONY)) {
|
||||
skin.reset();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
|
@ -11,7 +11,8 @@ import com.minelittlepony.pony.meta.Race;
|
|||
|
||||
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");
|
||||
|
||||
private final DummyPony localPony = new DummyPony(DummyPony.TYPE, localTextures);
|
||||
|
@ -27,11 +28,20 @@ class PonyPreview extends PlayerPreview {
|
|||
if (type == SkinType.SKIN) {
|
||||
// Initialization order means this method might be called before class members have been initialized.
|
||||
// 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);
|
||||
}
|
||||
|
||||
@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) {
|
||||
Identifier loc = human.getTextures().get(SkinType.SKIN).getId();
|
||||
|
||||
|
|
|
@ -93,7 +93,7 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
|||
}
|
||||
|
||||
if (attributes.isSwimmingRotated) {
|
||||
head.setPivot(0, -2, -2);
|
||||
head.setPivot(0, -2, -4);
|
||||
} else {
|
||||
head.setPivot(0, 0, 0);
|
||||
}
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
package com.minelittlepony.model;
|
||||
|
||||
public interface IRotatedSwimmer {
|
||||
|
||||
}
|
|
@ -97,7 +97,7 @@ public class ModelAttributes<T extends LivingEntity> {
|
|||
isFlying = mode == Mode.THIRD_PERSON && pony.isFlying(entity);
|
||||
isGliding = entity.isFallFlying();
|
||||
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);
|
||||
isSitting = pony.isRidingInteractive(entity);
|
||||
interpolatorId = entity.getUuid();
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.2 KiB |
Loading…
Reference in a new issue