mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-29 07:27:59 +01:00
Ponified Pillagers
This commit is contained in:
parent
6a4d271b14
commit
a1f40c9b59
9 changed files with 77 additions and 13 deletions
|
@ -4,6 +4,7 @@ import net.minecraft.client.model.Cuboid;
|
|||
import net.minecraft.client.render.entity.model.BipedEntityModel;
|
||||
import net.minecraft.client.render.entity.model.PlayerEntityModel;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.AbsoluteHand;
|
||||
|
||||
import com.minelittlepony.client.pony.PonyData;
|
||||
import com.minelittlepony.model.ModelAttributes;
|
||||
|
@ -84,6 +85,12 @@ public abstract class ClientPonyModel<T extends LivingEntity> extends PlayerEnti
|
|||
return handSwingProgress;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Cuboid getArm(AbsoluteHand side) {
|
||||
return super.getArm(side);
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies this model's attributes into the passed model.
|
||||
*/
|
||||
|
|
|
@ -48,9 +48,4 @@ public class ModelIllagerPony<T extends IllagerEntity> extends ModelMobPony<T> {
|
|||
aimBow(arm, ticks);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cuboid getArm(AbsoluteHand side) {
|
||||
return canCast() ? getUnicornArmForSide(side) : super.getArm(side);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,35 @@
|
|||
package com.minelittlepony.client.model.entities;
|
||||
|
||||
import net.minecraft.entity.mob.IllagerEntity;
|
||||
import net.minecraft.entity.mob.PillagerEntity;
|
||||
import net.minecraft.util.AbsoluteHand;
|
||||
|
||||
import com.minelittlepony.client.model.races.ModelChangeling;
|
||||
|
||||
public class ModelPillagerPony<T extends PillagerEntity> extends ModelChangeling<T> {
|
||||
|
||||
public ModelPillagerPony() {
|
||||
super(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateModel(T entity, float move, float swing, float ticks) {
|
||||
ArmPose holdingPose = getHoldingPose(entity.getState());
|
||||
|
||||
if (holdingPose != ArmPose.EMPTY) {
|
||||
boolean rightHanded = entity.getMainHand() == AbsoluteHand.RIGHT;
|
||||
|
||||
leftArmPose = rightHanded ? ArmPose.EMPTY : holdingPose;
|
||||
rightArmPose = rightHanded ? holdingPose : ArmPose.EMPTY;
|
||||
}
|
||||
}
|
||||
|
||||
protected ArmPose getHoldingPose(IllagerEntity.State state) {
|
||||
switch (state) {
|
||||
case BOW_AND_ARROW: return ArmPose.BOW_AND_ARROW;
|
||||
case CROSSBOW_CHARGE: return ArmPose.CROSSBOW_CHARGE;
|
||||
case CROSSBOW_HOLD: return ArmPose.CROSSBOW_HOLD;
|
||||
default: return ArmPose.EMPTY;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -54,9 +54,6 @@ public class ModelSkeletonPony<T extends HostileEntity> extends ModelMobPony<T>
|
|||
leftArmPose = pose;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
super.animateModel(entity, move, swing, ticks);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -4,6 +4,7 @@ import com.minelittlepony.client.model.components.UnicornHorn;
|
|||
import com.minelittlepony.client.util.render.PonyRenderer;
|
||||
import com.minelittlepony.model.IUnicorn;
|
||||
|
||||
import net.minecraft.client.model.Cuboid;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.util.AbsoluteHand;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
|
@ -163,4 +164,9 @@ public class ModelUnicorn<T extends LivingEntity> extends ModelEarthPony<T> impl
|
|||
unicornArmRight.box(armX - armWidth, armY, armZ, armWidth, armLength, armDepth, stretch + .25F)
|
||||
.around(-rarmX, yOffset + rarmY, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Cuboid getArm(AbsoluteHand side) {
|
||||
return canCast() ? getUnicornArmForSide(side) : super.getArm(side);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ public enum MobRenderers implements Setting<Boolean> {
|
|||
pony.switchRenderer(state, WitchEntity.class, RenderPonyWitch::new);
|
||||
pony.switchRenderer(state, ZombieVillagerEntity.class, RenderPonyZombieVillager::new);
|
||||
pony.switchRenderer(state, WanderingTraderEntity.class, RenderPonyTrader::new);
|
||||
pony.switchRenderer(state, PillagerEntity.class, RenderPonyPillager::new);
|
||||
}
|
||||
},
|
||||
ZOMBIES {
|
||||
|
|
|
@ -1,5 +1,28 @@
|
|||
package com.minelittlepony.client.render.entities;
|
||||
|
||||
public class RenderPonyPillager {
|
||||
// TODO: Render Pillagers as changelings
|
||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.entity.mob.PillagerEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.minelittlepony.client.model.entities.ModelPillagerPony;
|
||||
import com.minelittlepony.client.render.layer.LayerHeldItemIllager;
|
||||
import com.minelittlepony.client.render.layer.LayerHeldPonyItem;
|
||||
|
||||
public class RenderPonyPillager extends RenderPonyMob<PillagerEntity, ModelPillagerPony<PillagerEntity>> {
|
||||
|
||||
private static final Identifier TEXTURES = new Identifier("minelittlepony", "textures/entity/illager/pillager_pony.png");
|
||||
|
||||
public RenderPonyPillager(EntityRenderDispatcher manager) {
|
||||
super(manager, new ModelPillagerPony<PillagerEntity>());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier findTexture(PillagerEntity entity) {
|
||||
return TEXTURES;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected LayerHeldPonyItem<PillagerEntity, ModelPillagerPony<PillagerEntity>> createItemHoldingLayer() {
|
||||
return new LayerHeldItemIllager<>(this);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ package com.minelittlepony.client.render.layer;
|
|||
import net.minecraft.entity.mob.IllagerEntity;
|
||||
import net.minecraft.util.AbsoluteHand;
|
||||
|
||||
import com.minelittlepony.client.model.entities.ModelIllagerPony;
|
||||
import com.minelittlepony.client.model.races.ModelAlicorn;
|
||||
import com.minelittlepony.client.render.IPonyRender;
|
||||
|
||||
public class LayerHeldItemIllager<T extends IllagerEntity> extends LayerHeldPonyItem<T, ModelIllagerPony<T>> {
|
||||
public class LayerHeldItemIllager<T extends IllagerEntity, M extends ModelAlicorn<T>> extends LayerHeldPonyItem<T, M> {
|
||||
|
||||
public LayerHeldItemIllager(IPonyRender<T, ModelIllagerPony<T>> livingPony) {
|
||||
public LayerHeldItemIllager(IPonyRender<T,M> livingPony) {
|
||||
super(livingPony);
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
Loading…
Reference in a new issue