Fixed the witch hat and other rendering issues with wearables

This commit is contained in:
Sollace 2019-12-03 20:31:54 +02:00
parent 44954abb6a
commit 508d21ed0b
6 changed files with 22 additions and 24 deletions

View file

@ -23,8 +23,7 @@ public abstract class AbstractGear extends Model implements IGear, MsonModel {
textureHeight = 64;
}
@Override
public void accept(ModelPart t) {
public void addPart(ModelPart t) {
parts.add(t);
}

View file

@ -15,7 +15,7 @@ public class Muffin extends AbstractGear implements IStackable {
@Override
public void init(ModelContext context) {
accept(context.findByName("crown"));
addPart(context.findByName("crown"));
}
@Override

View file

@ -14,7 +14,7 @@ public class Stetson extends AbstractGear implements IStackable {
@Override
public void init(ModelContext context) {
accept(context.findByName("rim"));
addPart(context.findByName("rim"));
}
@Override

View file

@ -15,7 +15,7 @@ public class WitchHat extends AbstractGear implements IStackable {
@Override
public void init(ModelContext context) {
accept(context.findByName("witch_hat"));
addPart(context.findByName("hat"));
}
@Override

View file

@ -76,7 +76,9 @@ public class GearFeature<T extends LivingEntity, M extends EntityModel<T> & IPon
gear.setLivingAnimations(model, entity);
gear.setRotationAndAngles(model.getAttributes().isGoingFast, entity.getUuid(), limbDistance, limbAngle, model.getWobbleAmount(), tickDelta);
VertexConsumer vertexConsumer = renderContext.getBuffer(RenderLayer.getEntitySolid(gear.getTexture(entity, getContext())));
gear.renderPart(stack, vertexConsumer, OverlayTexture.DEFAULT_UV, lightUv, limbDistance, limbAngle, tickDelta, 1F, entity.getUuid());
RenderLayer layer = RenderLayer.getEntityTranslucent(gear.getTexture(entity, getContext()));
VertexConsumer vertexConsumer = renderContext.getBuffer(layer);
gear.renderPart(stack, vertexConsumer, lightUv, OverlayTexture.DEFAULT_UV, 1, 1, 1, 1, entity.getUuid());
}
}

View file

@ -1,37 +1,34 @@
{
"texture": {"w": 16, "h": 8, "u": 64, "h": 128},
"witch_hat": {
"visible": false,
"texture": {"u": 0, "v": 64},
"texture": {"u": 0, "w": 64, "h": 128},
"hat": {
"texture": {"v": 64 },
"center": [-5, -8, -7.0],
"cubes": [
{ "from": [-5, -6, -7], "size": [10, 2, 10] }
{ "size": [10, 2, 10] }
],
"children": [
{
"visible": false,
"texture": {"v": 76 },
"center": [1.75, -4, 2],
"texture": {"u": 0, "v": 76},
"rotate": [3, 0, 1.5],
"rotate": [-3, 0, 1.5],
"cubes": [
{ "from": [-5, -5, -7], "size": [7, 4, 7] }
{ "size": [7, 4, 7] }
],
"children": [
{
"visible": false,
"texture": {"v": 87 },
"center": [1.75, -4, 2],
"texture": {"u": 0, "v": 87},
"rotate": [6, 0, 3],
"rotate": [-6, 0, 3],
"cubes": [
{ "from": [-5, -4, -7], "size": [4, 4, 4] }
{ "size": [4, 4, 4] }
],
"children": [
{
"visible": false,
"texture": {"v": 95 },
"center": [1.75, -2, 2],
"texture": {"u": 0, "v": 95},
"rotate": [12, 0, 6],
"rotate": [-12, 0, 6],
"cubes": [
{ "from": [-5, -2, -7], "size": [1, 2, 1] }
{ "size": [1, 2, 1], "stretch": 0.25 }
]
}
]