diff --git a/src/main/java/com/minelittlepony/client/model/entities/ModelBreezie.java b/src/main/java/com/minelittlepony/client/model/entities/ModelBreezie.java index c0928237..e05e4aa3 100644 --- a/src/main/java/com/minelittlepony/client/model/entities/ModelBreezie.java +++ b/src/main/java/com/minelittlepony/client/model/entities/ModelBreezie.java @@ -6,73 +6,35 @@ import net.minecraft.entity.LivingEntity; import net.minecraft.util.Arm; import net.minecraft.util.math.MathHelper; -import com.minelittlepony.client.util.render.Part; +import com.google.common.collect.ImmutableList; +import com.google.common.collect.Iterables; +import com.minelittlepony.mson.api.model.MsonPart; import static com.minelittlepony.model.PonyModelConstants.PI; public class ModelBreezie extends BipedEntityModel { - Part neck; - Part tail; - Part tailStub; + private ModelPart neck; + private ModelPart tail; + private ModelPart tailStub; - Part leftWing; - Part rightWing; + private ModelPart leftWing; + private ModelPart rightWing; public ModelBreezie() { - textureWidth = 64; + super(1); textureHeight = 64; - - helmet.visible = false; - head = new Part(this) - .child(new Part(this) - .addBox(-3, -6, -3, 6, 6, 6).around(0, 0, -4) - .tex(28, 0).addBox( 2, -7, 1, 1, 1, 1) - .tex(24, 0).addBox(-3, -7, 1, 1, 1, 1) - .tex(24, 9).addBox(-1, -2, -4, 2, 2, 1)) - .child(new Part(this) - .tex(28, 2).addBox( 1, -11, -3, 1, 6, 1) - .tex(24, 2).addBox(-2, -11, -3, 1, 6, 1) - .rotate(-0.2617994F, 0, 0)); - - torso = new Part(this, 2, 12) - .addBox(0, 0, 0, 6, 7, 14).rotate(-0.5235988F, 0, 0).around(-3, 1, -3); - - leftArm = new Part(this, 28, 12).addBox(0, 0, 0, 2, 12, 2).around( 1, 8, -5); - rightArm = new Part(this, 36, 12).addBox(0, 0, 0, 2, 12, 2).around(-3, 8, -5); - leftLeg = new Part(this, 8, 12) .addBox(0, 0, 0, 2, 12, 2).around( 1, 12, 3); - rightLeg = new Part(this, 0, 12) .addBox(0, 0, 0, 2, 12, 2).around(-3, 12, 3); - - neck = new Part(this, 40, 0) - .addBox(0, 0, 0, 2, 5, 2) - .rotate(0.0872665F, 0, 0).around(-1, -2, -4); - - tailStub = new Part(this, 40, 7) - .addBox(0, 0, 0, 1, 1, 3).around(-0.5F, 8, 8); - - tail = new Part(this, 32, 0) - .addBox(0, 0, 1, 2, 9, 2).around(-1, 7, 10); - - leftWing = new Part(this, 0, 40) - .addBox(0, -12, 0, 24, 24, 0) - .rotate(0, -0.6981317F, 0).around(2, 3, 1); - leftWing.setTextureSize(64, 32); - - rightWing = new Part(this, 0, 40) - .addBox(-24, -12, 0, 24, 24, 0, true) - .rotate(0, 0.6981317F, 0).around(-2, 3, 1); - rightWing.setTextureSize(64, 32); - } @Override - public void render(T entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) { - super.setAngles(entity, move, swing, ticks, headYaw, headPitch, scale); - neck.render(scale); - tailStub.render(scale); - tail.render(scale); - leftWing.render(scale); - rightWing.render(scale); + public void setVisible(boolean visible) { + super.setVisible(visible); + helmet.visible = false; + } + + @Override + protected Iterable getBodyParts() { + return Iterables.concat(super.getBodyParts(), ImmutableList.of(neck, tailStub, tail, leftWing, rightWing)); } @Override @@ -84,16 +46,16 @@ public class ModelBreezie extends BipedEntityModel { leftArm.pitch = MathHelper.cos(move * 0.6662F) * swing; leftArm.roll = 0; - ((Part)rightArm).rotate(swing * MathHelper.cos(move * 0.6662F + PI), 0, 0); - ((Part)leftLeg) .rotate(swing * MathHelper.cos(move * 0.6662F + PI) * 1.4F, 0, 0); - ((Part)rightLeg).rotate(swing * MathHelper.cos(move * 0.6662F) * 1.4F, 0, 0); + ((MsonPart)rightArm).rotate(swing * MathHelper.cos(move * 0.6662F + PI), 0, 0); + ((MsonPart)leftLeg) .rotate(swing * MathHelper.cos(move * 0.6662F + PI) * 1.4F, 0, 0); + ((MsonPart)rightLeg).rotate(swing * MathHelper.cos(move * 0.6662F) * 1.4F, 0, 0); if (isRiding) { leftArm.pitch += -PI / 5; rightArm.pitch += -PI / 5; - rotateLegRiding(((Part)leftLeg), -1); - rotateLegRiding(((Part)rightLeg), 1); + rotateLegRiding((MsonPart)leftLeg, -1); + rotateLegRiding((MsonPart)rightLeg, 1); } rotateArm(leftArm, leftArmPose, 1); @@ -119,7 +81,7 @@ public class ModelBreezie extends BipedEntityModel { } } - protected void rotateLegRiding(Part leg, float factor) { + protected void rotateLegRiding(MsonPart leg, float factor) { leg.rotate(-1.4137167F, factor * PI / 10, factor * 0.07853982F); } diff --git a/src/main/java/com/minelittlepony/client/model/entities/ModelSeapony.java b/src/main/java/com/minelittlepony/client/model/entities/ModelSeapony.java index f07da4a1..a7e7bd9d 100644 --- a/src/main/java/com/minelittlepony/client/model/entities/ModelSeapony.java +++ b/src/main/java/com/minelittlepony/client/model/entities/ModelSeapony.java @@ -2,10 +2,7 @@ package com.minelittlepony.client.model.entities; import com.minelittlepony.client.model.armour.ModelPonyArmour; import com.minelittlepony.client.model.armour.ArmourWrapper; -import com.minelittlepony.client.model.components.SeaponyTail; -import com.minelittlepony.client.model.entities.ModelSeapony.Armour; import com.minelittlepony.client.model.races.ModelUnicorn; -import com.minelittlepony.client.util.render.Part; import com.minelittlepony.model.BodyPart; import com.minelittlepony.model.armour.IEquestrianArmour; import com.minelittlepony.pony.IPony; @@ -17,8 +14,6 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.entity.LivingEntity; import net.minecraft.util.math.MathHelper; -import org.lwjgl.opengl.GL11; - public class ModelSeapony extends ModelUnicorn { private ModelPart bodyCenter; @@ -51,50 +46,10 @@ public class ModelSeapony extends ModelUnicorn { } @Override - protected void ponySleep() { - // noop - } + protected void ponySleep() {} @Override - protected void ponyRide() { - // noop - } - - @Deprecated - protected void initLegs(float yOffset, float stretch) { - super.initLegs(yOffset, stretch); - // hide the back legs - leftLeg.visible = false; - rightLeg.visible = false; - leftPantLeg.visible = false; - rightPantLeg.visible = false; - - centerFin = new Part(this, 58, 28) - .rotate(PI / 2 - 0.1F, 0, 0).around(0, 6, 9) - .east(0, -6, 0, 12, 6, stretch); - - leftFin = new Part(this, 56, 16) - .rotate(0, FIN_ROT_Y, 0).around(3, -6, 3) - .flipZ().east(0, 0, 0, 12, 8, stretch); - - rightFin = new Part(this, 56, 16) - .rotate(0, -FIN_ROT_Y, 0).around(-3, -6, 3) - .west(0, 0, 0, 12, 8, stretch); - } - - @Deprecated - protected void initTail(float yOffset, float stretch) { - tail = new SeaponyTail(this); - tail.init(yOffset, stretch); - } - - @Deprecated - protected void initBody(float yOffset, float stretch) { - super.initBody(yOffset, stretch); - bodyCenter = new Part(this, 0, 48) - .around(0, 6, 1) - .box(-3, -1, 0, 6, 7, 9, stretch).flip(); - } + protected void ponyRide() {} @Override public void setAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) { diff --git a/src/main/java/com/minelittlepony/client/model/entities/ModelVillagerPony.java b/src/main/java/com/minelittlepony/client/model/entities/ModelVillagerPony.java index 6f127c53..ddee03db 100644 --- a/src/main/java/com/minelittlepony/client/model/entities/ModelVillagerPony.java +++ b/src/main/java/com/minelittlepony/client/model/entities/ModelVillagerPony.java @@ -10,8 +10,6 @@ import net.minecraft.util.math.MathHelper; import net.minecraft.village.VillagerDataContainer; import net.minecraft.village.VillagerProfession; -import com.minelittlepony.client.model.components.BatWings; -import com.minelittlepony.client.model.components.PonyEars; import com.minelittlepony.client.model.races.ModelAlicorn; import com.minelittlepony.client.render.entities.villager.PonyTextures; import com.minelittlepony.model.IPart; @@ -36,18 +34,6 @@ public class ModelVillagerPony e return super.getWings(); } - @Override - protected void initWings(float yOffset, float stretch) { - super.initWings(yOffset, stretch); - batWings = new BatWings<>(this, yOffset, stretch); - } - - @Override - protected void initEars(Part head, float yOffset, float stretch) { - ears = new PonyEars(head, true); - ears.init(yOffset, stretch); - } - @Override protected void shakeBody(float move, float swing, float bodySwing, float ticks) { super.shakeBody(move, swing, bodySwing, ticks); @@ -73,20 +59,6 @@ public class ModelVillagerPony e //trinket.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha); } - @Override - public void init(float yOffset, float stretch) { - super.init(yOffset, stretch); - - apron = new Part(this, 56, 16) - .offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z) - .around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z) - .south(-4, -4, -9, 8, 10, stretch); - trinket = new Part(this, 0, 3) - .offset(BODY_CENTRE_X, BODY_CENTRE_Y, BODY_CENTRE_Z) - .around(HEAD_RP_X, HEAD_RP_Y + yOffset, HEAD_RP_Z) - .south(-2, -4, -9, 4, 5, stretch); - } - @Override public void setHatVisible(boolean visible) { } diff --git a/src/main/resources/assets/minelittlepony/models/breezie.json b/src/main/resources/assets/minelittlepony/models/breezie.json new file mode 100644 index 00000000..2e98669a --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/breezie.json @@ -0,0 +1,102 @@ +{ + "parent": "mson:biped", + "texture": { + "w": 64, "h": 64 + }, + "head": { + "children": [ + { + "center": [0, 0, -4], + "cubes" [ + {"from": [-3, -6, -3], "size": [6, 6, 6] }, + {"from": [ 2, -7, 1], "size": [1, 1, 1], "texture": ["u": 28, "v": 0] }, + {"from": [-3, -7, 1], "size": [1, 1, 1], "texture": ["u": 24, "v": 0] }, + {"from": [-1, -2, -4], "size": [2, 2, 1], "texture": ["u": 24, "v": 9] } + ] + }, + { + "rotate": [-0.2617994, 0, 0], + "cubes" [ + {"from": [ 1, -11, -3], "size": [1, 6, 1], "texture": ["u": 28, "v": 2] }, + {"from": [-2, -11, -2], "size": [1, 6, 1], "texture": ["u": 24, "v": 2] } + ] + } + ] + }, + "neck": { + "texture": {"u": 40, "v": 0}, + "rotate": [0.0872665, 0, 0], + "center": [-1, -2, -4], + "cubes": [ + {"from": [0, 0, 0], "size": [2, 5, 2] } + ] + }, + "torso": { + "texture": {"u": 2, "v": 12}, + "rotate": [-0.5235988, 0, 0], + "cubes": [ + {"from": [0, 0, 0], "size": [6, 7, 14] } + ] + }, + "tail": { + "texture": {"u": 32, "v": 0 }, + "rotate": [-1, 7, 10] + "cubes": [ + {"from": [0, 0, 1], "size": [2, 9, 2] } + ] + }, + "tail_stub": { + "texture": {"u": 40, "v": 7 }, + "rotate": [-0.5, 8, 8] + "cubes": [ + {"from": [0, 0, 0], "size": [1, 1, 3] } + ] + } + "right_arm": { + "center": [-3, 8, -5], + "texture": { "u": 36, "v": 12 }, + "cubes": [ + { "from": [0, 0, 0], "size": [ 2, 12, 2] } + ] + }, + "left_arm": { + "center": [1, 8, -5], + "texture": { "u": 28, "v": 12 }, + "mirror": true, + "cubes": [ + { "from": [0, 0, 0], "size": [ 2, 12, 2] } + ] + }, + "right_leg": { + "center": [-3, 12, 3], + "texture": { "u": 0, "v": 12 }, + "cubes": [ + { "from": [0, 0, 0], "size": [ 2, 12, 2] } + ] + }, + "left_leg": { + "center": [1, 12, 3], + "texture": { "u": 8, "v": 12 }, + "mirror": true, + "cubes": [ + { "from": [0, 0, 0], "size": [ 2, 12, 2] } + ] + }, + "left_wing": { + "center": [2, 3, 1], + "rotate": [0, -0.6981317, 0], + "texture": { "u": 0, "v": 40 }, + "cubes": [ + { "from": [0, -12, 0], "size": [ 24, 24, 0] } + ] + }, + "right_wing": { + "center": [-2, 3, 1], + "rotate": [0, 0.6981317, 0], + "texture": { "u": 0, "v": 40 }, + "mirror": true, + "cubes": [ + { "from": [24, -12, 0], "size": [ 24, 24, 0] } + ] + } +} diff --git a/src/main/resources/assets/minelittlepony/models/guardian.json b/src/main/resources/assets/minelittlepony/models/guardian.json new file mode 100644 index 00000000..06d4b136 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/guardian.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:seapony" +} diff --git a/src/main/resources/assets/minelittlepony/models/illager.json b/src/main/resources/assets/minelittlepony/models/illager.json new file mode 100644 index 00000000..cd84e2e7 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/illager.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:races/alicorn" +} diff --git a/src/main/resources/assets/minelittlepony/models/pillager.json b/src/main/resources/assets/minelittlepony/models/pillager.json new file mode 100644 index 00000000..6d33d7ed --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/pillager.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:races/changeling" +} diff --git a/src/main/resources/assets/minelittlepony/models/races/batpony.json b/src/main/resources/assets/minelittlepony/models/races/batpony.json index 9ecd5991..f4039f87 100644 --- a/src/main/resources/assets/minelittlepony/models/races/batpony.json +++ b/src/main/resources/assets/minelittlepony/models/races/batpony.json @@ -1,5 +1,5 @@ { - "parent": "minelittlepony:races/pegasus", + "parent": "minelittlepony:steve_pony", "head": { "offset": [ 0, -1, -2 ], "center": [ 0, 0, -2 ], @@ -24,7 +24,7 @@ "wings": { "type": "mson:slot", "name": "wings", - "implementation": "com.minelittlepony.client.model.components.PegasusWings", + "implementation": "com.minelittlepony.client.model.components.BatWings", "content: "minelitlepony:components/bat_wings" } } diff --git a/src/main/resources/assets/minelittlepony/models/seapony.json b/src/main/resources/assets/minelittlepony/models/seapony.json new file mode 100644 index 00000000..3f0b5d42 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/seapony.json @@ -0,0 +1,38 @@ +{ + "parent": "minelittlepony:races/alicorn", + "left_fin": { + "type": "mson:planar", + "texture": {"u": 56, "v": 16}, + "mirror": [false, false, true], + "rotate": [0, 0.52, 0], + "center": [3, -6, 3], + "east": [0, 0, 0, 12, 8] + }, + "right_fin": { + "type": "mson:planar", + "texture": {"u": 56, "v": 16}, + "rotate": [0, -0.52, 0], + "center": [-3, -6, 3], + "west": [0, 0, 0, 12, 8] + }, + "center_fin": { + "type": "mson:planar", + "texture": {"u": 58, "v": 28}, + "rotate": [1.47, 0, 0], + "center": [0, 6, 9], + "east": [0, -6, 0, 12, 6] + }, + "abdomin": { + "texture": {"u": 0, "v": 48}, + "center": [0, 6, 1], + "cubes": [ + { "from": [-3, -1, 0], "size": [6, 7, 9] } + ] + }, + "tail": { + "type": "mson:slot", + "name": "tail", + "implementation": "com.minelittlepony.client.model.components.SeaponyTail", + "content": "minelittlepony:components/fish_tail" + } +} diff --git a/src/main/resources/assets/minelittlepony/models/villager.json b/src/main/resources/assets/minelittlepony/models/villager.json new file mode 100644 index 00000000..9018ff53 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/villager.json @@ -0,0 +1,42 @@ +{ + "parent": "minelittlepony:races/pegasus", + "head": { + "offset": [ 0, -1, -2 ], + "center": [ 0, 0, -2 ], + "cubes": [ + { "from": [-4, -4, -4], "size": [ 8, 8, 8] } + ], + "children": [ + { + "type": "mson:slot", + "name": "snout", + "implementation": "com.minelittlepony.client.model.components.PonySnout", + "content: "minelitlepony:components/snout" + }, + { + "type": "mson:slot", + "name": "ears", + "implementation": "com.minelittlepony.client.model.components.PonyEars", + "content": "minelittlepony:components/bat_ears" + } + ] + }, + "bat_wings": { + "type": "mson:slot", + "name": "wings", + "implementation": "com.minelittlepony.client.model.components.BatWings", + "content: "minelitlepony:components/bat_wings" + } + "apron": { + "type": "mson:planar", + "texture": {"u": 56, "v": 16}, + "offset": [0, 8, 6], + "south": [-4, -4, -9, 8, 10] + }, + "trinket": { + "type": "mson:planar", + "texture": {"u": 0, "v": 3}, + "offset": [0, 8, 6], + "south": [-2, -4, -9, 4, 5] + } +} diff --git a/src/main/resources/assets/minelittlepony/models/witch.json b/src/main/resources/assets/minelittlepony/models/witch.json new file mode 100644 index 00000000..cd84e2e7 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/witch.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:races/alicorn" +} diff --git a/src/main/resources/assets/minelittlepony/models/zombie.json b/src/main/resources/assets/minelittlepony/models/zombie.json new file mode 100644 index 00000000..cd84e2e7 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/zombie.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:races/alicorn" +} diff --git a/src/main/resources/assets/minelittlepony/models/zombie_villager.json b/src/main/resources/assets/minelittlepony/models/zombie_villager.json new file mode 100644 index 00000000..a2fc03c9 --- /dev/null +++ b/src/main/resources/assets/minelittlepony/models/zombie_villager.json @@ -0,0 +1,3 @@ +{ + "parent": "minelittlepony:villager" +}