mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-04-01 01:05:27 +02:00
Fixed rendering of legacy pony armour
This commit is contained in:
parent
d843896177
commit
c68d484d42
6 changed files with 19 additions and 16 deletions
|
@ -6,6 +6,7 @@ import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
import com.mojang.serialization.Lifecycle;
|
import com.mojang.serialization.Lifecycle;
|
||||||
|
|
||||||
|
@Deprecated
|
||||||
public final class ArmourRegistry {
|
public final class ArmourRegistry {
|
||||||
private ArmourRegistry() {}
|
private ArmourRegistry() {}
|
||||||
static final Registry<IArmour<?>> REGISTRY = new SimpleRegistry<>(RegistryKey.ofRegistry(new Identifier("minelittlepony", "armour")), Lifecycle.stable());
|
static final Registry<IArmour<?>> REGISTRY = new SimpleRegistry<>(RegistryKey.ofRegistry(new Identifier("minelittlepony", "armour")), Lifecycle.stable());
|
||||||
|
|
|
@ -14,6 +14,7 @@ import com.minelittlepony.api.pony.IPonyData;
|
||||||
*
|
*
|
||||||
* @param <V> The type of the contained armour model.
|
* @param <V> The type of the contained armour model.
|
||||||
*/
|
*/
|
||||||
|
@Deprecated
|
||||||
public interface IArmour<V extends IArmourModel> extends IModelWrapper {
|
public interface IArmour<V extends IArmourModel> extends IModelWrapper {
|
||||||
/**
|
/**
|
||||||
* Registers a custom armour for the supplied item.
|
* Registers a custom armour for the supplied item.
|
||||||
|
|
|
@ -7,12 +7,15 @@ import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
|
import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A resolver for looking up the texture for a piece of armour.
|
* A resolver for looking up the texture for a piece of armour.
|
||||||
* <p>
|
* <p>
|
||||||
* This is for modders who want to override the default implementation found in {@link DefaultArmourTextureResolver}.
|
* This is for modders who want to override the default implementation found in {@link DefaultArmourTextureResolver}.
|
||||||
*/
|
*/
|
||||||
public interface IArmourTextureResolver {
|
public interface IArmourTextureResolver {
|
||||||
|
IArmourTextureResolver DEFAULT = new DefaultArmourTextureResolver();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets the armour texture to be used for the given entity, armour piece, slot, and render layer.
|
* Gets the armour texture to be used for the given entity, armour piece, slot, and render layer.
|
||||||
|
|
|
@ -90,8 +90,6 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showChestplate() {
|
public void showChestplate() {
|
||||||
chestPiece.visible = true;
|
|
||||||
neck.visible = true;
|
|
||||||
body.visible = variant == ArmourVariant.LEGACY;
|
body.visible = variant == ArmourVariant.LEGACY;
|
||||||
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
||||||
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||||
|
@ -99,12 +97,9 @@ public class PonyArmourModel<T extends LivingEntity> extends AbstractPonyModel<T
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void showSaddle() {
|
public void showSaddle() {
|
||||||
chestPiece.visible = true;
|
body.visible = variant == ArmourVariant.LEGACY;
|
||||||
neck.visible = true;
|
upperTorso.visible = variant == ArmourVariant.LEGACY;
|
||||||
|
chestPiece.visible = variant == ArmourVariant.NORMAL;
|
||||||
if (variant == ArmourVariant.LEGACY) {
|
|
||||||
upperTorso.visible = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -7,7 +7,6 @@ import com.minelittlepony.api.model.armour.IArmourModel;
|
||||||
import com.minelittlepony.api.model.armour.IArmourTextureResolver;
|
import com.minelittlepony.api.model.armour.IArmourTextureResolver;
|
||||||
import com.minelittlepony.client.model.IPonyModel;
|
import com.minelittlepony.client.model.IPonyModel;
|
||||||
import com.minelittlepony.client.model.ModelWrapper;
|
import com.minelittlepony.client.model.ModelWrapper;
|
||||||
import com.minelittlepony.client.model.armour.DefaultArmourTextureResolver;
|
|
||||||
import com.minelittlepony.client.render.IPonyRenderContext;
|
import com.minelittlepony.client.render.IPonyRenderContext;
|
||||||
import com.minelittlepony.common.util.Color;
|
import com.minelittlepony.common.util.Color;
|
||||||
|
|
||||||
|
@ -28,8 +27,6 @@ import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
|
||||||
|
|
||||||
private static final IArmourTextureResolver DEFAULT = new DefaultArmourTextureResolver();
|
|
||||||
|
|
||||||
public ArmourFeature(IPonyRenderContext<T, M> renderer) {
|
public ArmourFeature(IPonyRenderContext<T, M> renderer) {
|
||||||
super(renderer);
|
super(renderer);
|
||||||
}
|
}
|
||||||
|
@ -84,7 +81,7 @@ public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IP
|
||||||
blue = Color.b(color);
|
blue = Color.b(color);
|
||||||
}
|
}
|
||||||
|
|
||||||
IArmourTextureResolver resolver = armour.getTextureResolver(DEFAULT);
|
IArmourTextureResolver resolver = armour.getTextureResolver(IArmourTextureResolver.DEFAULT);
|
||||||
|
|
||||||
boolean glint = itemstack.hasGlint();
|
boolean glint = itemstack.hasGlint();
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
"texture": {"w": 64, "h": 32},
|
"texture": {"w": 64, "h": 32},
|
||||||
"dilate": 0.27,
|
"dilate": 0.27,
|
||||||
"data": {
|
"data": {
|
||||||
|
"body": {
|
||||||
|
"texture": { "u": 16, "v": 18 },
|
||||||
|
"cubes": [
|
||||||
|
{ "from": [-4, 4, -2], "size": [ 8, 8, 4] }
|
||||||
|
]
|
||||||
|
},
|
||||||
"chestpiece": {
|
"chestpiece": {
|
||||||
"texture": {"u": 16, "v": 8},
|
"texture": {"u": 16, "v": 8},
|
||||||
"cubes": [
|
"cubes": [
|
||||||
|
@ -19,10 +25,10 @@
|
||||||
"upper_torso": {
|
"upper_torso": {
|
||||||
"type": "mson:planar",
|
"type": "mson:planar",
|
||||||
"texture": {"u": 24, "v": 0},
|
"texture": {"u": 24, "v": 0},
|
||||||
"east": [4, 4, 2, 8, 8, 32, 32],
|
"east": [ 4, 4, 2, 8, 8, 32, 23],
|
||||||
"west": [-4, 4, 2, 8, 8, 23, 32],
|
"west": [ -4, 4, 2, 8, 8, 32, 23],
|
||||||
"south": [-4, 4,10, 8, 8, 32, 23],
|
"south": [-4, 4, 10, 8, 8, 32, 23],
|
||||||
"up": [-4, 4, -2, 8, 12, 32, 23],
|
"up": [ -4, 4, 1, 8, 12, 32, 23],
|
||||||
"__comment": "it's a little short, so the butt tends to show. :/"
|
"__comment": "it's a little short, so the butt tends to show. :/"
|
||||||
},
|
},
|
||||||
"right_arm": {
|
"right_arm": {
|
||||||
|
|
Loading…
Add table
Reference in a new issue