*picks up house* *moves house outdoors*

This commit is contained in:
Sollace 2019-11-25 17:49:20 +02:00
parent 01c4844596
commit fc57875596
24 changed files with 223 additions and 74 deletions

View file

@ -1,6 +1,7 @@
package com.minelittlepony.client;
import com.minelittlepony.client.hdskins.IndirectHDSkins;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.pony.PonyManager;
import com.minelittlepony.client.render.blockentity.skull.PonySkullRenderer;
import com.minelittlepony.client.settings.ClientPonyConfig;
@ -89,6 +90,8 @@ public class MineLittlePony implements ClientModInitializer {
if (FabricLoader.getInstance().isModLoaded("hdskins")) {
IndirectHDSkins.initialize();
}
ModelType.bootstrap();
}
private void onClientReady(MinecraftClient client) {

View file

@ -1,6 +1,7 @@
package com.minelittlepony.client;
import java.util.Map;
import java.util.function.Function;
import com.google.common.collect.Maps;
import com.minelittlepony.client.model.IPonyModel;
@ -13,6 +14,7 @@ import com.minelittlepony.client.render.IPonyRender;
import javax.annotation.Nullable;
import com.minelittlepony.common.mixin.MixinEntityRenderDispatcher;
import com.minelittlepony.mson.api.Mson;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.MinecraftClient;
@ -79,6 +81,21 @@ public class PonyRenderManager {
* @param factory The replacement value
* @param <T> The entity type
*/
@SuppressWarnings("unchecked")
public <T extends Entity, V extends T> void switchRenderer(boolean state, EntityType<V> type, Function<EntityRenderDispatcher, EntityRenderer<T>> factory) {
if (state) {
if (!renderMap.containsKey(type)) {
renderMap.put(type, ((MixinEntityRenderDispatcher)MinecraftClient.getInstance().getEntityRenderManager()).getEntityRenderers().get(type));
}
Mson.getInstance().getEntityRendererRegistry().registerEntityRenderer(type, factory);
} else {
if (renderMap.containsKey(type)) {
Mson.getInstance().getEntityRendererRegistry().registerEntityRenderer(type, m -> (EntityRenderer<T>)renderMap.get(type));
}
}
}
@Deprecated
public <T extends Entity, V extends T> void switchRenderer(boolean state, EntityType<V> type, EntityRendererRegistry.Factory factory) {
if (state) {
if (!renderMap.containsKey(type)) {

View file

@ -9,6 +9,7 @@ import com.minelittlepony.model.BodyPart;
import com.minelittlepony.model.IUnicorn;
import com.minelittlepony.model.ModelAttributes;
import com.minelittlepony.model.armour.IEquestrianArmour;
import com.minelittlepony.mson.api.ModelContext;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.pony.IPonyData;
import com.minelittlepony.pony.meta.Size;
@ -17,6 +18,11 @@ public interface IPonyMixinModel<T extends LivingEntity, M extends IPonyModel<T>
M mixin();
@Override
default void init(ModelContext context) {
mixin().init(context);
}
@Override
default void updateLivingState(T entity, IPony pony) {
mixin().updateLivingState(entity, pony);

View file

@ -7,9 +7,10 @@ import com.minelittlepony.model.ICapitated;
import com.minelittlepony.model.ICompartmented;
import com.minelittlepony.model.IModel;
import com.minelittlepony.model.PonyModelConstants;
import com.minelittlepony.mson.api.MsonModel;
import com.minelittlepony.pony.IPony;
public interface IPonyModel<T extends LivingEntity> extends PonyModelConstants, IModel, ICapitated<ModelPart>, ICompartmented<ModelPart> {
public interface IPonyModel<T extends LivingEntity> extends PonyModelConstants, IModel, ICapitated<ModelPart>, ICompartmented<ModelPart>, MsonModel {
void updateLivingState(T entity, IPony pony);

View file

@ -0,0 +1,57 @@
package com.minelittlepony.client.model;
import net.minecraft.client.model.Model;
import net.minecraft.entity.mob.VexEntity;
import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.entity.ModelBreezie;
import com.minelittlepony.client.model.entity.ModelEnderStallion;
import com.minelittlepony.client.model.entity.ModelGuardianPony;
import com.minelittlepony.client.model.entity.ModelIllagerPony;
import com.minelittlepony.client.model.entity.ModelPillagerPony;
import com.minelittlepony.client.model.entity.ModelSkeletonPony;
import com.minelittlepony.client.model.entity.ModelVillagerPony;
import com.minelittlepony.client.model.entity.ModelWitchPony;
import com.minelittlepony.client.model.entity.ModelZombiePony;
import com.minelittlepony.client.model.entity.ModelZombieVillagerPony;
import com.minelittlepony.client.model.entity.race.ModelAlicorn;
import com.minelittlepony.client.model.entity.race.ModelChangeling;
import com.minelittlepony.client.model.entity.race.ModelPegasus;
import com.minelittlepony.client.model.entity.race.ModelUnicorn;
import com.minelittlepony.client.model.entity.race.ModelZebra;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.mson.api.Mson;
import com.minelittlepony.mson.api.MsonModel;
import java.util.function.Function;
import java.util.function.Supplier;
public final class ModelType {
public static final ModelKey<ModelVillagerPony<?>> VILLAGER = register("villager", ModelVillagerPony::new);
public static final ModelKey<ModelWitchPony> WITCH = register("witch", ModelWitchPony::new);
public static final ModelKey<ModelZombiePony<?>> ZOMBIE = register("zombie", ModelZombiePony::new);
public static final ModelKey<ModelZombieVillagerPony> ZOMBIE_VILLAGER = register("zombie_villager", ModelZombieVillagerPony::new);
public static final ModelKey<ModelSkeletonPony<?>> SKELETON = register("skeleton", ModelSkeletonPony::new);
public static final ModelKey<ModelPillagerPony<?>> PILLAGER = register("pillager", ModelPillagerPony::new);
public static final ModelKey<ModelIllagerPony<?>> ILLAGER = register("illager", ModelIllagerPony::new);
public static final ModelKey<ModelGuardianPony> GUARDIAN = register("guardian", ModelGuardianPony::new);
public static final ModelKey<ModelEnderStallion> ENDERMAN = register("enderman", ModelEnderStallion::new);
public static final ModelKey<ModelBreezie<VexEntity>> BREEZIE = register("breezie", ModelBreezie::new);
public static final PlayerModelKey<ModelAlicorn<?>> ALICORN = registerPlayer("alicorn", ModelAlicorn::new);
public static final PlayerModelKey<ModelUnicorn<?>> UNICORN = registerPlayer("unicorn", ModelUnicorn::new);
public static final PlayerModelKey<ModelPegasus<?>> PEGASUS = registerPlayer("pegasus", ModelPegasus::new);
public static final PlayerModelKey<ModelPegasus<?>> BAT_PONY = registerPlayer("batpony", ModelPegasus::new);
public static final PlayerModelKey<ModelChangeling<?>> CHANGELING = registerPlayer("changeling", ModelChangeling::new);
public static final PlayerModelKey<ModelZebra<?>> ZEBRA = registerPlayer("zebra", ModelZebra::new);
static <T extends Model & MsonModel> PlayerModelKey<T> registerPlayer(String name, Function<Boolean, T> constructor) {
return new PlayerModelKey<>(new Identifier("minelittlepony", "races/" + name), constructor);
}
static <T extends Model & MsonModel> ModelKey<T> register(String name, Supplier<T> constructor) {
return Mson.getInstance().registerModel(new Identifier("minelittlepony", name), constructor);
}
public static void bootstrap() {};
}

View file

@ -0,0 +1,52 @@
package com.minelittlepony.client.model;
import net.minecraft.client.model.Model;
import net.minecraft.util.Identifier;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.mson.api.Mson;
import com.minelittlepony.mson.api.MsonModel;
import java.util.function.Function;
public class PlayerModelKey<T extends Model & MsonModel> {
private final ModelKey<T> key;
private boolean slim;
public final ModelKey<T> steveKey;
public final ModelKey<T> alexKey;
PlayerModelKey(Identifier id, Function<Boolean, T> factory) {
this.key = Mson.getInstance().registerModel(id, () -> factory.apply(slim));
steveKey = new Key(false);
alexKey = new Key(true);
}
public T createModel(boolean slimArms) {
return (slimArms ? alexKey : steveKey).createModel();
}
private class Key implements ModelKey<T> {
private final boolean slim;
public Key(boolean slim) {
this.slim = slim;
}
@Override
public Identifier getId() {
return key.getId();
}
@Override
public T createModel() {
PlayerModelKey.this.slim = this.slim;
return key.createModel();
}
}
}

View file

@ -8,11 +8,13 @@ import net.minecraft.util.math.MathHelper;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Iterables;
import com.minelittlepony.mson.api.ModelContext;
import com.minelittlepony.mson.api.MsonModel;
import com.minelittlepony.mson.api.model.MsonPart;
import static com.minelittlepony.model.PonyModelConstants.PI;
public class ModelBreezie<T extends LivingEntity> extends BipedEntityModel<T> {
public class ModelBreezie<T extends LivingEntity> extends BipedEntityModel<T> implements MsonModel {
private ModelPart neck;
private ModelPart tail;
@ -26,6 +28,21 @@ public class ModelBreezie<T extends LivingEntity> extends BipedEntityModel<T> {
textureHeight = 64;
}
// broken bridge
@Override
public void accept(ModelPart t) {
super.method_22696(t);
}
@Override
public void init(ModelContext context) {
neck = context.findByName("neck");
tail = context.findByName("tail");
tailStub = context.findByName("tail_stub");
leftWing = context.findByName("left_wing");
rightWing = context.findByName("right_wing");
}
@Override
public void setVisible(boolean visible) {
super.setVisible(visible);

View file

@ -1,10 +0,0 @@
package com.minelittlepony.client.model.entity.race;
import net.minecraft.entity.LivingEntity;
@Deprecated
public class ModelBatpony<T extends LivingEntity> extends ModelPegasus<T> {
public ModelBatpony(boolean smallArms) {
super(smallArms);
}
}

View file

@ -25,7 +25,7 @@ public enum PlayerModels {
DEFAULT("default", "slim", Race.HUMAN, ModelEarthPony::new),
EARTHPONY(Race.EARTH, ModelEarthPony::new),
PEGASUS(Race.PEGASUS, ModelPegasus::new),
BATPONY(Race.BATPONY, ModelBatpony::new),
BATPONY(Race.BATPONY, ModelPegasus::new),
UNICORN(Race.UNICORN, ModelUnicorn::new),
ALICORN(Race.ALICORN, ModelAlicorn::new),
CHANGELING(Race.CHANGELING, ModelChangeling::new),
@ -71,10 +71,12 @@ public enum PlayerModels {
this.race = race;
}
@Deprecated
public PendingModel getPendingModel(boolean isSlim) {
return isSlim ? slim : normal;
}
@Deprecated
public <T extends LivingEntity, M extends IModel> ModelWrapper<T, M> getWrappedModel(boolean isSlim) {
return getPendingModel(isSlim).getWrappedModel(isSlim);
}
@ -84,13 +86,14 @@ public enum PlayerModels {
}
public RenderPonyPlayer createRenderer(EntityRenderDispatcher manager, boolean slimArms) {
return new RenderPonyPlayer(manager, slimArms, getWrappedModel(slimArms));
return new RenderPonyPlayer(manager, getWrappedModel(slimArms));
}
public static PlayerModels forRace(Race race) {
return raceModelsMap.getOrDefault(race.getAlias(), DEFAULT);
}
@Deprecated
private final class PendingModel {
@Nullable
private ModelWrapper<?, IModel> model;

View file

@ -1,12 +1,12 @@
package com.minelittlepony.client.render.entity;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelEnderStallion;
import com.minelittlepony.client.render.entity.feature.LayerEyeGlow;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
import com.minelittlepony.client.render.entity.feature.LayerEyeGlow.IGlowingRenderer;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
@ -25,8 +25,8 @@ public class RenderEnderStallion extends RenderPonyMob<EndermanEntity, ModelEnde
private final Random rnd = new Random();
public RenderEnderStallion(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelEnderStallion());
public RenderEnderStallion(EntityRenderDispatcher manager) {
super(manager, ModelType.ENDERMAN);
}
@Override

View file

@ -3,13 +3,13 @@ package com.minelittlepony.client.render.entity;
import javax.annotation.Nonnull;
import com.minelittlepony.client.mixin.IResizeable;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelGuardianPony;
import com.minelittlepony.client.render.entity.RenderPonyMob.Proxy;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
import com.mojang.blaze3d.systems.RenderSystem;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.entity.GuardianEntityRenderer;
@ -25,11 +25,11 @@ public class RenderPonyGuardian extends GuardianEntityRenderer {
private final Proxy<GuardianEntity, ModelGuardianPony> ponyRenderer;
public RenderPonyGuardian(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
public RenderPonyGuardian(EntityRenderDispatcher manager) {
super(manager);
features.clear();
ponyRenderer = new Proxy<GuardianEntity, ModelGuardianPony>(features, manager, new ModelGuardianPony()) {
ponyRenderer = new Proxy<GuardianEntity, ModelGuardianPony>(features, manager, ModelType.GUARDIAN) {
@Override
public Identifier findTexture(GuardianEntity entity) {
return SEAPONY;
@ -71,8 +71,8 @@ public class RenderPonyGuardian extends GuardianEntityRenderer {
public static class Elder extends RenderPonyGuardian {
public Elder(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Elder(EntityRenderDispatcher manager) {
super(manager);
}
@Override

View file

@ -1,10 +1,10 @@
package com.minelittlepony.client.render.entity;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelIllagerPony;
import com.minelittlepony.client.render.entity.feature.LayerHeldItemIllager;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
@ -23,7 +23,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
public static final Identifier VINDICATOR = new Identifier("minelittlepony", "textures/entity/illager/vindicator_pony.png");
public RenderPonyIllager(EntityRenderDispatcher manager) {
super(manager, new ModelIllagerPony<>());
super(manager, ModelType.ILLAGER);
}
@Override
@ -39,7 +39,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
public static class Vindicator extends RenderPonyIllager<VindicatorEntity> {
public Vindicator(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
public Vindicator(EntityRenderDispatcher manager) {
super(manager);
}
@ -52,7 +52,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
public static class Evoker extends RenderPonyIllager<EvokerEntity> {
public Evoker(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
public Evoker(EntityRenderDispatcher manager) {
super(manager);
}
@ -64,7 +64,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
public static class Illusionist extends RenderPonyIllager<IllusionerEntity> {
public Illusionist(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
public Illusionist(EntityRenderDispatcher manager) {
super(manager);
}

View file

@ -14,6 +14,7 @@ import com.minelittlepony.client.render.entity.feature.LayerPonyArmor;
import com.minelittlepony.client.render.entity.feature.LayerPonyCustomHead;
import com.minelittlepony.client.render.entity.feature.LayerPonyElytra;
import com.minelittlepony.model.IUnicorn;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.pony.IPony;
import net.minecraft.client.model.ModelPart;
@ -33,8 +34,9 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
protected RenderPony<T, M> renderPony = new RenderPony<>(this);
public RenderPonyMob(EntityRenderDispatcher manager, M model) {
super(manager, model, 0.5F);
@SuppressWarnings("unchecked")
public RenderPonyMob(EntityRenderDispatcher manager, ModelKey<? super M> key) {
super(manager, (M)key.createModel(), 0.5F);
this.model = renderPony.setPonyModel(new ModelWrapper<>(model));
@ -123,8 +125,8 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
public abstract static class Caster<T extends MobEntity, M extends ClientPonyModel<T> & IUnicorn<ModelPart>> extends RenderPonyMob<T, M> {
public Caster(EntityRenderDispatcher manager, M model) {
super(manager, model);
public Caster(EntityRenderDispatcher manager, ModelKey<? super M> key) {
super(manager, key);
}
@Override
@ -136,8 +138,8 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
public abstract static class Proxy<T extends MobEntity, M extends EntityModel<T> & IPonyModel<T>> extends RenderPonyMob<T, M> {
@SuppressWarnings({"rawtypes", "unchecked"})
public Proxy(List exportedLayers, EntityRenderDispatcher manager, M model) {
super(manager, model);
public Proxy(List exportedLayers, EntityRenderDispatcher manager, ModelKey<M> key) {
super(manager, key);
exportedLayers.addAll(features);
}

View file

@ -1,10 +1,10 @@
package com.minelittlepony.client.render.entity;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.entity.mob.PillagerEntity;
import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelPillagerPony;
import com.minelittlepony.client.render.entity.feature.LayerHeldItemIllager;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
@ -13,8 +13,8 @@ public class RenderPonyPillager extends RenderPonyMob<PillagerEntity, ModelPilla
private static final Identifier TEXTURES = new Identifier("minelittlepony", "textures/entity/illager/pillager_pony.png");
public RenderPonyPillager(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelPillagerPony<>());
public RenderPonyPillager(EntityRenderDispatcher manager) {
super(manager, ModelType.PILLAGER);
}
@Override

View file

@ -38,8 +38,8 @@ public class RenderPonyPlayer extends PlayerEntityRenderer implements IPonyRende
protected final RenderPony<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> renderPony = new RenderPony<>(this);
public RenderPonyPlayer(EntityRenderDispatcher manager, boolean useSmallArms, ModelWrapper<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> model) {
super(manager, useSmallArms);
public RenderPonyPlayer(EntityRenderDispatcher manager, ModelWrapper<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> model) {
super(manager, false);
this.model = renderPony.setPonyModel(model);

View file

@ -1,11 +1,11 @@
package com.minelittlepony.client.render.entity;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelSkeletonPony;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
import com.minelittlepony.client.render.entity.feature.LayerPonyStrayOverlay;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.mob.AbstractSkeletonEntity;
@ -19,8 +19,8 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends
public static final Identifier WITHER = new Identifier("minelittlepony", "textures/entity/skeleton/skeleton_wither_pony.png");
public static final Identifier STRAY = new Identifier("minelittlepony", "textures/entity/skeleton/stray_pony.png");
public RenderPonySkeleton(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelSkeletonPony<>());
public RenderPonySkeleton(EntityRenderDispatcher manager) {
super(manager, ModelType.SKELETON);
}
@Override
@ -35,8 +35,8 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends
public static class Stray extends RenderPonySkeleton<StrayEntity> {
public Stray(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Stray(EntityRenderDispatcher manager) {
super(manager);
addFeature(new LayerPonyStrayOverlay<>(this));
}
@ -48,8 +48,8 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends
public static class Wither extends RenderPonySkeleton<WitherSkeletonEntity> {
public Wither(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Wither(EntityRenderDispatcher manager) {
super(manager);
}
@Override

View file

@ -1,19 +1,19 @@
package com.minelittlepony.client.render.entity;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.passive.WanderingTraderEntity;
import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.race.ModelAlicorn;
public class RenderPonyTrader extends RenderPonyMob.Caster<WanderingTraderEntity, ModelAlicorn<WanderingTraderEntity>> {
public static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/entity/wandering_trader_pony.png");
public RenderPonyTrader(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelAlicorn<>(false));
public RenderPonyTrader(EntityRenderDispatcher manager) {
super(manager, ModelType.ALICORN.steveKey);
}
@Override

View file

@ -1,12 +1,12 @@
package com.minelittlepony.client.render.entity;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.BipedEntityRenderer;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.mob.VexEntity;
import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelBreezie;
/**
@ -17,8 +17,8 @@ public class RenderPonyVex extends BipedEntityRenderer<VexEntity, ModelBreezie<V
private static final Identifier VEX = new Identifier("minelittlepony", "textures/entity/illager/vex_pony.png");
private static final Identifier VEX_CHARGING = new Identifier("minelittlepony", "textures/entity/illager/vex_charging_pony.png");
public RenderPonyVex(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelBreezie<>(), 0.3F);
public RenderPonyVex(EntityRenderDispatcher manager) {
super(manager, ModelType.BREEZIE.createModel(), 0.3F);
}
@Override

View file

@ -1,9 +1,9 @@
package com.minelittlepony.client.render.entity;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelWitchPony;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.model.json.ModelTransformation;
import net.minecraft.client.util.math.MatrixStack;
@ -17,8 +17,8 @@ public class RenderPonyWitch extends RenderPonyMob<WitchEntity, ModelWitchPony>
private static final Identifier WITCH_TEXTURES = new Identifier("minelittlepony", "textures/entity/witch_pony.png");
public RenderPonyWitch(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelWitchPony());
public RenderPonyWitch(EntityRenderDispatcher manager) {
super(manager, ModelType.WITCH);
}
@Override

View file

@ -1,6 +1,5 @@
package com.minelittlepony.client.render.entity;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.mob.DrownedEntity;
@ -10,6 +9,7 @@ import net.minecraft.entity.mob.ZombieEntity;
import net.minecraft.entity.mob.ZombiePigmanEntity;
import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelZombiePony;
public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob.Caster<Zombie, ModelZombiePony<Zombie>> {
@ -19,8 +19,8 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
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 RenderPonyZombie(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelZombiePony<>());
public RenderPonyZombie(EntityRenderDispatcher manager) {
super(manager, ModelType.ZOMBIE);
}
@Override
@ -30,8 +30,8 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
public static class Drowned extends RenderPonyZombie<DrownedEntity> {
public Drowned(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Drowned(EntityRenderDispatcher manager) {
super(manager);
}
@Override
@ -42,8 +42,8 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
public static class Pigman extends RenderPonyZombie<ZombiePigmanEntity> {
public Pigman(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Pigman(EntityRenderDispatcher manager) {
super(manager);
}
@Override
@ -54,8 +54,8 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
public static class Husk extends RenderPonyZombie<HuskEntity> {
public Husk(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, context);
public Husk(EntityRenderDispatcher manager) {
super(manager);
}
@Override
@ -73,8 +73,8 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
public static class Giant extends RenderPonyMob.Caster<GiantEntity, ModelZombiePony<GiantEntity>> {
public Giant(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelZombiePony<>());
public Giant(EntityRenderDispatcher manager) {
super(manager, ModelType.ZOMBIE);
}
@Override

View file

@ -17,7 +17,7 @@ public class RenderSeaponyPlayer extends RenderPonyPlayer {
public RenderSeaponyPlayer(EntityRenderDispatcher manager, boolean useSmallArms,
ModelWrapper<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> model,
ModelWrapper<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> alternate) {
super(manager, useSmallArms, model);
super(manager, model);
seapony = alternate;
normalPony = model;

View file

@ -13,6 +13,7 @@ import com.minelittlepony.client.render.entity.RenderPonyMob;
import com.minelittlepony.client.render.entity.feature.LayerGear;
import com.minelittlepony.model.IUnicorn;
import com.minelittlepony.model.gear.IGear;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.util.resources.ITextureSupplier;
abstract class AbstractVillagerRenderer<
@ -23,8 +24,8 @@ abstract class AbstractVillagerRenderer<
private final String entityType;
public AbstractVillagerRenderer(EntityRenderDispatcher manager, M model, String type, ITextureSupplier<String> formatter) {
super(manager, model);
public AbstractVillagerRenderer(EntityRenderDispatcher manager, ModelKey<? super M> key, String type, ITextureSupplier<String> formatter) {
super(manager, key);
entityType = type;
baseTextures = new PonyTextures<>(formatter);

View file

@ -1,9 +1,9 @@
package com.minelittlepony.client.render.entity.villager;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelVillagerPony;
import com.minelittlepony.util.resources.ITextureSupplier;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.passive.VillagerEntity;
@ -13,8 +13,8 @@ public class RenderPonyVillager extends AbstractVillagerRenderer<VillagerEntity,
private static final String TYPE = "villager";
private static final ITextureSupplier<String> FORMATTER = ITextureSupplier.formatted("minelittlepony", "textures/entity/villager/%s.png");
public RenderPonyVillager(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelVillagerPony<>(), TYPE, FORMATTER);
public RenderPonyVillager(EntityRenderDispatcher manager) {
super(manager, ModelType.VILLAGER, TYPE, FORMATTER);
}
@Override

View file

@ -1,9 +1,9 @@
package com.minelittlepony.client.render.entity.villager;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelZombieVillagerPony;
import com.minelittlepony.util.resources.ITextureSupplier;
import net.fabricmc.fabric.api.client.rendereregistry.v1.EntityRendererRegistry;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.mob.ZombieVillagerEntity;
@ -13,8 +13,8 @@ public class RenderPonyZombieVillager extends AbstractVillagerRenderer<ZombieVil
private static final String TYPE = "zombie_villager";
private static final ITextureSupplier<String> FORMATTER = ITextureSupplier.formatted("minelittlepony", "textures/entity/zombie_villager/zombie_%s.png");
public RenderPonyZombieVillager(EntityRenderDispatcher manager, EntityRendererRegistry.Context context) {
super(manager, new ModelZombieVillagerPony(), TYPE, FORMATTER);
public RenderPonyZombieVillager(EntityRenderDispatcher manager) {
super(manager, ModelType.ZOMBIE_VILLAGER, TYPE, FORMATTER);
}
@Override