mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2025-02-13 08:14:23 +01:00
Added Piglin renderers and models (textures needed)
This commit is contained in:
parent
ad51fcb05f
commit
d272d07cc8
8 changed files with 77 additions and 16 deletions
|
@ -10,6 +10,7 @@ import com.minelittlepony.client.model.entity.BreezieModel;
|
|||
import com.minelittlepony.client.model.entity.EnderStallionModel;
|
||||
import com.minelittlepony.client.model.entity.GuardianPonyModel;
|
||||
import com.minelittlepony.client.model.entity.IllagerPonyModel;
|
||||
import com.minelittlepony.client.model.entity.PiglinPonyModel;
|
||||
import com.minelittlepony.client.model.entity.PillagerPonyModel;
|
||||
import com.minelittlepony.client.model.entity.SkeleponyModel;
|
||||
import com.minelittlepony.client.model.entity.VillagerPonyModel;
|
||||
|
@ -53,6 +54,7 @@ public final class ModelType {
|
|||
public static final ModelKey<VillagerPonyModel<?>> VILLAGER = register("villager", VillagerPonyModel::new);
|
||||
public static final ModelKey<WitchPonyModel> WITCH = register("witch", WitchPonyModel::new);
|
||||
public static final ModelKey<ZomponyModel<?>> ZOMBIE = register("zombie", ZomponyModel::new);
|
||||
public static final ModelKey<PiglinPonyModel> PIGLIN = register("piglin", PiglinPonyModel::new);
|
||||
public static final ModelKey<ZomponyVillagerModel> ZOMBIE_VILLAGER = register("zombie_villager", ZomponyVillagerModel::new);
|
||||
public static final ModelKey<SkeleponyModel<?>> SKELETON = register("skeleton", SkeleponyModel::new);
|
||||
public static final ModelKey<SkeleponyModel<?>> SKELETON_CLOTHES = register("skeleton_clothes", SkeleponyModel::new);
|
||||
|
|
|
@ -0,0 +1,41 @@
|
|||
package com.minelittlepony.client.model.entity;
|
||||
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.entity.mob.PiglinEntity;
|
||||
|
||||
import com.minelittlepony.client.model.entity.race.AlicornModel;
|
||||
|
||||
public class PiglinPonyModel extends AlicornModel<HostileEntity> {
|
||||
|
||||
private boolean isPegasus;
|
||||
|
||||
public PiglinPonyModel() {
|
||||
super(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void animateModel(HostileEntity entity, float move, float swing, float ticks) {
|
||||
isPegasus = entity.getUuid().getLeastSignificantBits() % 30 == 0;
|
||||
|
||||
if (entity instanceof PiglinEntity) {
|
||||
PiglinEntity piglinEntity = (PiglinEntity)entity;
|
||||
PiglinEntity.Activity activity = piglinEntity.getActivity();
|
||||
|
||||
leftArmPose = ArmPose.EMPTY;
|
||||
rightArmPose = ArmPose.EMPTY;
|
||||
|
||||
if (activity == PiglinEntity.Activity.CROSSBOW_HOLD) {
|
||||
rightArmPose = ArmPose.CROSSBOW_HOLD;
|
||||
} else if (activity == PiglinEntity.Activity.CROSSBOW_CHARGE) {
|
||||
rightArmPose = ArmPose.BOW_AND_ARROW;
|
||||
} else if (activity == PiglinEntity.Activity.ADMIRING_ITEM) {
|
||||
leftArmPose = ArmPose.ITEM;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFly() {
|
||||
return isPegasus;
|
||||
}
|
||||
}
|
|
@ -36,8 +36,9 @@ public final class MobRenderers {
|
|||
pony.switchRenderer(state, EntityType.GIANT, ZomponyRenderer.Giant::new);
|
||||
pony.switchRenderer(state, EntityType.DROWNED, ZomponyRenderer.Drowned::new);
|
||||
});
|
||||
public static final MobRenderers ZOMBIE_PIGMAN = register("pigzombies", (state, pony) -> {
|
||||
pony.switchRenderer(state, EntityType.ZOMBIFIED_PIGLIN, ZomponyRenderer.Piglin::new);
|
||||
public static final MobRenderers PIGLIN = register("pigzombies", (state, pony) -> {
|
||||
pony.switchRenderer(state, EntityType.PIGLIN, PonyPiglinRenderer::new);
|
||||
pony.switchRenderer(state, EntityType.ZOMBIFIED_PIGLIN, PonyPiglinRenderer::new);
|
||||
});
|
||||
public static final MobRenderers SKELETON = register("skeletons", (state, pony) -> {
|
||||
pony.switchRenderer(state, EntityType.SKELETON, SkeleponyRenderer::new);
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
package com.minelittlepony.client.render.entity;
|
||||
|
||||
import net.minecraft.client.render.entity.EntityRenderDispatcher;
|
||||
import net.minecraft.entity.mob.HostileEntity;
|
||||
import net.minecraft.entity.mob.PiglinEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.minelittlepony.client.model.ModelType;
|
||||
import com.minelittlepony.client.model.entity.PiglinPonyModel;
|
||||
|
||||
public class PonyPiglinRenderer extends PonyRenderer.Caster<HostileEntity, PiglinPonyModel> {
|
||||
public static final Identifier NORMAL = new Identifier("minelittlepony", "textures/entity/piglin/piglin_pony.png");
|
||||
public static final Identifier ZOMBIFIED = new Identifier("minelittlepony", "textures/entity/piglin/zombified_piglin_pony.png");
|
||||
|
||||
public PonyPiglinRenderer(EntityRenderDispatcher manager) {
|
||||
super(manager, ModelType.PIGLIN);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier findTexture(HostileEntity entity) {
|
||||
return entity instanceof PiglinEntity ? NORMAL : new Identifier("minelittlepony", "textures/entity/piglin/zombified_piglin_pony.png");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean method_25450(HostileEntity entity) {
|
||||
return entity instanceof PiglinEntity && ((PiglinEntity)entity).canConvert();
|
||||
}
|
||||
}
|
|
@ -6,7 +6,6 @@ import net.minecraft.entity.mob.DrownedEntity;
|
|||
import net.minecraft.entity.mob.GiantEntity;
|
||||
import net.minecraft.entity.mob.HuskEntity;
|
||||
import net.minecraft.entity.mob.ZombieEntity;
|
||||
import net.minecraft.entity.mob.ZombifiedPiglinEntity;
|
||||
import net.minecraft.util.Identifier;
|
||||
|
||||
import com.minelittlepony.client.model.ModelType;
|
||||
|
@ -16,7 +15,6 @@ public class ZomponyRenderer<Zombie extends ZombieEntity> extends PonyRenderer.C
|
|||
|
||||
public static final Identifier ZOMBIE = new Identifier("minelittlepony", "textures/entity/zombie/zombie_pony.png");
|
||||
public static final Identifier HUSK = new Identifier("minelittlepony", "textures/entity/zombie/husk_pony.png");
|
||||
public static final Identifier PIGMAN = new Identifier("minelittlepony", "textures/entity/zombie/zombie_pigman_pony.png");
|
||||
public static final Identifier DROWNED = new Identifier("minelittlepony", "textures/entity/zombie/drowned_pony.png");
|
||||
|
||||
public ZomponyRenderer(EntityRenderDispatcher manager) {
|
||||
|
@ -40,18 +38,6 @@ public class ZomponyRenderer<Zombie extends ZombieEntity> extends PonyRenderer.C
|
|||
}
|
||||
}
|
||||
|
||||
public static class Piglin extends ZomponyRenderer<ZombifiedPiglinEntity> {
|
||||
|
||||
public Piglin(EntityRenderDispatcher manager) {
|
||||
super(manager);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Identifier findTexture(ZombifiedPiglinEntity entity) {
|
||||
return PIGMAN;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Husk extends ZomponyRenderer<HuskEntity> {
|
||||
|
||||
public Husk(EntityRenderDispatcher manager) {
|
||||
|
|
|
@ -0,0 +1,3 @@
|
|||
{
|
||||
"parent": "minelittlepony:zombie"
|
||||
}
|
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Binary file not shown.
After Width: | Height: | Size: 6.9 KiB |
Loading…
Reference in a new issue