mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-23 04:57:58 +01:00
Zombies have a 1/30 chance of spawning with wings
This commit is contained in:
parent
1a80f768eb
commit
f49d8bcadf
5 changed files with 19 additions and 6 deletions
|
@ -4,9 +4,19 @@ import com.minelittlepony.model.ModelMobPony;
|
||||||
import com.minelittlepony.render.AbstractPonyRenderer;
|
import com.minelittlepony.render.AbstractPonyRenderer;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
|
||||||
public class ModelZombiePony extends ModelMobPony {
|
public class ModelZombiePony extends ModelMobPony {
|
||||||
|
|
||||||
|
public boolean isPegasus;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setLivingAnimations(EntityLivingBase entity, float move, float swing, float ticks) {
|
||||||
|
isPegasus = entity.getUniqueID().getLeastSignificantBits() % 30 == 0;
|
||||||
|
isFlying = !entity.onGround;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
protected void rotateLegs(float move, float swing, float ticks, Entity entity) {
|
||||||
super.rotateLegs(move, swing, ticks, entity);
|
super.rotateLegs(move, swing, ticks, entity);
|
||||||
|
@ -24,4 +34,9 @@ public class ModelZombiePony extends ModelMobPony {
|
||||||
public boolean islookAngleRight(float move) {
|
public boolean islookAngleRight(float move) {
|
||||||
return MathHelper.sin(move / 20) < 0;
|
return MathHelper.sin(move / 20) < 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canFly() {
|
||||||
|
return isPegasus;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,7 +4,6 @@ import com.minelittlepony.model.BodyPart;
|
||||||
import com.minelittlepony.model.capabilities.IModel;
|
import com.minelittlepony.model.capabilities.IModel;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.model.ModelBase;
|
|
||||||
import net.minecraft.client.model.ModelBiped;
|
import net.minecraft.client.model.ModelBiped;
|
||||||
import net.minecraft.client.renderer.GlStateManager;
|
import net.minecraft.client.renderer.GlStateManager;
|
||||||
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
import net.minecraft.client.renderer.block.model.ItemCameraTransforms.TransformType;
|
||||||
|
@ -39,14 +38,13 @@ public class LayerHeldPonyItem<T extends EntityLivingBase> extends AbstractPonyL
|
||||||
ItemStack right = getRightItem(entity);
|
ItemStack right = getRightItem(entity);
|
||||||
|
|
||||||
if (!left.isEmpty() || !right.isEmpty()) {
|
if (!left.isEmpty() || !right.isEmpty()) {
|
||||||
ModelBase model = getMainModel();
|
IModel model = getMainModel();
|
||||||
|
|
||||||
pushMatrix();
|
pushMatrix();
|
||||||
if (model instanceof IModel) {
|
|
||||||
((IModel) model).transform(BodyPart.LEGS);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (model.isChild) {
|
model.transform(BodyPart.LEGS);
|
||||||
|
|
||||||
|
if (model.isChild()) {
|
||||||
translate(0, 0.625, 0);
|
translate(0, 0.625, 0);
|
||||||
rotate(-20, -1, 0, 0);
|
rotate(-20, -1, 0, 0);
|
||||||
scale(.5, .5, .5);
|
scale(.5, .5, .5);
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 4.2 KiB After Width: | Height: | Size: 4.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 6.7 KiB |
Binary file not shown.
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 5.3 KiB |
Loading…
Reference in a new issue