mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 16:24:23 +01:00
Made zombie villagers act a bit more like zombies. And villagers.
This commit is contained in:
parent
972a49c024
commit
db14308a0c
9 changed files with 65 additions and 36 deletions
|
@ -3,40 +3,18 @@ package com.minelittlepony.model;
|
||||||
import com.minelittlepony.model.player.ModelAlicorn;
|
import com.minelittlepony.model.player.ModelAlicorn;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Common class for all humanoid (ponioid?) non-player enemies.
|
* Common class for all humanoid (ponioid?) non-player enemies.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ModelMobPony extends ModelAlicorn {
|
public abstract class ModelMobPony extends ModelAlicorn {
|
||||||
|
|
||||||
public ModelMobPony() {
|
public ModelMobPony() {
|
||||||
super(false);
|
super(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
|
||||||
super.rotateLegs(move, swing, ticks, entity);
|
|
||||||
|
|
||||||
if (rightArmPose != ArmPose.EMPTY) {
|
|
||||||
if (canCast()) {
|
|
||||||
rotateArmHolding(unicornArmRight, -1, swingProgress, ticks);
|
|
||||||
} else {
|
|
||||||
rotateArmHolding(bipedRightArm, -1, swingProgress, ticks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (leftArmPose != ArmPose.EMPTY) {
|
|
||||||
if (canCast()) {
|
|
||||||
rotateArmHolding(unicornArmLeft, -1, swingProgress, ticks);
|
|
||||||
} else {
|
|
||||||
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Rotates the provided arm to the correct orientation for holding an item.
|
* Rotates the provided arm to the correct orientation for holding an item.
|
||||||
*
|
*
|
||||||
|
|
|
@ -36,6 +36,7 @@ public interface PMAPI {
|
||||||
ModelWrapper zombie = new ModelWrapper(new ModelZombiePony());
|
ModelWrapper zombie = new ModelWrapper(new ModelZombiePony());
|
||||||
ModelWrapper skeleton = new ModelWrapper(new ModelSkeletonPony());
|
ModelWrapper skeleton = new ModelWrapper(new ModelSkeletonPony());
|
||||||
ModelWrapper villager = new ModelWrapper(new ModelVillagerPony());
|
ModelWrapper villager = new ModelWrapper(new ModelVillagerPony());
|
||||||
|
ModelWrapper zombieVillager = new ModelWrapper(new ModelZombieVillagerPony());
|
||||||
ModelWrapper illager = new ModelWrapper(new ModelIllagerPony());
|
ModelWrapper illager = new ModelWrapper(new ModelIllagerPony());
|
||||||
ModelWrapper witch = new ModelWrapper(new ModelWitchPony());
|
ModelWrapper witch = new ModelWrapper(new ModelWitchPony());
|
||||||
ModelWrapper enderman = new ModelWrapper(new ModelEnderStallion());
|
ModelWrapper enderman = new ModelWrapper(new ModelEnderStallion());
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
package com.minelittlepony.model.ponies;
|
package com.minelittlepony.model.ponies;
|
||||||
|
|
||||||
import com.minelittlepony.model.player.ModelAlicorn;
|
import com.minelittlepony.model.ModelMobPony;
|
||||||
|
|
||||||
import net.minecraft.client.model.ModelRenderer;
|
import net.minecraft.client.model.ModelRenderer;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
@ -9,11 +9,7 @@ import net.minecraft.entity.monster.AbstractIllager.IllagerArmPose;
|
||||||
import net.minecraft.util.EnumHandSide;
|
import net.minecraft.util.EnumHandSide;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class ModelIllagerPony extends ModelAlicorn {
|
public class ModelIllagerPony extends ModelMobPony {
|
||||||
|
|
||||||
public ModelIllagerPony() {
|
|
||||||
super(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
public void setRotationAngles(float move, float swing, float ticks, float headYaw, float headPitch, float scale, Entity entity) {
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.minelittlepony.model.ponies;
|
||||||
|
|
||||||
import com.minelittlepony.model.ModelMobPony;
|
import com.minelittlepony.model.ModelMobPony;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.AbstractSkeleton;
|
import net.minecraft.entity.monster.AbstractSkeleton;
|
||||||
import net.minecraft.entity.monster.EntityWitherSkeleton;
|
import net.minecraft.entity.monster.EntityWitherSkeleton;
|
||||||
|
@ -51,6 +52,26 @@ public class ModelSkeletonPony extends ModelMobPony {
|
||||||
super.setLivingAnimations(entity, move, swing, ticks);
|
super.setLivingAnimations(entity, move, swing, ticks);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||||
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
if (rightArmPose != ArmPose.EMPTY) {
|
||||||
|
if (canCast()) {
|
||||||
|
rotateArmHolding(unicornArmRight, -1, swingProgress, ticks);
|
||||||
|
} else {
|
||||||
|
rotateArmHolding(bipedRightArm, -1, swingProgress, ticks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (leftArmPose != ArmPose.EMPTY) {
|
||||||
|
if (canCast()) {
|
||||||
|
rotateArmHolding(unicornArmLeft, -1, swingProgress, ticks);
|
||||||
|
} else {
|
||||||
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean canCast() {
|
public boolean canCast() {
|
||||||
return isUnicorn;
|
return isUnicorn;
|
||||||
|
|
|
@ -5,11 +5,11 @@ import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.monster.EntityZombieVillager;
|
import net.minecraft.entity.monster.EntityZombieVillager;
|
||||||
import net.minecraft.entity.passive.EntityVillager;
|
import net.minecraft.entity.passive.EntityVillager;
|
||||||
|
|
||||||
import com.minelittlepony.model.player.ModelAlicorn;
|
import com.minelittlepony.model.ModelMobPony;
|
||||||
import com.minelittlepony.pony.data.PonyWearable;
|
import com.minelittlepony.pony.data.PonyWearable;
|
||||||
import com.minelittlepony.render.model.PlaneRenderer;
|
import com.minelittlepony.render.model.PlaneRenderer;
|
||||||
|
|
||||||
public class ModelVillagerPony extends ModelAlicorn {
|
public class ModelVillagerPony extends ModelMobPony {
|
||||||
|
|
||||||
public PlaneRenderer apron, trinket;
|
public PlaneRenderer apron, trinket;
|
||||||
|
|
||||||
|
@ -18,10 +18,6 @@ public class ModelVillagerPony extends ModelAlicorn {
|
||||||
public boolean special;
|
public boolean special;
|
||||||
public boolean special2;
|
public boolean special2;
|
||||||
|
|
||||||
public ModelVillagerPony() {
|
|
||||||
super(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
protected void shakeBody(float move, float swing, float bodySwing, float ticks) {
|
||||||
super.shakeBody(move, swing, bodySwing, ticks);
|
super.shakeBody(move, swing, bodySwing, ticks);
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
package com.minelittlepony.model.ponies;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
|
import com.minelittlepony.util.render.AbstractBoxRenderer;
|
||||||
|
|
||||||
|
public class ModelZombieVillagerPony extends ModelVillagerPony {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||||
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
if (rightArmPose != ArmPose.EMPTY) return;
|
||||||
|
|
||||||
|
if (islookAngleRight(move)) {
|
||||||
|
rotateArmHolding(bipedRightArm, 1, swingProgress, ticks);
|
||||||
|
AbstractBoxRenderer.shiftRotationPoint(bipedRightArm, 0.5F, 1.5F, 3);
|
||||||
|
} else {
|
||||||
|
rotateArmHolding(bipedLeftArm, -1, swingProgress, ticks);
|
||||||
|
AbstractBoxRenderer.shiftRotationPoint(bipedLeftArm, -0.5F, 1.5F, 3);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean islookAngleRight(float move) {
|
||||||
|
return MathHelper.sin(move / 20) < 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -19,13 +19,23 @@ public class RenderPonyZombieVillager extends RenderPonyMob<EntityZombieVillager
|
||||||
new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_butcher_pony.png"),
|
new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_butcher_pony.png"),
|
||||||
new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png")
|
new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_villager_pony.png")
|
||||||
);
|
);
|
||||||
|
private static final ResourceLocation EGG = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_silly_pony.png");
|
||||||
|
private static final ResourceLocation EGG_2 = new ResourceLocation("minelittlepony", "textures/entity/zombie_villager/zombie_tiny_silly_pony.png");
|
||||||
|
|
||||||
public RenderPonyZombieVillager(RenderManager manager) {
|
public RenderPonyZombieVillager(RenderManager manager) {
|
||||||
super(manager, PMAPI.villager);
|
super(manager, PMAPI.zombieVillager);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ResourceLocation getTexture(EntityZombieVillager entity) {
|
public ResourceLocation getTexture(EntityZombieVillager entity) {
|
||||||
|
String name = entity.getCustomNameTag();
|
||||||
|
if ("Derpy".equals(name) || (entity.isChild() && "Dinky".equals(name))) {
|
||||||
|
if (entity.isChild()) {
|
||||||
|
return EGG_2;
|
||||||
|
}
|
||||||
|
return EGG;
|
||||||
|
}
|
||||||
|
|
||||||
return PROFESSIONS.supplyTexture(entity.getProfession());
|
return PROFESSIONS.supplyTexture(entity.getProfession());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
Binary file not shown.
After Width: | Height: | Size: 5 KiB |
Loading…
Reference in a new issue