mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Clean up usages of MsonPart
This commit is contained in:
parent
14dc9bc3b8
commit
556b4d780e
6 changed files with 22 additions and 22 deletions
|
@ -125,10 +125,10 @@ public abstract class AbstractPonyModel<T extends LivingEntity> extends ClientPo
|
||||||
|
|
||||||
head.setPivot(1, 2, sneaking ? -1 : 1);
|
head.setPivot(1, 2, sneaking ? -1 : 1);
|
||||||
|
|
||||||
((MsonPart)(Object)rightArm).shift(0, 2, 6);
|
MsonPart.of(rightArm).shift(0, 2, 6);
|
||||||
((MsonPart)(Object)leftArm).shift(0, 2, 6);
|
MsonPart.of(leftArm).shift(0, 2, 6);
|
||||||
((MsonPart)(Object)rightLeg).shift(0, 2, -8);
|
MsonPart.of(rightLeg).shift(0, 2, -8);
|
||||||
((MsonPart)(Object)leftLeg).shift(0, 2, -8);
|
MsonPart.of(leftLeg).shift(0, 2, -8);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void ponySit() {
|
protected void ponySit() {
|
||||||
|
|
|
@ -9,7 +9,6 @@ import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableList;
|
import com.google.common.collect.ImmutableList;
|
||||||
import com.google.common.collect.Iterables;
|
import com.google.common.collect.Iterables;
|
||||||
import com.minelittlepony.mson.api.model.MsonPart;
|
|
||||||
|
|
||||||
import static com.minelittlepony.api.model.PonyModelConstants.PI;
|
import static com.minelittlepony.api.model.PonyModelConstants.PI;
|
||||||
|
|
||||||
|
@ -47,16 +46,16 @@ public class BreezieModel<T extends LivingEntity> extends BipedEntityModel<T> {
|
||||||
leftArm.pitch = MathHelper.cos(move * 0.6662F) * swing;
|
leftArm.pitch = MathHelper.cos(move * 0.6662F) * swing;
|
||||||
leftArm.roll = 0;
|
leftArm.roll = 0;
|
||||||
|
|
||||||
((MsonPart)(Object)rightArm).rotate(swing * MathHelper.cos(move * 0.6662F + PI), 0, 0);
|
rightArm.setAngles(swing * MathHelper.cos(move * 0.6662F + PI), 0, 0);
|
||||||
((MsonPart)(Object)leftLeg) .rotate(swing * MathHelper.cos(move * 0.6662F + PI) * 1.4F, 0, 0);
|
leftLeg .setAngles(swing * MathHelper.cos(move * 0.6662F + PI) * 1.4F, 0, 0);
|
||||||
((MsonPart)(Object)rightLeg).rotate(swing * MathHelper.cos(move * 0.6662F) * 1.4F, 0, 0);
|
rightLeg.setAngles(swing * MathHelper.cos(move * 0.6662F) * 1.4F, 0, 0);
|
||||||
|
|
||||||
if (riding) {
|
if (riding) {
|
||||||
leftArm.pitch += -PI / 5;
|
leftArm.pitch += -PI / 5;
|
||||||
rightArm.pitch += -PI / 5;
|
rightArm.pitch += -PI / 5;
|
||||||
|
|
||||||
rotateLegRiding((MsonPart)(Object)leftLeg, -1);
|
rotateLegRiding(leftLeg, -1);
|
||||||
rotateLegRiding((MsonPart)(Object)rightLeg, 1);
|
rotateLegRiding(rightLeg, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
rotateArm(leftArm, leftArmPose, 1);
|
rotateArm(leftArm, leftArmPose, 1);
|
||||||
|
@ -98,8 +97,8 @@ public class BreezieModel<T extends LivingEntity> extends BipedEntityModel<T> {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
protected void rotateLegRiding(MsonPart leg, float factor) {
|
protected void rotateLegRiding(ModelPart leg, float factor) {
|
||||||
leg.rotate(-1.4137167F, factor * PI / 10, factor * 0.07853982F);
|
leg.setAngles(-1.4137167F, factor * PI / 10, factor * 0.07853982F);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void swingArms(Arm mainHand) {
|
protected void swingArms(Arm mainHand) {
|
||||||
|
|
|
@ -29,10 +29,10 @@ public class ZomponyModel<Zombie extends HostileEntity> extends AlicornModel<Zom
|
||||||
if (isZombified(entity)) {
|
if (isZombified(entity)) {
|
||||||
if (islookAngleRight(move)) {
|
if (islookAngleRight(move)) {
|
||||||
rotateArmHolding(rightArm, 1, getSwingAmount(), ticks);
|
rotateArmHolding(rightArm, 1, getSwingAmount(), ticks);
|
||||||
((MsonPart)(Object)rightArm).shift(0.5F, 1.5F, 3);
|
MsonPart.of(rightArm).shift(0.5F, 1.5F, 3);
|
||||||
} else {
|
} else {
|
||||||
rotateArmHolding(leftArm, -1, getSwingAmount(), ticks);
|
rotateArmHolding(leftArm, -1, getSwingAmount(), ticks);
|
||||||
((MsonPart)(Object)leftArm).shift(-0.5F, 1.5F, 3);
|
MsonPart.of(leftArm).shift(-0.5F, 1.5F, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,10 +20,10 @@ public class ZomponyVillagerModel extends VillagerPonyModel<ZombieVillagerEntity
|
||||||
if (rightArmPose == ArmPose.EMPTY) {
|
if (rightArmPose == ArmPose.EMPTY) {
|
||||||
if (islookAngleRight(move)) {
|
if (islookAngleRight(move)) {
|
||||||
rotateArmHolding(rightArm, 1, getSwingAmount(), ticks);
|
rotateArmHolding(rightArm, 1, getSwingAmount(), ticks);
|
||||||
((MsonPart)(Object)rightArm).shift(0.5F, 1.5F, 3);
|
MsonPart.of(rightArm).shift(0.5F, 1.5F, 3);
|
||||||
} else {
|
} else {
|
||||||
rotateArmHolding(leftArm, -1, getSwingAmount(), ticks);
|
rotateArmHolding(leftArm, -1, getSwingAmount(), ticks);
|
||||||
((MsonPart)(Object)leftArm).shift(-0.5F, 1.5F, 3);
|
MsonPart.of(leftArm).shift(-0.5F, 1.5F, 3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.minelittlepony.api.model.BodyPart;
|
||||||
import com.minelittlepony.api.model.IUnicorn;
|
import com.minelittlepony.api.model.IUnicorn;
|
||||||
import com.minelittlepony.client.model.part.UnicornHorn;
|
import com.minelittlepony.client.model.part.UnicornHorn;
|
||||||
import com.minelittlepony.mson.api.ModelContext;
|
import com.minelittlepony.mson.api.ModelContext;
|
||||||
import com.minelittlepony.mson.api.model.MsonPart;
|
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelPart;
|
import net.minecraft.client.model.ModelPart;
|
||||||
import net.minecraft.client.render.VertexConsumer;
|
import net.minecraft.client.render.VertexConsumer;
|
||||||
|
@ -47,8 +46,11 @@ public class UnicornModel<T extends LivingEntity> extends EarthPonyModel<T> impl
|
||||||
protected void rotateLegs(float move, float swing, float ticks, T entity) {
|
protected void rotateLegs(float move, float swing, float ticks, T entity) {
|
||||||
super.rotateLegs(move, swing, ticks, entity);
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
|
||||||
((MsonPart)(Object)unicornArmRight).rotate(0, 0, 0).around(-7, 12, -2);
|
unicornArmRight.setAngles(0, 0, 0);
|
||||||
((MsonPart)(Object)unicornArmLeft).rotate(0, 0, 0).around(-7, 12, -2);
|
unicornArmRight.setPivot(-7, 12, -2);
|
||||||
|
|
||||||
|
unicornArmLeft.setAngles(0, 0, 0);
|
||||||
|
unicornArmLeft.setPivot(-7, 12, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -9,7 +9,6 @@ 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.ModelContext;
|
||||||
import com.minelittlepony.mson.api.MsonModel;
|
import com.minelittlepony.mson.api.MsonModel;
|
||||||
import com.minelittlepony.mson.api.model.MsonPart;
|
|
||||||
import com.minelittlepony.mson.api.model.PartBuilder;
|
import com.minelittlepony.mson.api.model.PartBuilder;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
@ -36,8 +35,8 @@ public class PonySnout implements IPart, MsonModel {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void rotate(float x, float y, float z) {
|
public void rotate(float x, float y, float z) {
|
||||||
((MsonPart)(Object)mare).rotate(x, y, z);
|
mare.setAngles(x, y, z);
|
||||||
((MsonPart)(Object)stallion).rotate(x, y, z);
|
stallion.setAngles(x, y, z);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue