Bump mson and ponify the allay

This commit is contained in:
Sollace 2022-06-12 00:39:09 +02:00
parent 89a8e36e10
commit f3da48b42f
7 changed files with 95 additions and 2 deletions

View file

@ -23,4 +23,4 @@ org.gradle.daemon=false
modmenu_version=4.0.0
kirin_version=1.11.0-beta.2
hd_skins_version=6.6.0
mson_version=1.6.0-beta.3
mson_version=1.6.0-beta.4

View file

@ -2,6 +2,7 @@ package com.minelittlepony.client.model;
import net.minecraft.client.model.Model;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.entity.model.AllayEntityModel;
import net.minecraft.client.render.entity.model.ArmorStandEntityModel;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.mob.VexEntity;
@ -70,6 +71,7 @@ public final class ModelType {
public static final ModelKey<EnderStallionModel> ENDERMAN = register("enderman", EnderStallionModel::new);
public static final ModelKey<BreezieModel<VexEntity>> BREEZIE = register("breezie", BreezieModel::new);
public static final ModelKey<ParaspriteModel> PARASPRITE = register("parasprite", ParaspriteModel::new);
public static final ModelKey<AllayEntityModel> ALLAY = register("allay", AllayEntityModel::new);
public static final ModelKey<PonyElytra<?>> ELYTRA = register("elytra", PonyElytra::new);

View file

@ -59,6 +59,9 @@ public final class MobRenderers {
public static final MobRenderers STRIDER = register("striders", (state, pony) -> {
pony.switchRenderer(state, EntityType.STRIDER, ParaspriteRenderer::new);
});
public static final MobRenderers ALLAY = register("allays", (state, pony) -> {
pony.switchRenderer(state, EntityType.ALLAY, AllayRenderer::new);
});
private final BiConsumer<MobRenderers, PonyRenderDispatcher> changer;

View file

@ -0,0 +1,29 @@
package com.minelittlepony.client.render.entity;
import net.minecraft.client.render.entity.*;
import net.minecraft.client.render.entity.feature.HeldItemFeatureRenderer;
import net.minecraft.client.render.entity.model.AllayEntityModel;
import net.minecraft.entity.passive.AllayEntity;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.BlockPos;
import com.minelittlepony.client.model.ModelType;
public class AllayRenderer extends MobEntityRenderer<AllayEntity, AllayEntityModel> {
private static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/entity/allay/allay_pony.png");
public AllayRenderer(EntityRendererFactory.Context context) {
super(context, ModelType.ALLAY.createModel(), 0.4f);
addFeature(new HeldItemFeatureRenderer<AllayEntity, AllayEntityModel>(this, context.getHeldItemRenderer()));
}
@Override
public Identifier getTexture(AllayEntity allayEntity) {
return TEXTURE;
}
@Override
protected int getBlockLight(AllayEntity allayEntity, BlockPos blockPos) {
return 15;
}
}

View file

@ -112,7 +112,7 @@ public class NativeUtil {
int height = _getTexLevelParameter(GL_TEXTURE_2D, 0, GL_TEXTURE_HEIGHT);
if (width * height == 0) {
throw new IllegalStateException("GL texture not uploaded yet");
throw new IllegalStateException("GL texture not uploaded yet: " + resource);
}
try (NativeImage image = new NativeImage(InternalFormat.valueOf(format).getClassification(), width, height, false)) {

View file

@ -0,0 +1,59 @@
{
"texture": {"w": 32, "h": 32},
"data": {
"root": {
"pivot": [0, 23.5, 0],
"children": {
"head": {
"pivot": [ 0, -3.99, 0 ],
"cubes": [
{ "from": [-2.5, -5, -2.5], "size": [ 5, 5, 5] },
{ "from": [-2.7, -6.6, -0.5], "size": [ 2, 2, 2], "texture": {"u": 10, "v": 10}, "dilate": -0.4 },
{ "from": [ 0.7, -6.6, -0.5], "size": [ 2, 2, 2], "texture": {"u": 10, "v": 14}, "dilate": -0.4 },
{ "from": [-1, -1, -3.3], "size": [ 2, 1, 1], "texture": {"u": 18, "v": 15} }
]
},
"body": {
"texture": { "u": 0, "v": 10 },
"pivot": [ 0, -4, 0 ],
"cubes": [
{ "from": [-1.5, 0, -1], "size": [ 3, 4, 2] },
{ "from": [-1.5, 0, -1], "size": [ 3, 5, 2], "texture": {"u": 0, "v": 16}, "dilate": -0.2 }
],
"children": {
"right_arm": {
"texture": { "u": 23, "v": 0 },
"pivot": [ -1.75, 0.5, 0 ],
"cubes": [
{ "from": [-0.75, -0.5, -1], "size": [ 1, 4, 2], "dilate": -0.01 }
]
},
"left_arm": {
"texture": { "u": 23, "v": 6 },
"pivot": [ 1.75, 0.5, 0 ],
"cubes": [
{ "from": [-0.25, -0.5, -1], "size": [ 1, 4, 2], "dilate": -0.01 }
]
},
"right_wing": {
"texture": { "u": 16, "v": 14 },
"pivot": [ -0.5, 0, 0.65 ],
"cubes": [
{ "from": [0, 1, 0], "size": [ 0, 5, 8] }
]
},
"left_wing": {
"texture": { "u": 16, "v": 14 },
"pivot": [ 0.5, 0, 0.65 ],
"cubes": [
{ "from": [0, 1, 0], "size": [ 0, 5, 8] }
]
}
}
}
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.7 KiB