mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Added changeling models
This commit is contained in:
parent
c3be5cb976
commit
02c19ee69a
11 changed files with 135 additions and 52 deletions
|
@ -28,6 +28,9 @@ public interface PMAPI {
|
||||||
ModelWrapper zebra = new ModelWrapper(new ModelZebra(false));
|
ModelWrapper zebra = new ModelWrapper(new ModelZebra(false));
|
||||||
ModelWrapper zebraSmall = new ModelWrapper(new ModelZebra(true));
|
ModelWrapper zebraSmall = new ModelWrapper(new ModelZebra(true));
|
||||||
|
|
||||||
|
ModelWrapper bug = new ModelWrapper(new ModelChangeling(false));
|
||||||
|
ModelWrapper bugSmall = new ModelWrapper(new ModelChangeling(true));
|
||||||
|
|
||||||
ModelWrapper seapony = new ModelWrapper(new ModelSeapony());
|
ModelWrapper seapony = new ModelWrapper(new ModelSeapony());
|
||||||
|
|
||||||
ModelWrapper zombie = new ModelWrapper(new ModelZombiePony());
|
ModelWrapper zombie = new ModelWrapper(new ModelZombiePony());
|
||||||
|
|
|
@ -0,0 +1,26 @@
|
||||||
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
import com.minelittlepony.model.capabilities.IModelPegasus;
|
||||||
|
|
||||||
|
public class BugWings<T extends AbstractPonyModel & IModelPegasus> extends PegasusWings<T> {
|
||||||
|
|
||||||
|
public BugWings(T model, float yOffset, float stretch) {
|
||||||
|
super(model, yOffset, stretch);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(float yOffset, float stretch) {
|
||||||
|
int x = 57;
|
||||||
|
|
||||||
|
leftWing = new ModelBugWing<T>(pegasus, false, false, yOffset, stretch, x, 16);
|
||||||
|
rightWing = new ModelBugWing<T>(pegasus, true, false, yOffset, stretch, x - 1, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ModelWing<T> getRight() {
|
||||||
|
//pegasus.boxList.clear();
|
||||||
|
//init(0, 0);
|
||||||
|
return rightWing;
|
||||||
|
}
|
||||||
|
}
|
|
@ -4,14 +4,6 @@ import com.minelittlepony.model.AbstractPonyModel;
|
||||||
import com.minelittlepony.model.capabilities.IModelPegasus;
|
import com.minelittlepony.model.capabilities.IModelPegasus;
|
||||||
import com.minelittlepony.render.model.PlaneRenderer;
|
import com.minelittlepony.render.model.PlaneRenderer;
|
||||||
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.EXT_WING_RP_X;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.EXT_WING_RP_Y;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.EXT_WING_RP_Z;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.HEAD_RP_X;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.ROTATE_90;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.WING_FOLDED_RP_Y;
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.WING_FOLDED_RP_Z;
|
|
||||||
|
|
||||||
public class ModelBatWing<T extends AbstractPonyModel & IModelPegasus> extends ModelWing<T> {
|
public class ModelBatWing<T extends AbstractPonyModel & IModelPegasus> extends ModelWing<T> {
|
||||||
|
|
||||||
public ModelBatWing(T pegasus, boolean right, boolean legacy, float y, float scale, int texX, int texY) {
|
public ModelBatWing(T pegasus, boolean right, boolean legacy, float y, float scale, int texX, int texY) {
|
||||||
|
@ -53,15 +45,11 @@ public class ModelBatWing<T extends AbstractPonyModel & IModelPegasus> extends M
|
||||||
.box(-0.4997F, 0, 3, 1, 7, 1, scale);
|
.box(-0.4997F, 0, 3, 1, 7, 1, scale);
|
||||||
|
|
||||||
PlaneRenderer skin = new PlaneRenderer(pegasus)
|
PlaneRenderer skin = new PlaneRenderer(pegasus)
|
||||||
.tex(56, 32);
|
.tex(56, 32)
|
||||||
|
.mirror(right)
|
||||||
|
.west(0, 0, -7, 16, 8, scale);
|
||||||
|
|
||||||
extended.child(0).child(skin);
|
extended.child(0).child(skin);
|
||||||
|
|
||||||
if (right) {
|
|
||||||
skin .west(0, 0, -7, 16, 8, scale);
|
|
||||||
} else {
|
|
||||||
skin.flip().west(0, 0, -7, 16, 8, scale);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -0,0 +1,51 @@
|
||||||
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
import com.minelittlepony.model.capabilities.IModelPegasus;
|
||||||
|
import com.minelittlepony.render.model.PlaneRenderer;
|
||||||
|
|
||||||
|
public class ModelBugWing<T extends AbstractPonyModel & IModelPegasus> extends ModelWing<T> {
|
||||||
|
|
||||||
|
public ModelBugWing(T pegasus, boolean right, boolean legacy, float y, float scale, int texX, int texY) {
|
||||||
|
super(pegasus, right, legacy, y, scale, texX, texY);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addClosedWing(boolean right, float y, float scale) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void addFeathers(boolean right, boolean l, float rotationPointY, float scale) {
|
||||||
|
float r = right ? -1 : 1;
|
||||||
|
|
||||||
|
extended.around((r * (EXT_WING_RP_X - 2)), EXT_WING_RP_Y + rotationPointY, EXT_WING_RP_Z - 2)
|
||||||
|
.mirror(right)
|
||||||
|
.rotateAngleY = r * 3;
|
||||||
|
|
||||||
|
PlaneRenderer primary = new PlaneRenderer(pegasus)
|
||||||
|
.tex(56, 17)
|
||||||
|
.mirror(right)
|
||||||
|
.west(0, 0, -7, 15, 8, scale);
|
||||||
|
PlaneRenderer secondary = new PlaneRenderer(pegasus)
|
||||||
|
.tex(56, 32)
|
||||||
|
.rotate(-0.5F, r * 0.3F, r / 3)
|
||||||
|
.mirror(right)
|
||||||
|
.west(0, 0, -7, 15, 8, scale);
|
||||||
|
|
||||||
|
extended.child(primary);
|
||||||
|
extended.child(secondary);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void rotateWalking(float swing) {
|
||||||
|
folded.rotateAngleY = swing * 0.05F;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render(float scale) {
|
||||||
|
if (pegasus.wingsAreOpen()) {
|
||||||
|
extended.render(scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,14 @@
|
||||||
package com.minelittlepony.model.components;
|
package com.minelittlepony.model.components;
|
||||||
|
|
||||||
import static com.minelittlepony.model.PonyModelConstants.*;
|
|
||||||
|
|
||||||
import com.minelittlepony.model.AbstractPonyModel;
|
import com.minelittlepony.model.AbstractPonyModel;
|
||||||
|
import com.minelittlepony.model.PonyModelConstants;
|
||||||
import com.minelittlepony.model.capabilities.IModelPegasus;
|
import com.minelittlepony.model.capabilities.IModelPegasus;
|
||||||
import com.minelittlepony.pony.data.PonyWearable;
|
import com.minelittlepony.pony.data.PonyWearable;
|
||||||
import com.minelittlepony.render.model.PonyRenderer;
|
import com.minelittlepony.render.model.PonyRenderer;
|
||||||
|
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
|
|
||||||
public class ModelWing<T extends AbstractPonyModel & IModelPegasus> {
|
public class ModelWing<T extends AbstractPonyModel & IModelPegasus> implements PonyModelConstants {
|
||||||
|
|
||||||
protected final T pegasus;
|
protected final T pegasus;
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,10 @@ public class ModelAlicorn extends ModelUnicorn implements IModelPegasus {
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
super.init(yOffset, stretch);
|
super.init(yOffset, stretch);
|
||||||
|
initWings(yOffset, stretch);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initWings(float yOffset, float stretch) {
|
||||||
wings = new PegasusWings<>(this, yOffset, stretch);
|
wings = new PegasusWings<>(this, yOffset, stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,42 +1,20 @@
|
||||||
package com.minelittlepony.model.player;
|
package com.minelittlepony.model.player;
|
||||||
|
|
||||||
import com.minelittlepony.model.components.BatWings;
|
import com.minelittlepony.model.components.BatWings;
|
||||||
import com.minelittlepony.model.components.PegasusWings;
|
|
||||||
import com.minelittlepony.pony.data.PonyWearable;
|
import com.minelittlepony.pony.data.PonyWearable;
|
||||||
import com.minelittlepony.render.model.PonyRenderer;
|
import com.minelittlepony.render.model.PonyRenderer;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
public class ModelBatpony extends ModelPegasus {
|
||||||
|
|
||||||
import com.minelittlepony.model.capabilities.IModelPegasus;
|
|
||||||
|
|
||||||
public class ModelBatpony extends ModelEarthPony implements IModelPegasus {
|
|
||||||
|
|
||||||
public PegasusWings<ModelBatpony> wings;
|
|
||||||
|
|
||||||
public ModelBatpony(boolean smallArms) {
|
public ModelBatpony(boolean smallArms) {
|
||||||
super(smallArms);
|
super(smallArms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
protected void initWings(float yOffset, float stretch) {
|
||||||
super.init(yOffset, stretch);
|
|
||||||
wings = new BatWings<>(this, yOffset, stretch);
|
wings = new BatWings<>(this, yOffset, stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
|
||||||
super.setRotationAngles(move, swing, ticks, headYaw, headPitch, scale, entity);
|
|
||||||
wings.setRotationAndAngles(rainboom, move, swing, 0, ticks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void renderBody(Entity entity, float move, float swing, float ticks, float headYaw, float headPitch, float scale) {
|
|
||||||
super.renderBody(entity, move, swing, ticks, headYaw, headPitch, scale);
|
|
||||||
|
|
||||||
wings.renderPart(scale);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void initEars(PonyRenderer head, float yOffset, float stretch) {
|
protected void initEars(PonyRenderer head, float yOffset, float stretch) {
|
||||||
head.child()
|
head.child()
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package com.minelittlepony.model.player;
|
||||||
|
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import com.minelittlepony.model.components.BugWings;
|
||||||
|
|
||||||
|
public class ModelChangeling extends ModelAlicorn {
|
||||||
|
|
||||||
|
public ModelChangeling(boolean smallArms) {
|
||||||
|
super(smallArms);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initWings(float yOffset, float stretch) {
|
||||||
|
wings = new BugWings<>(this, yOffset, stretch);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float getWingRotationFactor(float ticks) {
|
||||||
|
if (isFlying()) {
|
||||||
|
return MathHelper.sin(ticks * 3) + ROTATE_270 + 0.4f;
|
||||||
|
}
|
||||||
|
return WING_ROT_Z_SNEAK;
|
||||||
|
}
|
||||||
|
}
|
|
@ -16,6 +16,10 @@ public class ModelPegasus extends ModelEarthPony implements IModelPegasus {
|
||||||
@Override
|
@Override
|
||||||
public void init(float yOffset, float stretch) {
|
public void init(float yOffset, float stretch) {
|
||||||
super.init(yOffset, stretch);
|
super.init(yOffset, stretch);
|
||||||
|
initWings(yOffset, stretch);
|
||||||
|
}
|
||||||
|
|
||||||
|
protected void initWings(float yOffset, float stretch) {
|
||||||
wings = new PegasusWings<>(this, yOffset, stretch);
|
wings = new PegasusWings<>(this, yOffset, stretch);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,13 +13,14 @@ public enum PlayerModels {
|
||||||
* The default non-pony model. This is typically handled my the vanilla renderer.
|
* The default non-pony model. This is typically handled my the vanilla renderer.
|
||||||
*/
|
*/
|
||||||
DEFAULT("default", "slim", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
|
DEFAULT("default", "slim", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
|
||||||
EARTH("earthpony", "slimearthpony", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
|
EARTH("earthpony", () -> PMAPI.earthpony, () -> PMAPI.earthponySmall),
|
||||||
PEGASUS("pegasus", "slimpegasus", () -> PMAPI.pegasus, () -> PMAPI.pegasusSmall),
|
PEGASUS("pegasus", () -> PMAPI.pegasus, () -> PMAPI.pegasusSmall),
|
||||||
BATPONY("batpony", "slimbatpony", () -> PMAPI.bat, () -> PMAPI.batSmall),
|
BATPONY("batpony", () -> PMAPI.bat, () -> PMAPI.batSmall),
|
||||||
UNICORN("unicorn", "slimunicorn", () -> PMAPI.unicorn, () -> PMAPI.unicornSmall),
|
UNICORN("unicorn", () -> PMAPI.unicorn, () -> PMAPI.unicornSmall),
|
||||||
ALICORN("alicorn", "slimalicorn", () -> PMAPI.alicorn, () -> PMAPI.alicornSmall),
|
ALICORN("alicorn", () -> PMAPI.alicorn, () -> PMAPI.alicornSmall),
|
||||||
ZEBRA("zebra", "slimzebra", () -> PMAPI.zebra, () -> PMAPI.zebraSmall),
|
CHANGELING("changeling", () -> PMAPI.bug, () -> PMAPI.bugSmall),
|
||||||
SEAPONY("seapony", "slimseapony", () -> PMAPI.seapony, () -> PMAPI.seapony) {
|
ZEBRA("zebra", () -> PMAPI.zebra, () -> PMAPI.zebraSmall),
|
||||||
|
SEAPONY("seapony", () -> PMAPI.seapony, () -> PMAPI.seapony) {
|
||||||
@Override
|
@Override
|
||||||
public RenderPonyPlayer createRenderer(RenderManager manager, boolean slimArms) {
|
public RenderPonyPlayer createRenderer(RenderManager manager, boolean slimArms) {
|
||||||
return new RenderSeaponyPlayer(manager, slimArms, PlayerModels.UNICORN.getModel(slimArms), getModel(slimArms));
|
return new RenderSeaponyPlayer(manager, slimArms, PlayerModels.UNICORN.getModel(slimArms), getModel(slimArms));
|
||||||
|
@ -30,9 +31,13 @@ public enum PlayerModels {
|
||||||
|
|
||||||
private final String normalKey, slimKey;
|
private final String normalKey, slimKey;
|
||||||
|
|
||||||
|
PlayerModels(String key, ModelResolver normal, ModelResolver slim) {
|
||||||
|
this(key, "slim" + key, normal, slim);
|
||||||
|
}
|
||||||
|
|
||||||
PlayerModels(String normalKey, String slimKey, ModelResolver normal, ModelResolver slim) {
|
PlayerModels(String normalKey, String slimKey, ModelResolver normal, ModelResolver slim) {
|
||||||
this.normalKey = normalKey;
|
this.normalKey = normalKey;
|
||||||
this.slimKey = slimKey;
|
this.slimKey = normalKey;
|
||||||
|
|
||||||
this.normal = normal;
|
this.normal = normal;
|
||||||
this.slim = slim;
|
this.slim = slim;
|
||||||
|
|
|
@ -10,9 +10,9 @@ public enum PonyRace implements ITriggerPixelMapped<PonyRace> {
|
||||||
PEGASUS(0x88caf0, PlayerModels.PEGASUS, true, false),
|
PEGASUS(0x88caf0, PlayerModels.PEGASUS, true, false),
|
||||||
UNICORN(0xd19fe4, PlayerModels.UNICORN, false, true),
|
UNICORN(0xd19fe4, PlayerModels.UNICORN, false, true),
|
||||||
ALICORN(0xfef9fc, PlayerModels.ALICORN, true, true),
|
ALICORN(0xfef9fc, PlayerModels.ALICORN, true, true),
|
||||||
CHANGELING(0x282b29, PlayerModels.ALICORN, true, true),
|
CHANGELING(0x282b29, PlayerModels.CHANGELING, true, true),
|
||||||
ZEBRA(0xd0cccf, PlayerModels.ZEBRA, false, false),
|
ZEBRA(0xd0cccf, PlayerModels.ZEBRA, false, false),
|
||||||
REFORMED_CHANGELING(0xcaed5a, PlayerModels.ALICORN, true, true),
|
REFORMED_CHANGELING(0xcaed5a, PlayerModels.CHANGELING, true, true),
|
||||||
GRIFFIN(0xae9145, PlayerModels.PEGASUS, true, false),
|
GRIFFIN(0xae9145, PlayerModels.PEGASUS, true, false),
|
||||||
HIPPOGRIFF(0xd6ddac, PlayerModels.PEGASUS, true, false),
|
HIPPOGRIFF(0xd6ddac, PlayerModels.PEGASUS, true, false),
|
||||||
BATPONY(0xeeeeee, PlayerModels.BATPONY, true, false),
|
BATPONY(0xeeeeee, PlayerModels.BATPONY, true, false),
|
||||||
|
|
Loading…
Reference in a new issue