mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-04-01 01:05:27 +02:00
Update mson
This commit is contained in:
parent
1af3ac0c69
commit
3733289ca4
34 changed files with 155 additions and 378 deletions
|
@ -23,4 +23,4 @@ org.gradle.daemon=false
|
||||||
modmenu_version=6.1.0-rc.4
|
modmenu_version=6.1.0-rc.4
|
||||||
kirin_version=1.14.0-beta.3
|
kirin_version=1.14.0-beta.3
|
||||||
hd_skins_version=6.8.0-beta.1
|
hd_skins_version=6.8.0-beta.1
|
||||||
mson_version=1.8.0-beta.2
|
mson_version=1.8.0-beta.4
|
||||||
|
|
|
@ -3,15 +3,13 @@ package com.minelittlepony.api.model;
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
public interface IPart extends PonyModelConstants {
|
public interface IPart extends PonyModelConstants {
|
||||||
/**
|
/**
|
||||||
* Sets the model's various rotation angles.
|
* Sets the model's various rotation angles.
|
||||||
* <p>
|
* <p>
|
||||||
* See {@link AbstractPonyMode.setRotationAndAngle} for an explanation of the various parameters.
|
* See {@link AbstractPonyMode.setRotationAndAngle} for an explanation of the various parameters.
|
||||||
*/
|
*/
|
||||||
default void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
|
default void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,6 @@ public interface IPegasus extends IModel {
|
||||||
&& (MineLittlePony.getInstance().getConfig().flappyElytras.get() || !getAttributes().isGliding);
|
&& (MineLittlePony.getInstance().getConfig().flappyElytras.get() || !getAttributes().isGliding);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
default boolean isBurdened() {
|
default boolean isBurdened() {
|
||||||
return isWearing(Wearable.SADDLE_BAGS_BOTH) || isWearing(Wearable.SADDLE_BAGS_LEFT) || isWearing(Wearable.SADDLE_BAGS_RIGHT);
|
return isWearing(Wearable.SADDLE_BAGS_BOTH) || isWearing(Wearable.SADDLE_BAGS_LEFT) || isWearing(Wearable.SADDLE_BAGS_RIGHT);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.minelittlepony.api.model;
|
package com.minelittlepony.api.model;
|
||||||
|
|
||||||
import com.minelittlepony.api.pony.IPony;
|
import com.minelittlepony.api.pony.*;
|
||||||
import com.minelittlepony.api.pony.PonyPosture;
|
|
||||||
import com.minelittlepony.client.SkinsProxy;
|
import com.minelittlepony.client.SkinsProxy;
|
||||||
|
import com.minelittlepony.client.pony.PonyData;
|
||||||
import com.minelittlepony.util.MathUtil;
|
import com.minelittlepony.util.MathUtil;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
@ -102,6 +102,11 @@ public class ModelAttributes {
|
||||||
*/
|
*/
|
||||||
public Set<Identifier> featureSkins = new HashSet<>();
|
public Set<Identifier> featureSkins = new HashSet<>();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contains the skin metadata associated with this model.
|
||||||
|
*/
|
||||||
|
public IPonyData metadata = PonyData.NULL;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks flying and speed conditions and sets rainboom to true if we're a species with wings and is going faaast.
|
* Checks flying and speed conditions and sets rainboom to true if we're a species with wings and is going faaast.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -7,6 +7,8 @@ import com.minelittlepony.client.transform.PonyTransformation;
|
||||||
import com.minelittlepony.client.util.render.RenderList;
|
import com.minelittlepony.client.util.render.RenderList;
|
||||||
import com.minelittlepony.mson.util.PartUtil;
|
import com.minelittlepony.mson.util.PartUtil;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.function.Supplier;
|
import java.util.function.Supplier;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
|
@ -38,6 +40,8 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
|
|
||||||
protected final RenderList mainRenderList;
|
protected final RenderList mainRenderList;
|
||||||
|
|
||||||
|
private final List<IPart> parts = new ArrayList<>();
|
||||||
|
|
||||||
public AbstractPonyModel(ModelPart tree) {
|
public AbstractPonyModel(ModelPart tree) {
|
||||||
super(tree);
|
super(tree);
|
||||||
|
|
||||||
|
@ -54,6 +58,11 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
.add(withStage(BodyPart.HEAD, helmetRenderList = RenderList.of(hat)));
|
.add(withStage(BodyPart.HEAD, helmetRenderList = RenderList.of(hat)));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected <P extends IPart> P addPart(P part) {
|
||||||
|
parts.add(part);
|
||||||
|
return part;
|
||||||
|
}
|
||||||
|
|
||||||
protected RenderList forPart(Supplier<IPart> part) {
|
protected RenderList forPart(Supplier<IPart> part) {
|
||||||
return (stack, vertices, overlayUv, lightUv, red, green, blue, alpha) -> {
|
return (stack, vertices, overlayUv, lightUv, red, green, blue, alpha) -> {
|
||||||
part.get().renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, attributes);
|
part.get().renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, attributes);
|
||||||
|
@ -118,7 +127,8 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
|
|
||||||
protected void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
protected void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
||||||
rotateHead(headYaw, headPitch);
|
rotateHead(headYaw, headPitch);
|
||||||
shakeBody(move, swing, getWobbleAmount(), ticks);
|
float bodySwing = getWobbleAmount();
|
||||||
|
shakeBody(move, swing, bodySwing, ticks);
|
||||||
rotateLegs(move, swing, ticks, entity);
|
rotateLegs(move, swing, ticks, entity);
|
||||||
|
|
||||||
if (onSetModelAngles != null) {
|
if (onSetModelAngles != null) {
|
||||||
|
@ -152,6 +162,8 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
if (attributes.isSleeping) {
|
if (attributes.isSleeping) {
|
||||||
ponySleep();
|
ponySleep();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
parts.forEach(part -> part.setRotationAndAngles(attributes, move, swing, bodySwing, ticks));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setHeadRotation(float animationProgress, float yaw, float pitch) {
|
public void setHeadRotation(float animationProgress, float yaw, float pitch) {
|
||||||
|
@ -590,6 +602,8 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
upperTorsoOverlay.visible = visible;
|
upperTorsoOverlay.visible = visible;
|
||||||
|
|
||||||
neck.visible = visible;
|
neck.visible = visible;
|
||||||
|
|
||||||
|
parts.forEach(part -> part.setVisible(visible));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -14,7 +14,6 @@ import com.minelittlepony.api.pony.IPony;
|
||||||
import com.minelittlepony.api.pony.IPonyData;
|
import com.minelittlepony.api.pony.IPonyData;
|
||||||
import com.minelittlepony.api.pony.meta.Size;
|
import com.minelittlepony.api.pony.meta.Size;
|
||||||
import com.minelittlepony.api.pony.meta.Sizes;
|
import com.minelittlepony.api.pony.meta.Sizes;
|
||||||
import com.minelittlepony.client.pony.PonyData;
|
|
||||||
import com.minelittlepony.mson.api.model.biped.MsonPlayer;
|
import com.minelittlepony.mson.api.model.biped.MsonPlayer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -31,11 +30,6 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
||||||
*/
|
*/
|
||||||
protected ModelAttributes attributes = new ModelAttributes();
|
protected ModelAttributes attributes = new ModelAttributes();
|
||||||
|
|
||||||
/**
|
|
||||||
* Associated pony data.
|
|
||||||
*/
|
|
||||||
protected IPonyData metadata = PonyData.NULL;
|
|
||||||
|
|
||||||
@Nullable
|
@Nullable
|
||||||
protected PosingCallback<T> onSetModelAngles;
|
protected PosingCallback<T> onSetModelAngles;
|
||||||
|
|
||||||
|
@ -73,7 +67,7 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IPonyData getMetadata() {
|
public IPonyData getMetadata() {
|
||||||
return metadata;
|
return attributes.metadata;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -83,7 +77,7 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setMetadata(IPonyData meta) {
|
public void setMetadata(IPonyData meta) {
|
||||||
metadata = meta;
|
attributes.metadata = meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,7 +114,6 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends MsonPlayer
|
||||||
|
|
||||||
if (model instanceof ClientPonyModel) {
|
if (model instanceof ClientPonyModel) {
|
||||||
((ClientPonyModel<T>)model).attributes = attributes;
|
((ClientPonyModel<T>)model).attributes = attributes;
|
||||||
((ClientPonyModel<T>)model).metadata = metadata;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.api.pony.IPony;
|
import com.minelittlepony.api.pony.IPony;
|
||||||
import com.minelittlepony.api.pony.IPonyData;
|
import com.minelittlepony.api.pony.IPonyData;
|
||||||
import com.minelittlepony.api.pony.meta.Size;
|
import com.minelittlepony.api.pony.meta.Size;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
import com.minelittlepony.mson.api.model.BoxBuilder.RenderLayerSetter;
|
import com.minelittlepony.mson.api.model.BoxBuilder.RenderLayerSetter;
|
||||||
|
|
||||||
public interface IPonyMixinModel<T extends LivingEntity, M extends IPonyModel<T>> extends IPonyModel<T>, ModelWithArms {
|
public interface IPonyMixinModel<T extends LivingEntity, M extends IPonyModel<T>> extends IPonyModel<T>, ModelWithArms {
|
||||||
|
@ -21,7 +21,7 @@ public interface IPonyMixinModel<T extends LivingEntity, M extends IPonyModel<T>
|
||||||
M mixin();
|
M mixin();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
default void init(ModelContext context) {
|
default void init(ModelView context) {
|
||||||
mixin().init(context);
|
mixin().init(context);
|
||||||
if (mixin() instanceof RenderLayerSetter && this instanceof RenderLayerSetter) {
|
if (mixin() instanceof RenderLayerSetter && this instanceof RenderLayerSetter) {
|
||||||
((RenderLayerSetter)this).setRenderLayerFactory(((RenderLayerSetter)mixin()).getRenderLayerFactory());
|
((RenderLayerSetter)this).setRenderLayerFactory(((RenderLayerSetter)mixin()).getRenderLayerFactory());
|
||||||
|
|
|
@ -2,23 +2,24 @@ package com.minelittlepony.client.model.entity.race;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.IPegasus;
|
import com.minelittlepony.api.model.IPegasus;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.client.model.part.PonyWings;
|
||||||
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
|
||||||
public class AlicornModel<T extends LivingEntity> extends UnicornModel<T> implements IPegasus {
|
public class AlicornModel<T extends LivingEntity> extends UnicornModel<T> implements IPegasus {
|
||||||
|
|
||||||
private IPart wings;
|
private PonyWings<AlicornModel<T>> wings;
|
||||||
|
|
||||||
public AlicornModel(ModelPart tree, boolean smallArms) {
|
public AlicornModel(ModelPart tree, boolean smallArms) {
|
||||||
super(tree, smallArms);
|
super(tree, smallArms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
wings = context.findByName("wings");
|
wings = addPart(context.findByName("wings", PonyWings::new));
|
||||||
bodyRenderList.add(forPart(this::getWings).checked(this::canFly));
|
bodyRenderList.add(forPart(this::getWings).checked(this::canFly));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,19 +27,4 @@ public class AlicornModel<T extends LivingEntity> extends UnicornModel<T> implem
|
||||||
public IPart getWings() {
|
public IPart getWings() {
|
||||||
return wings;
|
return wings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
|
||||||
super.setModelAngles(entity, move, swing, ticks, headYaw, headPitch);
|
|
||||||
|
|
||||||
if (canFly()) {
|
|
||||||
getWings().setRotationAndAngles(attributes.isGoingFast, attributes.interpolatorId, move, swing, 0, ticks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setVisible(boolean visible) {
|
|
||||||
super.setVisible(visible);
|
|
||||||
getWings().setVisible(visible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,8 +2,8 @@ package com.minelittlepony.client.model.entity.race;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.client.model.AbstractPonyModel;
|
import com.minelittlepony.client.model.AbstractPonyModel;
|
||||||
import com.minelittlepony.client.model.part.PonySnout;
|
import com.minelittlepony.client.model.part.*;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -14,7 +14,7 @@ public class EarthPonyModel<T extends LivingEntity> extends AbstractPonyModel<T>
|
||||||
|
|
||||||
protected IPart tail;
|
protected IPart tail;
|
||||||
protected PonySnout snout;
|
protected PonySnout snout;
|
||||||
protected IPart ears;
|
protected PonyEars ears;
|
||||||
|
|
||||||
public EarthPonyModel(ModelPart tree, boolean smallArms) {
|
public EarthPonyModel(ModelPart tree, boolean smallArms) {
|
||||||
super(tree);
|
super(tree);
|
||||||
|
@ -22,42 +22,26 @@ public class EarthPonyModel<T extends LivingEntity> extends AbstractPonyModel<T>
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
|
|
||||||
tail = context.findByName("tail");
|
tail = addPart(context.findByName("tail", this::createTail, IPart.class));
|
||||||
snout = context.findByName("snout");
|
addPart(context.findByName("snout", PonySnout::new));
|
||||||
ears = context.findByName("ears");
|
addPart(context.findByName("ears", PonyEars::new));
|
||||||
|
|
||||||
bodyRenderList.add(forPart(tail));
|
bodyRenderList.add(forPart(tail));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected IPart createTail(ModelPart tree) {
|
||||||
|
return new PonyTail(tree);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
public void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
||||||
super.setModelAngles(entity, move, swing, ticks, headYaw, headPitch);
|
super.setModelAngles(entity, move, swing, ticks, headYaw, headPitch);
|
||||||
snout.setGender(getMetadata().getGender());
|
|
||||||
cape.pivotY = sneaking ? 2 : riding ? -4 : 0;
|
cape.pivotY = sneaking ? 2 : riding ? -4 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setHeadRotation(float animationProgress, float yaw, float pitch) {
|
|
||||||
super.setHeadRotation(animationProgress, yaw, pitch);
|
|
||||||
snout.setGender(getMetadata().getGender());
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
|
||||||
super.shakeBody(move, swing, bodySwing, ticks);
|
|
||||||
tail.setRotationAndAngles(attributes.isSwimming || attributes.isGoingFast, attributes.interpolatorId, move, swing, bodySwing * 5, ticks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setVisible(boolean visible) {
|
|
||||||
super.setVisible(visible);
|
|
||||||
snout.setVisible(visible);
|
|
||||||
tail.setVisible(visible);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float getLegOutset() {
|
protected float getLegOutset() {
|
||||||
if (smallArms) {
|
if (smallArms) {
|
||||||
|
|
|
@ -2,23 +2,24 @@ package com.minelittlepony.client.model.entity.race;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.IPegasus;
|
import com.minelittlepony.api.model.IPegasus;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.client.model.part.PonyWings;
|
||||||
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
|
||||||
public class PegasusModel<T extends LivingEntity> extends EarthPonyModel<T> implements IPegasus {
|
public class PegasusModel<T extends LivingEntity> extends EarthPonyModel<T> implements IPegasus {
|
||||||
|
|
||||||
private IPart wings;
|
private PonyWings<PegasusModel<T>> wings;
|
||||||
|
|
||||||
public PegasusModel(ModelPart tree, boolean smallArms) {
|
public PegasusModel(ModelPart tree, boolean smallArms) {
|
||||||
super(tree, smallArms);
|
super(tree, smallArms);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
wings = context.findByName("wings");
|
wings = addPart(context.findByName("wings", PonyWings::new));
|
||||||
bodyRenderList.add(forPart(this::getWings));
|
bodyRenderList.add(forPart(this::getWings));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -26,16 +27,4 @@ public class PegasusModel<T extends LivingEntity> extends EarthPonyModel<T> impl
|
||||||
public IPart getWings() {
|
public IPart getWings() {
|
||||||
return wings;
|
return wings;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setModelAngles(T entity, float move, float swing, float ticks, float headYaw, float headPitch) {
|
|
||||||
super.setModelAngles(entity, move, swing, ticks, headYaw, headPitch);
|
|
||||||
getWings().setRotationAndAngles(attributes.isGoingFast, entity.getUuid(), move, swing, 0, ticks);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setVisible(boolean visible) {
|
|
||||||
super.setVisible(visible);
|
|
||||||
getWings().setVisible(visible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
package com.minelittlepony.client.model.entity.race;
|
package com.minelittlepony.client.model.entity.race;
|
||||||
|
|
||||||
import com.minelittlepony.client.model.armour.PonyArmourModel;
|
import com.minelittlepony.client.model.armour.PonyArmourModel;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.client.model.part.SeaponyTail;
|
||||||
import com.minelittlepony.api.model.BodyPart;
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.*;
|
||||||
import com.minelittlepony.api.model.armour.ArmourLayer;
|
import com.minelittlepony.api.model.armour.ArmourLayer;
|
||||||
import com.minelittlepony.api.model.armour.ArmourVariant;
|
import com.minelittlepony.api.model.armour.ArmourVariant;
|
||||||
import com.minelittlepony.api.pony.IPony;
|
import com.minelittlepony.api.pony.IPony;
|
||||||
|
@ -34,7 +34,12 @@ public class SeaponyModel<T extends LivingEntity> extends UnicornModel<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
protected IPart createTail(ModelPart tree) {
|
||||||
|
return new SeaponyTail(tree);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void init(ModelView context) {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
setVisible(true);
|
setVisible(true);
|
||||||
bodyRenderList.clear();
|
bodyRenderList.clear();
|
||||||
|
|
|
@ -5,7 +5,7 @@ import com.minelittlepony.api.model.IUnicorn;
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.client.model.part.UnicornHorn;
|
import com.minelittlepony.client.model.part.UnicornHorn;
|
||||||
import com.minelittlepony.client.util.render.RenderList;
|
import com.minelittlepony.client.util.render.RenderList;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.entity.LivingEntity;
|
import net.minecraft.entity.LivingEntity;
|
||||||
|
@ -28,9 +28,9 @@ public class UnicornModel<T extends LivingEntity> extends EarthPonyModel<T> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
super.init(context);
|
super.init(context);
|
||||||
horn = context.findByName("horn");
|
horn = addPart(context.findByName("horn", UnicornHorn::new));
|
||||||
headRenderList.add(RenderList.of().add(head::rotate).add(forPart(horn)).checked(this::hasHorn));
|
headRenderList.add(RenderList.of().add(head::rotate).add(forPart(horn)).checked(this::hasHorn));
|
||||||
this.mainRenderList.add(withStage(BodyPart.HEAD, RenderList.of().add(head::rotate).add((stack, vertices, overlayUv, lightUv, red, green, blue, alpha) -> {
|
this.mainRenderList.add(withStage(BodyPart.HEAD, RenderList.of().add(head::rotate).add((stack, vertices, overlayUv, lightUv, red, green, blue, alpha) -> {
|
||||||
horn.renderMagic(stack, vertices, getMagicColor());
|
horn.renderMagic(stack, vertices, getMagicColor());
|
||||||
|
@ -73,10 +73,4 @@ public class UnicornModel<T extends LivingEntity> extends EarthPonyModel<T> impl
|
||||||
}
|
}
|
||||||
return super.getArm(side);
|
return super.getArm(side);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setVisible(boolean visible) {
|
|
||||||
super.setVisible(visible);
|
|
||||||
horn.setVisible(visible);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,38 +0,0 @@
|
||||||
package com.minelittlepony.client.model.part;
|
|
||||||
|
|
||||||
import net.minecraft.client.model.Model;
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPegasus;
|
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
|
||||||
|
|
||||||
public class BatWings<T extends Model & IPegasus> extends PegasusWings<T> {
|
|
||||||
|
|
||||||
public BatWings(ModelPart tree) {
|
|
||||||
super(tree);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, ModelAttributes attributes) {
|
|
||||||
stack.push();
|
|
||||||
stack.scale(1.3F, 1.3F, 1.3F);
|
|
||||||
|
|
||||||
super.renderPart(stack, vertices, overlayUv, lightUv, red, green, blue, alpha, attributes);
|
|
||||||
|
|
||||||
stack.pop();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static class Wing extends PegasusWings.Wing {
|
|
||||||
|
|
||||||
public Wing(ModelPart tree) {
|
|
||||||
super(tree);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void rotateWalking(float swing) {
|
|
||||||
folded.yaw = swing * 0.05F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -7,39 +7,30 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.client.model.IPonyModel;
|
|
||||||
import com.minelittlepony.common.util.animation.Interpolator;
|
import com.minelittlepony.common.util.animation.Interpolator;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
public class LionTail implements IPart {
|
||||||
|
|
||||||
public class LionTail implements IPart, MsonModel {
|
|
||||||
|
|
||||||
private ModelPart tail;
|
private ModelPart tail;
|
||||||
private IPonyModel<?> model;
|
|
||||||
|
|
||||||
public LionTail(ModelPart tree) {
|
public LionTail(ModelPart tree) {
|
||||||
tail = tree.getChild("tail");
|
tail = tree.getChild("tail");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
model = context.getModel();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
bodySwing *= 5;
|
||||||
public void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
|
|
||||||
|
|
||||||
float baseSail = 1F;
|
float baseSail = 1F;
|
||||||
|
|
||||||
float speed = swing > 0.01F ? 6 : 90;
|
float speed = swing > 0.01F ? 6 : 90;
|
||||||
Interpolator interpolator = Interpolator.linear(interpolatorId);
|
Interpolator interpolator = Interpolator.linear(attributes.interpolatorId);
|
||||||
|
|
||||||
float straightness = 1.6F * (1 + (float)Math.sin(ticks / speed) / 8F);
|
float straightness = 1.6F * (1 + (float)Math.sin(ticks / speed) / 8F);
|
||||||
float bend = (float)Math.sin(Math.PI/2F + 2 * ticks / speed) / 16F;
|
float bend = (float)Math.sin(Math.PI/2F + 2 * ticks / speed) / 16F;
|
||||||
|
|
||||||
if (model.getAttributes().isCrouching) {
|
if (attributes.isCrouching) {
|
||||||
baseSail += 1;
|
baseSail += 1;
|
||||||
straightness += 0.5F;
|
straightness += 0.5F;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,23 +6,21 @@ import net.minecraft.client.util.math.MatrixStack;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.*;
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
import com.minelittlepony.mson.api.model.PartBuilder;
|
import com.minelittlepony.mson.api.model.PartBuilder;
|
||||||
|
|
||||||
public class PonyEars implements IPart, MsonModel {
|
public class PonyEars implements IPart, MsonModel {
|
||||||
private ModelPart right;
|
private final ModelPart right;
|
||||||
private ModelPart left;
|
private final ModelPart left;
|
||||||
|
|
||||||
public PonyEars(ModelPart tree) {
|
public PonyEars(ModelPart tree) {
|
||||||
|
right = tree.getChild("right");
|
||||||
|
left = tree.getChild("left");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
right = context.findByName("right");
|
PartBuilder head = context.getThis();
|
||||||
left = context.findByName("left");
|
|
||||||
|
|
||||||
PartBuilder head = context.getContext();
|
|
||||||
head.addChild("right_ear_" + hashCode(), right);
|
head.addChild("right_ear_" + hashCode(), right);
|
||||||
head.addChild("left_ear_" + hashCode(), left);
|
head.addChild("left_ear_" + hashCode(), left);
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,8 +8,7 @@ import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.api.pony.meta.Gender;
|
import com.minelittlepony.api.pony.meta.Gender;
|
||||||
import com.minelittlepony.client.MineLittlePony;
|
import com.minelittlepony.client.MineLittlePony;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.*;
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
import com.minelittlepony.mson.api.model.PartBuilder;
|
import com.minelittlepony.mson.api.model.PartBuilder;
|
||||||
|
|
||||||
public class PonySnout implements IPart, MsonModel {
|
public class PonySnout implements IPart, MsonModel {
|
||||||
|
@ -25,8 +24,8 @@ public class PonySnout implements IPart, MsonModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
PartBuilder head = context.getContext();
|
PartBuilder head = context.getThis();
|
||||||
head.addChild("mare", mare);
|
head.addChild("mare", mare);
|
||||||
head.addChild("stallion", stallion);
|
head.addChild("stallion", stallion);
|
||||||
}
|
}
|
||||||
|
@ -36,6 +35,11 @@ public class PonySnout implements IPart, MsonModel {
|
||||||
stallion.setAngles(x, y, z);
|
stallion.setAngles(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
|
setGender(attributes.metadata.getGender());
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, ModelAttributes attributes) {
|
public void renderPart(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha, ModelAttributes attributes) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,13 +9,10 @@ import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.api.pony.meta.TailShape;
|
import com.minelittlepony.api.pony.meta.TailShape;
|
||||||
import com.minelittlepony.client.model.AbstractPonyModel;
|
import com.minelittlepony.client.model.AbstractPonyModel;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.*;
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.UUID;
|
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
|
|
||||||
public class PonyTail implements IPart, MsonModel {
|
public class PonyTail implements IPart, MsonModel {
|
||||||
|
|
||||||
|
@ -32,30 +29,24 @@ public class PonyTail implements IPart, MsonModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
model = context.getModel();
|
model = context.getModel();
|
||||||
|
|
||||||
try {
|
int segments = (int)context.getLocalValue("segments", 4);
|
||||||
int segments = context.getLocals().getLocal("segments").get().intValue();
|
|
||||||
|
|
||||||
ModelContext subContext = context.resolve(this);
|
for (int i = 0; i < segments; i++) {
|
||||||
|
Segment segment = context.findByName("segment_" + i, Segment::new);
|
||||||
for (int i = 0; i < segments; i++) {
|
segment.tail = this;
|
||||||
Segment segment = subContext.findByName("segment_" + i);
|
segment.index = i;
|
||||||
segment.tail = this;
|
this.segments.add(segment);
|
||||||
segment.index = i;
|
|
||||||
this.segments.add(segment);
|
|
||||||
}
|
|
||||||
|
|
||||||
} catch (InterruptedException | ExecutionException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
|
public void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
|
boolean rainboom = attributes.isSwimming || attributes.isGoingFast;
|
||||||
tail.roll = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2f * swing;
|
tail.roll = rainboom ? 0 : MathHelper.cos(move * 0.8F) * 0.2f * swing;
|
||||||
tail.yaw = bodySwing;
|
tail.yaw = bodySwing * 5;
|
||||||
|
|
||||||
if (model.getAttributes().isCrouching && !rainboom) {
|
if (model.getAttributes().isCrouching && !rainboom) {
|
||||||
rotateSneak();
|
rotateSneak();
|
||||||
|
|
|
@ -8,12 +8,10 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.*;
|
import com.minelittlepony.api.model.*;
|
||||||
import com.minelittlepony.api.pony.meta.Wearable;
|
import com.minelittlepony.api.pony.meta.Wearable;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.ModelView;
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
import com.minelittlepony.mson.api.MsonModel;
|
||||||
|
|
||||||
import java.util.UUID;
|
public class PonyWings<T extends Model & IPegasus> implements IPart, MsonModel {
|
||||||
|
|
||||||
public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonModel {
|
|
||||||
|
|
||||||
protected T pegasus;
|
protected T pegasus;
|
||||||
|
|
||||||
|
@ -22,16 +20,21 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
|
|
||||||
protected Wing legacyWing;
|
protected Wing legacyWing;
|
||||||
|
|
||||||
public PegasusWings(ModelPart tree) {
|
private float wingScale;
|
||||||
|
private float walkingRotationSpeed;
|
||||||
|
|
||||||
|
public PonyWings(ModelPart tree) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
pegasus = context.getModel();
|
pegasus = context.getModel();
|
||||||
leftWing = context.findByName("left_wing");
|
leftWing = context.findByName("left_wing", Wing::new);
|
||||||
rightWing = context.findByName("right_wing");
|
rightWing = context.findByName("right_wing", Wing::new);
|
||||||
legacyWing = context.findByName("legacy_right_wing");
|
legacyWing = context.findByName("legacy_right_wing", Wing::new);
|
||||||
|
wingScale = context.getLocalValue("wing_scale", 1); // pegasi 1 / bats 1.3F
|
||||||
|
walkingRotationSpeed = context.getLocalValue("walking_rotation_speed", 0.15F); // pegasi 0.15 / bats 0.05F
|
||||||
}
|
}
|
||||||
|
|
||||||
public Wing getLeft() {
|
public Wing getLeft() {
|
||||||
|
@ -43,7 +46,7 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
|
public void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
float flap = 0;
|
float flap = 0;
|
||||||
float progress = pegasus.getSwingAmount();
|
float progress = pegasus.getSwingAmount();
|
||||||
|
|
||||||
|
@ -65,7 +68,7 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
|
|
||||||
if (pegasus.wingsAreOpen()) {
|
if (pegasus.wingsAreOpen()) {
|
||||||
flapAngle = pegasus.getWingRotationFactor(ticks);
|
flapAngle = pegasus.getWingRotationFactor(ticks);
|
||||||
if (!pegasus.getAttributes().isCrouching && pegasus.isBurdened()) {
|
if (!attributes.isCrouching && pegasus.isBurdened()) {
|
||||||
flapAngle -= 1F;
|
flapAngle -= 1F;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -73,7 +76,7 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!pegasus.isFlying()) {
|
if (!pegasus.isFlying()) {
|
||||||
flapAngle = pegasus.getMetadata().getInterpolator(interpolatorId).interpolate("wingFlap", flapAngle, 10);
|
flapAngle = pegasus.getMetadata().getInterpolator(attributes.interpolatorId).interpolate("wingFlap", flapAngle, 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
getLeft().rotateFlying(flapAngle);
|
getLeft().rotateFlying(flapAngle);
|
||||||
|
@ -87,26 +90,25 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
getRight().render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
|
getRight().render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static class Wing implements MsonModel {
|
public class Wing implements MsonModel {
|
||||||
|
|
||||||
protected IPegasus pegasus;
|
protected IPegasus pegasus;
|
||||||
|
|
||||||
protected ModelPart extended;
|
protected final ModelPart extended;
|
||||||
protected ModelPart folded;
|
protected final ModelPart folded;
|
||||||
|
|
||||||
public Wing(ModelPart tree) {
|
public Wing(ModelPart tree) {
|
||||||
|
extended = tree.getChild("extended");
|
||||||
|
folded = tree.getChild("folded");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void init(ModelView context) {
|
||||||
pegasus = context.getModel();
|
pegasus = context.getModel();
|
||||||
extended = context.findByName("extended");
|
|
||||||
folded = context.findByName("folded");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rotateWalking(float swing) {
|
public void rotateWalking(float swing) {
|
||||||
folded.yaw = swing * 0.15F;
|
folded.yaw = swing * walkingRotationSpeed;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rotateFlying(float angle) {
|
public void rotateFlying(float angle) {
|
||||||
|
@ -114,6 +116,9 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
}
|
}
|
||||||
|
|
||||||
public void render(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
|
public void render(MatrixStack stack, VertexConsumer vertices, int overlayUv, int lightUv, float red, float green, float blue, float alpha) {
|
||||||
|
stack.push();
|
||||||
|
stack.scale(wingScale, wingScale, wingScale);
|
||||||
|
|
||||||
if (pegasus.wingsAreOpen()) {
|
if (pegasus.wingsAreOpen()) {
|
||||||
extended.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
|
extended.render(stack, vertices, overlayUv, lightUv, red, green, blue, alpha);
|
||||||
} else {
|
} else {
|
||||||
|
@ -127,6 +132,8 @@ public class PegasusWings<T extends Model & IPegasus> implements IPart, MsonMode
|
||||||
stack.pop();
|
stack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
stack.pop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -2,43 +2,30 @@ package com.minelittlepony.client.model.part;
|
||||||
|
|
||||||
import com.minelittlepony.api.model.IPart;
|
import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.client.model.IPonyModel;
|
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
|
|
||||||
import java.util.UUID;
|
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
import net.minecraft.client.util.math.MatrixStack;
|
import net.minecraft.client.util.math.MatrixStack;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class SeaponyTail implements IPart, MsonModel {
|
public class SeaponyTail implements IPart {
|
||||||
|
|
||||||
private static final float TAIL_ROTX = PI / 2;
|
private static final float TAIL_ROTX = PI / 2;
|
||||||
|
|
||||||
private ModelPart tailBase;
|
private final ModelPart tailBase;
|
||||||
|
|
||||||
private ModelPart tailTip;
|
private final ModelPart tailTip;
|
||||||
private ModelPart tailFins;
|
private final ModelPart tailFins;
|
||||||
|
|
||||||
private IPonyModel<?> model;
|
|
||||||
|
|
||||||
public SeaponyTail(ModelPart tree) {
|
public SeaponyTail(ModelPart tree) {
|
||||||
|
tailBase = tree.getChild("base");
|
||||||
|
tailTip = tree.getChild("tip");
|
||||||
|
tailFins = tree.getChild("fins");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void init(ModelContext context) {
|
public void setRotationAndAngles(ModelAttributes attributes, float move, float swing, float bodySwing, float ticks) {
|
||||||
model = context.getModel();
|
float rotation = attributes.isSleeping ? 0 : MathHelper.sin(ticks * 0.536f) / 4;
|
||||||
tailBase = context.findByName("base");
|
|
||||||
tailTip = context.findByName("tip");
|
|
||||||
tailFins = context.findByName("fins");
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void setRotationAndAngles(boolean rainboom, UUID interpolatorId, float move, float swing, float bodySwing, float ticks) {
|
|
||||||
float rotation = model.getAttributes().isSleeping ? 0 : MathHelper.sin(ticks * 0.536f) / 4;
|
|
||||||
|
|
||||||
tailBase.pitch = TAIL_ROTX + rotation;
|
tailBase.pitch = TAIL_ROTX + rotation;
|
||||||
tailTip.pitch = rotation;
|
tailTip.pitch = rotation;
|
||||||
|
|
|
@ -11,24 +11,17 @@ import com.minelittlepony.api.model.IPart;
|
||||||
import com.minelittlepony.api.model.ModelAttributes;
|
import com.minelittlepony.api.model.ModelAttributes;
|
||||||
import com.minelittlepony.client.render.MagicGlow;
|
import com.minelittlepony.client.render.MagicGlow;
|
||||||
import com.minelittlepony.common.util.Color;
|
import com.minelittlepony.common.util.Color;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
|
||||||
|
|
||||||
public class UnicornHorn implements IPart, MsonModel {
|
public class UnicornHorn implements IPart {
|
||||||
|
|
||||||
private ModelPart horn;
|
private final ModelPart horn;
|
||||||
private ModelPart glow;
|
private final ModelPart glow;
|
||||||
|
|
||||||
protected boolean visible = true;
|
protected boolean visible = true;
|
||||||
|
|
||||||
public UnicornHorn(ModelPart tree) {
|
public UnicornHorn(ModelPart tree) {
|
||||||
|
horn = tree.getChild("bone");
|
||||||
}
|
glow = tree.getChild("corona");
|
||||||
|
|
||||||
@Override
|
|
||||||
public void init(ModelContext context) {
|
|
||||||
horn = context.findByName("bone");
|
|
||||||
glow = context.findByName("corona");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,9 +1,12 @@
|
||||||
{
|
{
|
||||||
|
"locals": {
|
||||||
|
"wing_scale": 1.3,
|
||||||
|
"walking_rotation_speed": "0.05"
|
||||||
|
},
|
||||||
"data": {
|
"data": {
|
||||||
"left_wing": {
|
"left_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "left_wing",
|
"name": "left_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.BatWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": {
|
"folded": {
|
||||||
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
||||||
|
@ -57,7 +60,6 @@
|
||||||
"right_wing": {
|
"right_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "right_wing",
|
"name": "right_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.BatWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": {
|
"folded": {
|
||||||
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"left_wing": {
|
"left_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "left_wing",
|
"name": "left_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": "#extended",
|
"folded": "#extended",
|
||||||
"extended": {
|
"extended": {
|
||||||
|
@ -27,7 +26,6 @@
|
||||||
"right_wing": {
|
"right_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "right_wing",
|
"name": "right_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": "#extended",
|
"folded": "#extended",
|
||||||
"extended": {
|
"extended": {
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
"left_wing": {
|
"left_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "left_wing",
|
"name": "left_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": {
|
"folded": {
|
||||||
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},
|
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},
|
||||||
|
@ -33,7 +32,6 @@
|
||||||
"right_wing": {
|
"right_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "right_wing",
|
"name": "right_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": {
|
"folded": {
|
||||||
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
"texture": {"u": 56, "v": 16, "w": 64, "h": 64},
|
||||||
|
@ -63,7 +61,6 @@
|
||||||
"legacy_right_wing": {
|
"legacy_right_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "legacy_right_wing",
|
"name": "legacy_right_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": {
|
"folded": {
|
||||||
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},
|
"texture": {"u": 56, "v": 32, "w": 64, "h": 64},
|
||||||
|
|
|
@ -10,28 +10,24 @@
|
||||||
"segment_0": {
|
"segment_0": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "segment_0",
|
"name": "segment_0",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
|
|
||||||
"locals": { "segment_index": 0 },
|
"locals": { "segment_index": 0 },
|
||||||
"data": "minelittlepony:components/tail_segment"
|
"data": "minelittlepony:components/tail_segment"
|
||||||
},
|
},
|
||||||
"segment_1": {
|
"segment_1": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "segment_1",
|
"name": "segment_1",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
|
|
||||||
"locals": { "segment_index": 1 },
|
"locals": { "segment_index": 1 },
|
||||||
"data": "minelittlepony:components/tail_segment"
|
"data": "minelittlepony:components/tail_segment"
|
||||||
},
|
},
|
||||||
"segment_2": {
|
"segment_2": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "segment_2",
|
"name": "segment_2",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
|
|
||||||
"locals": { "segment_index": 2 },
|
"locals": { "segment_index": 2 },
|
||||||
"data": "minelittlepony:components/tail_segment"
|
"data": "minelittlepony:components/tail_segment"
|
||||||
},
|
},
|
||||||
"segment_3": {
|
"segment_3": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "segment_3",
|
"name": "segment_3",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyTail$Segment",
|
|
||||||
"locals": { "segment_index": 3 },
|
"locals": { "segment_index": 3 },
|
||||||
"data": "minelittlepony:components/tail_segment"
|
"data": "minelittlepony:components/tail_segment"
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,24 +11,9 @@
|
||||||
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": { "data": "minelittlepony:components/snout" },
|
||||||
"type": "mson:slot",
|
"ears": { "data": "minelittlepony:components/ears" },
|
||||||
"name": "snout",
|
"horn": { "data": "minelittlepony:components/horn" },
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"data": "minelittlepony:components/ears"
|
|
||||||
},
|
|
||||||
"horn": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "horn",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
|
|
||||||
"data": "minelittlepony:components/horn"
|
|
||||||
},
|
|
||||||
"left_horn": {
|
"left_horn": {
|
||||||
"texture": {"u": 0, "v": 52},
|
"texture": {"u": 0, "v": 52},
|
||||||
"name": "left_horn",
|
"name": "left_horn",
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minelittlepony:races/steve/unicorn",
|
"parent": "minelittlepony:races/steve/unicorn",
|
||||||
"data": {
|
"data": {
|
||||||
"wings": {
|
"wings": { "data": "minelittlepony:components/pegasus_wings" }
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "wings",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings",
|
|
||||||
"data": "minelittlepony:components/pegasus_wings"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,25 +6,10 @@
|
||||||
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": { "data": "minelittlepony:components/snout" },
|
||||||
"type": "mson:slot",
|
"ears": { "data": "minelittlepony:components/bat_ears" }
|
||||||
"name": "snout",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"data": "minelittlepony:components/bat_ears"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"wings": {
|
"wings": { "data": "minelittlepony:components/bat_wings" }
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "wings",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.BatWings",
|
|
||||||
"data": "minelittlepony:components/bat_wings"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minelittlepony:races/steve/alicorn",
|
"parent": "minelittlepony:races/steve/alicorn",
|
||||||
"data": {
|
"data": {
|
||||||
"wings": {
|
"wings": { "data": "minelittlepony:components/bug_wings" }
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "wings",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings",
|
|
||||||
"data": "minelittlepony:components/bug_wings"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,15 +7,9 @@
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": {
|
||||||
"type": "mson:slot",
|
"data": "minelittlepony:components/snout"
|
||||||
"name": "snout",
|
},
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
"ears": {
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"locals": {
|
"locals": {
|
||||||
"ear_pronouncement": 0.9,
|
"ear_pronouncement": 0.9,
|
||||||
"ear_spread": 3
|
"ear_spread": 3
|
||||||
|
@ -23,9 +17,6 @@
|
||||||
"data": "minelittlepony:components/ears"
|
"data": "minelittlepony:components/ears"
|
||||||
},
|
},
|
||||||
"horn": {
|
"horn": {
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "horn",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
|
|
||||||
"locals": {
|
"locals": {
|
||||||
"incline": 19,
|
"incline": 19,
|
||||||
"scale": 0.5
|
"scale": 0.5
|
||||||
|
@ -50,8 +41,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"tail": {
|
"tail": {
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "tail",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.LionTail",
|
"implementation": "com.minelittlepony.client.model.part.LionTail",
|
||||||
"data": "minelittlepony:components/lion_tail"
|
"data": "minelittlepony:components/lion_tail"
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,6 @@
|
||||||
{
|
{
|
||||||
"parent": "minelittlepony:steve_pony",
|
"parent": "minelittlepony:steve_pony",
|
||||||
"data": {
|
"data": {
|
||||||
"wings": {
|
"wings": { "data": "minelittlepony:components/pegasus_wings" }
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "wings",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings",
|
|
||||||
"data": "minelittlepony:components/pegasus_wings"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,16 +6,8 @@
|
||||||
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": { "data": "minelittlepony:components/snout" },
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "snout",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
"ears": {
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"texture": {"w": 64, "h": 64 },
|
"texture": {"w": 64, "h": 64 },
|
||||||
"data": {
|
"data": {
|
||||||
"right": {
|
"right": {
|
||||||
|
@ -48,12 +40,7 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"horn": {
|
"horn": { "data": "minelittlepony:components/horn" },
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "horn",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
|
|
||||||
"data": "minelittlepony:components/horn"
|
|
||||||
},
|
|
||||||
"right_antler": {
|
"right_antler": {
|
||||||
"pivot": [-2, -6, -2],
|
"pivot": [-2, -6, -2],
|
||||||
"rotate": [0, 0, 120],
|
"rotate": [0, 0, 120],
|
||||||
|
@ -97,12 +84,10 @@
|
||||||
"wings": {
|
"wings": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "wings",
|
"name": "wings",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings",
|
|
||||||
"data": {
|
"data": {
|
||||||
"left_wing": {
|
"left_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "left_wing",
|
"name": "left_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": "#extended",
|
"folded": "#extended",
|
||||||
"extended": {
|
"extended": {
|
||||||
|
@ -126,7 +111,6 @@
|
||||||
"right_wing": {
|
"right_wing": {
|
||||||
"type": "mson:slot",
|
"type": "mson:slot",
|
||||||
"name": "right_wing",
|
"name": "right_wing",
|
||||||
"implementation": "com.minelittlepony.client.model.part.PegasusWings$Wing",
|
|
||||||
"data": {
|
"data": {
|
||||||
"folded": "#extended",
|
"folded": "#extended",
|
||||||
"extended": {
|
"extended": {
|
||||||
|
|
|
@ -1,22 +1,5 @@
|
||||||
{
|
{
|
||||||
"parent": "minelittlepony:races/steve/alicorn",
|
"parent": "minelittlepony:races/steve/alicorn",
|
||||||
"skeleton": {
|
|
||||||
"abdomin": {
|
|
||||||
"body": {
|
|
||||||
"neck": {
|
|
||||||
"head": {
|
|
||||||
"horn": {}
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"left_arm": {},
|
|
||||||
"right_arm": {}
|
|
||||||
},
|
|
||||||
"left_fin": {},
|
|
||||||
"right_fin": {},
|
|
||||||
"center_fin": {},
|
|
||||||
"tail": { }
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"data": {
|
"data": {
|
||||||
"left_fin": {
|
"left_fin": {
|
||||||
"type": "mson:planar",
|
"type": "mson:planar",
|
||||||
|
@ -45,8 +28,6 @@
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"tail": {
|
"tail": {
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "tail",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.SeaponyTail",
|
"implementation": "com.minelittlepony.client.model.part.SeaponyTail",
|
||||||
"data": "minelittlepony:components/fish_tail"
|
"data": "minelittlepony:components/fish_tail"
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,24 +6,9 @@
|
||||||
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": { "data": "minelittlepony:components/snout" },
|
||||||
"type": "mson:slot",
|
"ears": { "data": "minelittlepony:components/ears" },
|
||||||
"name": "snout",
|
"horn": { "data": "minelittlepony:components/horn" }
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"data": "minelittlepony:components/ears"
|
|
||||||
},
|
|
||||||
"horn": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "horn",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.UnicornHorn",
|
|
||||||
"data": "minelittlepony:components/horn"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"right_cast": {
|
"right_cast": {
|
||||||
|
|
|
@ -11,18 +11,8 @@
|
||||||
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
{ "from": [-4, -6, -6], "size": [ 8, 8, 8] }
|
||||||
],
|
],
|
||||||
"children": {
|
"children": {
|
||||||
"snout": {
|
"snout": { "data": "minelittlepony:components/snout" },
|
||||||
"type": "mson:slot",
|
"ears": { "data": "minelittlepony:components/ears" },
|
||||||
"name": "snout",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonySnout",
|
|
||||||
"data": "minelittlepony:components/snout"
|
|
||||||
},
|
|
||||||
"ears": {
|
|
||||||
"type": "mson:slot",
|
|
||||||
"name": "ears",
|
|
||||||
"implementation": "com.minelittlepony.client.model.part.PonyEars",
|
|
||||||
"data": "minelittlepony:components/ears"
|
|
||||||
},
|
|
||||||
"bristles": {
|
"bristles": {
|
||||||
"texture": {"u": 56, "v": 32},
|
"texture": {"u": 56, "v": 32},
|
||||||
"rotate": [17, 0, 0],
|
"rotate": [17, 0, 0],
|
||||||
|
|
Loading…
Add table
Reference in a new issue