De-mcp-ify a lot of class names

This commit is contained in:
Sollace 2019-11-30 13:12:46 +02:00
parent 1870bb5772
commit 7b8a8fa3c4
46 changed files with 296 additions and 288 deletions

View file

@ -4,7 +4,7 @@ import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.resource.language.I18n;
import net.minecraft.text.LiteralText;
import com.minelittlepony.client.render.entity.MobRenderers;
import com.minelittlepony.client.render.MobRenderers;
import com.minelittlepony.client.settings.ClientPonyConfig;
import com.minelittlepony.common.client.gui.GameGui;
import com.minelittlepony.common.client.gui.ScrollContainer;
@ -117,10 +117,10 @@ class GuiPonySettings extends GameGui {
}
content.addButton(new Label(RIGHT, row)).getStyle().setText(MOB_PREFIX + "title");
for (MobRenderers i : MobRenderers.registry) {
for (MobRenderers i : MobRenderers.REGISTRY.values()) {
content.addButton(new Toggle(RIGHT, row += 20, i.get()))
.onChange(i::set)
.getStyle().setText(MOB_PREFIX + i.name().toLowerCase());
.getStyle().setText(MOB_PREFIX + i.name);
}
}

View file

@ -3,6 +3,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.PonyRenderDispatcher;
import com.minelittlepony.client.render.blockentity.skull.PonySkullRenderer;
import com.minelittlepony.client.settings.ClientPonyConfig;
import com.minelittlepony.common.client.gui.VisibilityMode;
@ -41,7 +42,7 @@ public class MineLittlePony implements ClientModInitializer {
public static final Logger logger = LogManager.getLogger("MineLittlePony");
private final PonyRenderManager renderManager = PonyRenderManager.getInstance();
private final PonyRenderDispatcher renderManager = PonyRenderDispatcher.getInstance();
private ClientPonyConfig config;
private PonyManager ponyManager;
@ -95,7 +96,7 @@ public class MineLittlePony implements ClientModInitializer {
}
private void onClientReady(MinecraftClient client) {
renderManager.initialiseRenderers(client.getEntityRenderManager());
renderManager.initialise(client.getEntityRenderManager());
}
private void onTick(MinecraftClient client) {

View file

@ -6,10 +6,10 @@ import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.ModelWrapper;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.EquineRenderManager;
import com.minelittlepony.client.render.entity.feature.LayerGear;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
import com.minelittlepony.client.render.entity.feature.LayerPonyArmor;
import com.minelittlepony.client.render.entity.feature.LayerPonyElytra;
import com.minelittlepony.client.render.entity.feature.GearFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.minelittlepony.client.render.entity.feature.ArmourFeature;
import com.minelittlepony.client.render.entity.feature.ElytraFeature;
import com.minelittlepony.hdskins.dummy.DummyPlayerRenderer;
import com.minelittlepony.hdskins.profile.SkinType;
import com.minelittlepony.mson.api.ModelKey;
@ -30,7 +30,7 @@ class DummyPonyRenderer extends DummyPlayerRenderer<DummyPony, ClientPonyModel<D
public DummyPonyRenderer(EntityRenderDispatcher dispatcher) {
super(dispatcher, null);
addFeature(new LayerGear<>(this));
addFeature(new GearFeature<>(this));
manager.setModel(ModelType.EARTH_PONY.getKey(false));
manager.setSkipBlend();
@ -86,17 +86,17 @@ class DummyPonyRenderer extends DummyPlayerRenderer<DummyPony, ClientPonyModel<D
@Override
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getArmourLayer() {
return new LayerPonyArmor<>(this);
return new ArmourFeature<>(this);
}
@Override
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getHeldItemLayer() {
return new LayerHeldPonyItemMagical<>(this);
return new GlowingItemFeature<>(this);
}
@Override
protected FeatureRenderer<DummyPony, ClientPonyModel<DummyPony>> getElytraLayer() {
return new LayerPonyElytra<DummyPony, ClientPonyModel<DummyPony>>(this) {
return new ElytraFeature<DummyPony, ClientPonyModel<DummyPony>>(this) {
@Override
protected Identifier getElytraTexture(DummyPony entity) {
return entity.getTextures().get(SkinType.ELYTRA).getId();

View file

@ -4,7 +4,7 @@ import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
import com.minelittlepony.client.PonyRenderManager;
import com.minelittlepony.client.render.PonyRenderDispatcher;
import javax.annotation.Nullable;
@ -43,6 +43,6 @@ abstract class MixinFirstPersonRenderer {
VertexConsumerProvider renderContext,
@Nullable World world,
int lightUv, int overlayUv) {
PonyRenderManager.getInstance().getMagicRenderer().renderItemInFirstPerson(target, (AbstractClientPlayerEntity)entity, item, transform, left, stack, renderContext, world, lightUv);
PonyRenderDispatcher.getInstance().getMagicRenderer().renderItemInFirstPerson(target, (AbstractClientPlayerEntity)entity, item, transform, left, stack, renderContext, world, lightUv);
}
}

View file

@ -27,8 +27,8 @@ import com.minelittlepony.client.model.gear.Muffin;
import com.minelittlepony.client.model.gear.SaddleBags;
import com.minelittlepony.client.model.gear.Stetson;
import com.minelittlepony.client.model.gear.WitchHat;
import com.minelittlepony.client.render.entity.RenderPonyPlayer;
import com.minelittlepony.client.render.entity.RenderSeaponyPlayer;
import com.minelittlepony.client.render.entity.PlayerPonyRenderer;
import com.minelittlepony.client.render.entity.PlayerSeaponyRenderer;
import com.minelittlepony.model.gear.IGear;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.mson.api.Mson;
@ -79,14 +79,14 @@ public final class ModelType {
public static final PlayerModelKey<?, ModelPegasus<?>> GRYPHON = registerPlayer("gryphon", Race.GRYPHON, ModelPegasus::new);
public static final PlayerModelKey<?, ModelPegasus<?>> HIPPOGRIFF = registerPlayer("hippogriff", Race.HIPPOGRIFF, ModelPegasus::new);
public static final PlayerModelKey<?, ModelEarthPony<?>> EARTH_PONY = registerPlayer("earth_pony", Race.EARTH, ModelEarthPony::new);
public static final PlayerModelKey<?, ModelEarthPony<?>> SEA_PONY = registerPlayer("sea_pony", Race.SEAPONY, ModelEarthPony::new, RenderSeaponyPlayer::new);
public static final PlayerModelKey<?, ModelEarthPony<?>> SEA_PONY = registerPlayer("sea_pony", Race.SEAPONY, ModelEarthPony::new, PlayerSeaponyRenderer::new);
public static final PlayerModelKey<?, ModelPegasus<?>> BAT_PONY = registerPlayer("bat_pony", Race.BATPONY, ModelPegasus::new);
public static final PlayerModelKey<?, ModelChangeling<?>> CHANGELING = registerPlayer("changeling", Race.CHANGELING, ModelChangeling::new);
public static final PlayerModelKey<?, ModelChangeling<?>> CHANGEDLING = registerPlayer("reformed_changeling", Race.CHANGEDLING, ModelChangeling::new);
public static final PlayerModelKey<?, ModelZebra<?>> ZEBRA = registerPlayer("zebra", Race.ZEBRA, ModelZebra::new);
static <E extends LivingEntity, T extends Model & MsonModel> PlayerModelKey<E, T> registerPlayer(String name, Race race, Function<Boolean, T> constructor) {
return registerPlayer(name, race, constructor, RenderPonyPlayer::new);
return registerPlayer(name, race, constructor, PlayerPonyRenderer::new);
}
@SuppressWarnings("unchecked")

View file

@ -11,7 +11,7 @@ import net.minecraft.village.VillagerDataContainer;
import net.minecraft.village.VillagerProfession;
import com.minelittlepony.client.model.entity.race.ModelAlicorn;
import com.minelittlepony.client.render.entity.villager.PonyTextures;
import com.minelittlepony.client.render.entity.npc.PonyTextures;
import com.minelittlepony.model.IPart;
import com.minelittlepony.mson.api.ModelContext;
import com.minelittlepony.pony.meta.Race;

View file

@ -1,8 +1,8 @@
package com.minelittlepony.client.pony;
import com.google.common.base.MoreObjects;
import com.minelittlepony.client.PonyRenderManager;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.PonyRenderDispatcher;
import com.minelittlepony.client.transform.PonyTransformation;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.pony.IPonyData;
@ -158,7 +158,7 @@ public class Pony implements IPony {
@Override
public boolean isRidingInteractive(LivingEntity entity) {
if (entity.hasVehicle() && entity.getVehicle() instanceof LivingEntity) {
return PonyRenderManager.getInstance().getPonyRenderer((LivingEntity) entity.getVehicle()) != null;
return PonyRenderDispatcher.getInstance().getPonyRenderer((LivingEntity) entity.getVehicle()) != null;
}
return false;
}
@ -168,7 +168,7 @@ public class Pony implements IPony {
if (entity.hasVehicle() && entity.getVehicle() instanceof LivingEntity) {
LivingEntity mount = (LivingEntity) entity.getVehicle();
IPonyRenderContext<LivingEntity, ?> render = PonyRenderManager.getInstance().getPonyRenderer(mount);
IPonyRenderContext<LivingEntity, ?> render = PonyRenderDispatcher.getInstance().getPonyRenderer(mount);
return render == null ? null : render.getEntityPony(mount);
}

View file

@ -1,7 +1,6 @@
package com.minelittlepony.client.render;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.client.PonyRenderManager;
import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.client.model.ModelWrapper;
import com.minelittlepony.client.transform.PonyPosture;
@ -85,7 +84,7 @@ public class EquineRenderManager<T extends LivingEntity, M extends EntityModel<T
if (entity.hasVehicle() && entity.getVehicle() instanceof LivingEntity) {
LivingEntity ridingEntity = (LivingEntity) entity.getVehicle();
IPonyRenderContext<LivingEntity, ?> renderer = PonyRenderManager.getInstance().getPonyRenderer(ridingEntity);
IPonyRenderContext<LivingEntity, ?> renderer = PonyRenderDispatcher.getInstance().getPonyRenderer(ridingEntity);
if (renderer != null) {
// negate vanilla translations so the rider begins at the ridees feet.

View file

@ -0,0 +1,92 @@
package com.minelittlepony.client.render;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.client.render.entity.*;
import com.minelittlepony.client.render.entity.npc.*;
import com.minelittlepony.common.util.settings.Setting;
import java.util.HashMap;
import java.util.Map;
import java.util.function.BiConsumer;
import net.minecraft.entity.EntityType;
/**
* Central location where new entity renderers are registered and applied.
*/
public final class MobRenderers {
public static final Map<String, MobRenderers> REGISTRY = new HashMap<>();
public static final MobRenderers VILLAGER = register("villagers", (state, pony) -> {
pony.switchRenderer(state, EntityType.VILLAGER, RenderPonyVillager::new);
pony.switchRenderer(state, EntityType.WITCH, WitchRenderer::new);
pony.switchRenderer(state, EntityType.ZOMBIE_VILLAGER, RenderPonyZombieVillager::new);
pony.switchRenderer(state, EntityType.WANDERING_TRADER, TraderRenderer::new);
});
public static final MobRenderers ILLAGER = register("illagers", (state, pony) -> {
pony.switchRenderer(state, EntityType.VEX, VexRenderer::new);
pony.switchRenderer(state, EntityType.EVOKER, IllagerPonyRenderer.Evoker::new);
pony.switchRenderer(state, EntityType.VINDICATOR, IllagerPonyRenderer.Vindicator::new);
pony.switchRenderer(state, EntityType.ILLUSIONER, IllagerPonyRenderer.Illusionist::new);
pony.switchRenderer(state, EntityType.PILLAGER, PillagerRenderer::new);
});
public static final MobRenderers ZOMBIE = register("zombies", (state, pony) -> {
pony.switchRenderer(state, EntityType.ZOMBIE, ZomponyRenderer::new);
pony.switchRenderer(state, EntityType.HUSK, ZomponyRenderer.Husk::new);
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.ZOMBIE_PIGMAN, ZomponyRenderer.Pigman::new);
});
public static final MobRenderers SKELETON = register("skeletons", (state, pony) -> {
pony.switchRenderer(state, EntityType.SKELETON, SkeleponyRenderer::new);
pony.switchRenderer(state, EntityType.STRAY, SkeleponyRenderer.Stray::new);
pony.switchRenderer(state, EntityType.WITHER_SKELETON, SkeleponyRenderer.Wither::new);
});
public static final MobRenderers GUARDIAN = register("guardians", (state, pony) -> {
pony.switchRenderer(state, EntityType.GUARDIAN, SeaponyRenderer::new);
pony.switchRenderer(state, EntityType.ELDER_GUARDIAN, SeaponyRenderer.Elder::new);
});
public static final MobRenderers ENDERMAN = register("endermen", (state, pony) -> {
pony.switchRenderer(state, EntityType.ENDERMAN, EnderStallionRenderer::new);
});
private final BiConsumer<Boolean, PonyRenderDispatcher> changer;
public final String name;
private boolean lastState;
private MobRenderers(String name, BiConsumer<Boolean, PonyRenderDispatcher> changer) {
this.name = name;
this.changer = changer;
}
public Setting<Boolean> option() {
return MineLittlePony.getInstance().getConfig().<Boolean>get(name);
}
public boolean set(boolean value) {
value = option().set(value);
apply(PonyRenderDispatcher.getInstance());
return value;
}
public boolean get() {
return option().get();
}
public static MobRenderers register(String name, BiConsumer<Boolean, PonyRenderDispatcher> changer) {
return REGISTRY.computeIfAbsent(name, n -> new MobRenderers(name, changer));
}
void apply(PonyRenderDispatcher dispatcher) {
boolean state = get();
if (state != lastState) {
MineLittlePony.logger.info(String.format("Ponify %s [%B] -> [%B]", name, lastState, state));
lastState = state;
changer.accept(state, dispatcher);
}
}
}

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client;
package com.minelittlepony.client.render;
import java.util.Map;
import java.util.function.Function;
@ -6,9 +6,6 @@ import java.util.function.Function;
import com.google.common.collect.Maps;
import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.client.model.entity.race.PlayerModels;
import com.minelittlepony.client.render.LevitatingItemRenderer;
import com.minelittlepony.client.render.entity.MobRenderers;
import com.minelittlepony.client.render.IPonyRenderContext;
import javax.annotation.Nullable;
@ -27,28 +24,27 @@ import net.minecraft.entity.LivingEntity;
* Render manager responsible for replacing and restoring entity renderers when the client settings change.
* Old values are persisted internally.
*/
public class PonyRenderManager {
public class PonyRenderDispatcher {
private static final PonyRenderManager renderManager = new PonyRenderManager();
private static final PonyRenderDispatcher INSTANCE = new PonyRenderDispatcher();
/**
* Gets the static pony render manager responsible for all entity renderers.
*/
public static PonyRenderManager getInstance() {
return renderManager;
public static PonyRenderDispatcher getInstance() {
return INSTANCE;
}
private LevitatingItemRenderer magicRenderer = new LevitatingItemRenderer();
private final Map<EntityType<?>, EntityRenderer<?>> renderMap = Maps.newHashMap();
/**
* Registers all new player skin types. (currently only pony and slimpony).
*/
public void initialiseRenderers(EntityRenderDispatcher manager) {
public void initialise(EntityRenderDispatcher manager) {
PlayerModels.registry.forEach(i -> registerPlayerSkin(manager, i));
MobRenderers.registry.forEach(i -> i.apply(this));
MobRenderers.REGISTRY.values().forEach(i -> i.apply(this));
}
private void registerPlayerSkin(EntityRenderDispatcher manager, PlayerModels playerModel) {
@ -75,7 +71,7 @@ public class PonyRenderManager {
* @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) {
<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));
@ -99,7 +95,7 @@ public class PonyRenderManager {
return null;
}
EntityRenderer<T> renderer = (EntityRenderer<T>)MinecraftClient.getInstance().getEntityRenderManager().getRenderer(entity);
EntityRenderer<?> renderer = MinecraftClient.getInstance().getEntityRenderManager().getRenderer(entity);
if (renderer instanceof IPonyRenderContext) {
return (IPonyRenderContext<T, M>) renderer;

View file

@ -1,6 +1,6 @@
package com.minelittlepony.client.render.blockentity.skull;
import com.minelittlepony.client.render.entity.MobRenderers;
import com.minelittlepony.client.render.MobRenderers;
import com.minelittlepony.settings.PonyConfig;
import com.mojang.authlib.GameProfile;
import net.minecraft.util.Identifier;

View file

@ -3,9 +3,9 @@ package com.minelittlepony.client.render.blockentity.skull;
import com.google.common.collect.Maps;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.client.render.LevitatingItemRenderer;
import com.minelittlepony.client.render.entity.MobRenderers;
import com.minelittlepony.client.render.entity.RenderPonySkeleton;
import com.minelittlepony.client.render.entity.RenderPonyZombie;
import com.minelittlepony.client.render.MobRenderers;
import com.minelittlepony.client.render.entity.SkeleponyRenderer;
import com.minelittlepony.client.render.entity.ZomponyRenderer;
import com.minelittlepony.mson.api.Mson;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.settings.PonyConfig;
@ -40,9 +40,9 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer {
}
private final Map<SkullBlock.SkullType, ISkull> skullMap = Util.create(Maps.newHashMap(), (skullMap) -> {
skullMap.put(SkullBlock.Type.SKELETON, new MobSkull(RenderPonySkeleton.SKELETON, MobRenderers.SKELETONS));
skullMap.put(SkullBlock.Type.WITHER_SKELETON, new MobSkull(RenderPonySkeleton.WITHER, MobRenderers.SKELETONS));
skullMap.put(SkullBlock.Type.ZOMBIE, new MobSkull(RenderPonyZombie.ZOMBIE, MobRenderers.ZOMBIES));
skullMap.put(SkullBlock.Type.SKELETON, new MobSkull(SkeleponyRenderer.SKELETON, MobRenderers.SKELETON));
skullMap.put(SkullBlock.Type.WITHER_SKELETON, new MobSkull(SkeleponyRenderer.WITHER, MobRenderers.SKELETON));
skullMap.put(SkullBlock.Type.ZOMBIE, new MobSkull(ZomponyRenderer.ZOMBIE, MobRenderers.ZOMBIE));
skullMap.put(SkullBlock.Type.PLAYER, new PonySkull());
});

View file

@ -2,10 +2,10 @@ 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 com.minelittlepony.client.render.entity.feature.GlowingEyesFeature;
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.minelittlepony.client.render.entity.feature.GlowingEyesFeature.IGlowingRenderer;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.VertexConsumerProvider;
@ -18,14 +18,14 @@ import net.minecraft.util.Identifier;
import java.util.Random;
public class RenderEnderStallion extends RenderPonyMob<EndermanEntity, ModelEnderStallion> implements IGlowingRenderer {
public class EnderStallionRenderer extends PonyRenderer<EndermanEntity, ModelEnderStallion> implements IGlowingRenderer {
public static final Identifier ENDERMAN = new Identifier("minelittlepony", "textures/entity/enderman/enderman_pony.png");
private static final Identifier EYES = new Identifier("minelittlepony", "textures/entity/enderman/enderman_pony_eyes.png");
private final Random rnd = new Random();
public RenderEnderStallion(EntityRenderDispatcher manager) {
public EnderStallionRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.ENDERMAN);
}
@ -33,12 +33,12 @@ public class RenderEnderStallion extends RenderPonyMob<EndermanEntity, ModelEnde
protected void addLayers() {
addFeature(createItemHoldingLayer());
addFeature(new StuckArrowsFeatureRenderer<>(this));
addFeature(new LayerEyeGlow<>(this));
addFeature(new GlowingEyesFeature<>(this));
}
@Override
protected LayerHeldPonyItem<EndermanEntity, ModelEnderStallion> createItemHoldingLayer() {
return new LayerHeldPonyItemMagical<EndermanEntity, ModelEnderStallion>(this) {
protected HeldItemFeature<EndermanEntity, ModelEnderStallion> createItemHoldingLayer() {
return new GlowingItemFeature<EndermanEntity, ModelEnderStallion>(this) {
@Override
protected ItemStack getRightItem(EndermanEntity entity) {
BlockState state = entity.getCarriedBlock();

View file

@ -1,84 +0,0 @@
package com.minelittlepony.client.render.entity;
import com.minelittlepony.client.MineLittlePony;
import com.minelittlepony.client.PonyRenderManager;
import com.minelittlepony.client.render.entity.villager.*;
import com.minelittlepony.common.util.settings.Setting;
import java.util.Arrays;
import java.util.List;
import java.util.function.BiConsumer;
import net.minecraft.entity.EntityType;
/**
* Central location where new entity renderers are registered and applied.
*/
public enum MobRenderers {
VILLAGERS((state, pony) -> {
pony.switchRenderer(state, EntityType.VILLAGER, RenderPonyVillager::new);
pony.switchRenderer(state, EntityType.WITCH, RenderPonyWitch::new);
pony.switchRenderer(state, EntityType.ZOMBIE_VILLAGER, RenderPonyZombieVillager::new);
pony.switchRenderer(state, EntityType.WANDERING_TRADER, RenderPonyTrader::new);
}),
ILLAGERS((state, pony) -> {
pony.switchRenderer(state, EntityType.VEX, RenderPonyVex::new);
pony.switchRenderer(state, EntityType.EVOKER, RenderPonyIllager.Evoker::new);
pony.switchRenderer(state, EntityType.VINDICATOR, RenderPonyIllager.Vindicator::new);
pony.switchRenderer(state, EntityType.ILLUSIONER, RenderPonyIllager.Illusionist::new);
pony.switchRenderer(state, EntityType.PILLAGER, RenderPonyPillager::new);
}),
ZOMBIES((state, pony) -> {
pony.switchRenderer(state, EntityType.ZOMBIE, RenderPonyZombie::new);
pony.switchRenderer(state, EntityType.HUSK, RenderPonyZombie.Husk::new);
pony.switchRenderer(state, EntityType.GIANT, RenderPonyZombie.Giant::new);
pony.switchRenderer(state, EntityType.DROWNED, RenderPonyZombie.Drowned::new);
}),
PIGZOMBIES((state, pony) -> {
pony.switchRenderer(state, EntityType.ZOMBIE_PIGMAN, RenderPonyZombie.Pigman::new);
}),
SKELETONS((state, pony) -> {
pony.switchRenderer(state, EntityType.SKELETON, RenderPonySkeleton::new);
pony.switchRenderer(state, EntityType.STRAY, RenderPonySkeleton.Stray::new);
pony.switchRenderer(state, EntityType.WITHER_SKELETON, RenderPonySkeleton.Wither::new);
}),
GUARDIANS((state, pony) -> {
pony.switchRenderer(state, EntityType.GUARDIAN, RenderPonyGuardian::new);
pony.switchRenderer(state, EntityType.ELDER_GUARDIAN, RenderPonyGuardian.Elder::new);
}),
ENDERMEN((state, pony) -> {
pony.switchRenderer(state, EntityType.ENDERMAN, RenderEnderStallion::new);
});
public static final List<MobRenderers> registry = Arrays.asList(values());
private final BiConsumer<Boolean, PonyRenderManager> changer;
MobRenderers(BiConsumer<Boolean, PonyRenderManager> changer) {
this.changer = changer;
}
public Setting<Boolean> option() {
return MineLittlePony.getInstance().getConfig().<Boolean>get(name().toLowerCase());
}
public boolean set(boolean value) {
value = option().set(value);
apply(PonyRenderManager.getInstance());
return value;
}
public boolean get() {
return option().get();
}
public void apply(PonyRenderManager pony) {
boolean state = get();
changer.accept(state, pony);
if (state) {
MineLittlePony.logger.info(name() + " are now ponies.");
} else {
MineLittlePony.logger.info(name() + " are no longer ponies.");
}
}
}

View file

@ -8,14 +8,14 @@ import com.minelittlepony.client.render.DebugBoundingBoxRenderer;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.EquineRenderManager.Mode;
import com.minelittlepony.client.render.EquineRenderManager;
import com.minelittlepony.client.render.entity.feature.LayerDJPon3Head;
import com.minelittlepony.client.render.entity.feature.LayerEntityOnPonyShoulder;
import com.minelittlepony.client.render.entity.feature.LayerGear;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
import com.minelittlepony.client.render.entity.feature.LayerPonyArmor;
import com.minelittlepony.client.render.entity.feature.LayerPonyCape;
import com.minelittlepony.client.render.entity.feature.LayerPonyCustomHead;
import com.minelittlepony.client.render.entity.feature.LayerPonyElytra;
import com.minelittlepony.client.render.entity.feature.DJPon3Feature;
import com.minelittlepony.client.render.entity.feature.PassengerFeature;
import com.minelittlepony.client.render.entity.feature.GearFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.minelittlepony.client.render.entity.feature.ArmourFeature;
import com.minelittlepony.client.render.entity.feature.CapeFeature;
import com.minelittlepony.client.render.entity.feature.SkullFeature;
import com.minelittlepony.client.render.entity.feature.ElytraFeature;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.pony.IPony;
import com.minelittlepony.pony.meta.Race;
@ -38,11 +38,11 @@ import net.minecraft.util.Arm;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
public class RenderPonyPlayer extends PlayerEntityRenderer implements IPonyRenderContext<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> {
public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRenderContext<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> {
protected final EquineRenderManager<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>> manager = new EquineRenderManager<>(this);
public RenderPonyPlayer(EntityRenderDispatcher dispatcher, boolean slim, ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> key) {
public PlayerPonyRenderer(EntityRenderDispatcher dispatcher, boolean slim, ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> key) {
super(dispatcher, slim);
this.model = manager.setModel(key).getBody();
@ -53,15 +53,15 @@ public class RenderPonyPlayer extends PlayerEntityRenderer implements IPonyRende
protected void addLayers() {
features.clear();
addLayer(new LayerDJPon3Head<>(this));
addLayer(new LayerPonyArmor<>(this));
addLayer(new DJPon3Feature<>(this));
addLayer(new ArmourFeature<>(this));
addFeature(new StuckArrowsFeatureRenderer<>(this));
addLayer(new LayerPonyCustomHead<>(this));
addLayer(new LayerPonyElytra<>(this));
addLayer(new LayerHeldPonyItemMagical<>(this));
addLayer(new LayerPonyCape<>(this));
addLayer(new LayerEntityOnPonyShoulder<>(this));
addLayer(new LayerGear<>(this));
addLayer(new SkullFeature<>(this));
addLayer(new ElytraFeature<>(this));
addLayer(new GlowingItemFeature<>(this));
addLayer(new CapeFeature<>(this));
addLayer(new PassengerFeature<>(this));
addLayer(new GearFeature<>(this));
}
@SuppressWarnings({"unchecked", "rawtypes"})

View file

@ -11,12 +11,12 @@ import net.minecraft.client.network.AbstractClientPlayerEntity;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.particle.ParticleTypes;
public class RenderSeaponyPlayer extends RenderPonyPlayer {
public class PlayerSeaponyRenderer extends PlayerPonyRenderer {
protected final ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> seapony;
protected final ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> normalPony;
public RenderSeaponyPlayer(EntityRenderDispatcher manager, boolean slim, ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> key) {
public PlayerSeaponyRenderer(EntityRenderDispatcher manager, boolean slim, ModelKey<? extends ClientPonyModel<AbstractClientPlayerEntity>> key) {
super(manager, slim, key);
seapony = ModelType.<AbstractClientPlayerEntity, ClientPonyModel<AbstractClientPlayerEntity>>getPlayerModel(Race.UNICORN).getKey(slim);

View file

@ -7,12 +7,12 @@ import com.minelittlepony.client.model.ModelWrapper;
import com.minelittlepony.client.render.DebugBoundingBoxRenderer;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.EquineRenderManager;
import com.minelittlepony.client.render.entity.feature.LayerGear;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItem;
import com.minelittlepony.client.render.entity.feature.LayerHeldPonyItemMagical;
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.client.render.entity.feature.GearFeature;
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.minelittlepony.client.render.entity.feature.ArmourFeature;
import com.minelittlepony.client.render.entity.feature.SkullFeature;
import com.minelittlepony.client.render.entity.feature.ElytraFeature;
import com.minelittlepony.model.IUnicorn;
import com.minelittlepony.mson.api.ModelKey;
import com.minelittlepony.pony.IPony;
@ -31,11 +31,11 @@ import net.minecraft.util.Identifier;
import java.util.List;
import javax.annotation.Nonnull;
public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T> & IPonyModel<T>> extends MobEntityRenderer<T, M> implements IPonyRenderContext<T, M> {
public abstract class PonyRenderer<T extends MobEntity, M extends EntityModel<T> & IPonyModel<T>> extends MobEntityRenderer<T, M> implements IPonyRenderContext<T, M> {
protected EquineRenderManager<T, M> manager = new EquineRenderManager<>(this);
public RenderPonyMob(EntityRenderDispatcher dispatcher, ModelKey<? super M> key) {
public PonyRenderer(EntityRenderDispatcher dispatcher, ModelKey<? super M> key) {
super(dispatcher, null, 0.5F);
this.model = manager.setModel(key).getBody();
@ -44,15 +44,15 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
}
protected void addLayers() {
addFeature(new LayerPonyArmor<>(this));
addFeature(new ArmourFeature<>(this));
addFeature(createItemHoldingLayer());
//addFeature(new StuckArrowsFeatureRenderer<>(this));
addFeature(new LayerPonyCustomHead<>(this));
addFeature(new LayerPonyElytra<>(this));
addFeature(new LayerGear<>(this));
addFeature(new SkullFeature<>(this));
addFeature(new ElytraFeature<>(this));
addFeature(new GearFeature<>(this));
}
protected abstract LayerHeldPonyItem<T, M> createItemHoldingLayer();
protected abstract HeldItemFeature<T, M> createItemHoldingLayer();
@Override
public void render(T entity, float entityYaw, float tickDelta, MatrixStack stack, VertexConsumerProvider renderContext, int lightUv) {
@ -127,19 +127,19 @@ public abstract class RenderPonyMob<T extends MobEntity, M extends EntityModel<T
return MineLittlePony.getInstance().getManager().getPony(findTexture(entity));
}
public abstract static class Caster<T extends MobEntity, M extends ClientPonyModel<T> & IUnicorn<ModelPart>> extends RenderPonyMob<T, M> {
public abstract static class Caster<T extends MobEntity, M extends ClientPonyModel<T> & IUnicorn<ModelPart>> extends PonyRenderer<T, M> {
public Caster(EntityRenderDispatcher manager, ModelKey<? super M> key) {
super(manager, key);
}
@Override
protected LayerHeldPonyItem<T, M> createItemHoldingLayer() {
return new LayerHeldPonyItemMagical<>(this);
protected HeldItemFeature<T, M> createItemHoldingLayer() {
return new GlowingItemFeature<>(this);
}
}
public abstract static class Proxy<T extends MobEntity, M extends EntityModel<T> & IPonyModel<T>> extends RenderPonyMob<T, M> {
public abstract static class Proxy<T extends MobEntity, M extends EntityModel<T> & IPonyModel<T>> extends PonyRenderer<T, M> {
@SuppressWarnings({"rawtypes", "unchecked"})
public Proxy(List exportedLayers, EntityRenderDispatcher manager, ModelKey<M> key) {

View file

@ -1,29 +0,0 @@
package com.minelittlepony.client.render.entity;
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;
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, ModelType.PILLAGER);
}
@Override
public Identifier findTexture(PillagerEntity entity) {
return TEXTURES;
}
@Override
protected LayerHeldPonyItem<PillagerEntity, ModelPillagerPony<PillagerEntity>> createItemHoldingLayer() {
return new LayerHeldItemIllager<>(this);
}
}

View file

@ -5,9 +5,9 @@ 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.minelittlepony.client.render.entity.PonyRenderer.Proxy;
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.render.VertexConsumerProvider;
@ -19,13 +19,13 @@ import net.minecraft.entity.mob.ElderGuardianEntity;
import net.minecraft.entity.mob.GuardianEntity;
import net.minecraft.util.Identifier;
public class RenderPonyGuardian extends GuardianEntityRenderer {
public class SeaponyRenderer extends GuardianEntityRenderer {
public static final Identifier SEAPONY = new Identifier("minelittlepony", "textures/entity/seapony.png");
private final Proxy<GuardianEntity, ModelGuardianPony> ponyRenderer;
public RenderPonyGuardian(EntityRenderDispatcher manager) {
public SeaponyRenderer(EntityRenderDispatcher manager) {
super(manager);
features.clear();
@ -36,8 +36,8 @@ public class RenderPonyGuardian extends GuardianEntityRenderer {
}
@Override
protected LayerHeldPonyItem<GuardianEntity, ModelGuardianPony> createItemHoldingLayer() {
return new LayerHeldPonyItemMagical<>(this);
protected HeldItemFeature<GuardianEntity, ModelGuardianPony> createItemHoldingLayer() {
return new GlowingItemFeature<>(this);
}
};
model = ponyRenderer.getModel();
@ -69,7 +69,7 @@ public class RenderPonyGuardian extends GuardianEntityRenderer {
resize.setCurrentSize(origin);
}
public static class Elder extends RenderPonyGuardian {
public static class Elder extends SeaponyRenderer {
public Elder(EntityRenderDispatcher manager) {
super(manager);

View file

@ -2,9 +2,9 @@ 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 com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import com.minelittlepony.client.render.entity.feature.GlowingItemFeature;
import com.minelittlepony.client.render.entity.feature.StrayClothingFeature;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
@ -13,13 +13,13 @@ import net.minecraft.entity.mob.StrayEntity;
import net.minecraft.entity.mob.WitherSkeletonEntity;
import net.minecraft.util.Identifier;
public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends RenderPonyMob<Skeleton, ModelSkeletonPony<Skeleton>> {
public class SkeleponyRenderer<Skeleton extends AbstractSkeletonEntity> extends PonyRenderer<Skeleton, ModelSkeletonPony<Skeleton>> {
public static final Identifier SKELETON = new Identifier("minelittlepony", "textures/entity/skeleton/skeleton_pony.png");
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) {
public SkeleponyRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.SKELETON);
}
@ -29,15 +29,15 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends
}
@Override
protected LayerHeldPonyItem<Skeleton, ModelSkeletonPony<Skeleton>> createItemHoldingLayer() {
return new LayerHeldPonyItemMagical<>(this);
protected HeldItemFeature<Skeleton, ModelSkeletonPony<Skeleton>> createItemHoldingLayer() {
return new GlowingItemFeature<>(this);
}
public static class Stray extends RenderPonySkeleton<StrayEntity> {
public static class Stray extends SkeleponyRenderer<StrayEntity> {
public Stray(EntityRenderDispatcher manager) {
super(manager);
addFeature(new LayerPonyStrayOverlay<>(this));
addFeature(new StrayClothingFeature<>(this));
}
@Override
@ -46,7 +46,7 @@ public class RenderPonySkeleton<Skeleton extends AbstractSkeletonEntity> extends
}
}
public static class Wither extends RenderPonySkeleton<WitherSkeletonEntity> {
public static class Wither extends SkeleponyRenderer<WitherSkeletonEntity> {
public Wither(EntityRenderDispatcher manager) {
super(manager);

View file

@ -12,12 +12,12 @@ import com.minelittlepony.client.model.entity.ModelBreezie;
/**
* AKA a breezie :D
*/
public class RenderPonyVex extends BipedEntityRenderer<VexEntity, ModelBreezie<VexEntity>> {
public class VexRenderer extends BipedEntityRenderer<VexEntity, ModelBreezie<VexEntity>> {
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) {
public VexRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.BREEZIE.createModel(), 0.3F);
}

View file

@ -2,7 +2,7 @@ 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 com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.render.model.json.ModelTransformation;
@ -13,17 +13,17 @@ import net.minecraft.item.ItemStack;
import net.minecraft.util.Arm;
import net.minecraft.util.Identifier;
public class RenderPonyWitch extends RenderPonyMob<WitchEntity, ModelWitchPony> {
public class WitchRenderer extends PonyRenderer<WitchEntity, ModelWitchPony> {
private static final Identifier WITCH_TEXTURES = new Identifier("minelittlepony", "textures/entity/witch_pony.png");
public RenderPonyWitch(EntityRenderDispatcher manager) {
public WitchRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.WITCH);
}
@Override
protected LayerHeldPonyItem<WitchEntity, ModelWitchPony> createItemHoldingLayer() {
return new LayerHeldPonyItem<WitchEntity, ModelWitchPony>(this) {
protected HeldItemFeature<WitchEntity, ModelWitchPony> createItemHoldingLayer() {
return new HeldItemFeature<WitchEntity, ModelWitchPony>(this) {
@Override
protected void preItemRender(WitchEntity entity, ItemStack drop, ModelTransformation.Type transform, Arm hand, MatrixStack stack) {
stack.translate(0, -0.3F, -0.8F);

View file

@ -12,14 +12,14 @@ 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>> {
public class ZomponyRenderer<Zombie extends ZombieEntity> extends PonyRenderer.Caster<Zombie, ModelZombiePony<Zombie>> {
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 RenderPonyZombie(EntityRenderDispatcher manager) {
public ZomponyRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.ZOMBIE);
}
@ -28,7 +28,7 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
return ZOMBIE;
}
public static class Drowned extends RenderPonyZombie<DrownedEntity> {
public static class Drowned extends ZomponyRenderer<DrownedEntity> {
public Drowned(EntityRenderDispatcher manager) {
super(manager);
@ -40,7 +40,7 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
}
}
public static class Pigman extends RenderPonyZombie<ZombiePigmanEntity> {
public static class Pigman extends ZomponyRenderer<ZombiePigmanEntity> {
public Pigman(EntityRenderDispatcher manager) {
super(manager);
@ -52,7 +52,7 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
}
}
public static class Husk extends RenderPonyZombie<HuskEntity> {
public static class Husk extends ZomponyRenderer<HuskEntity> {
public Husk(EntityRenderDispatcher manager) {
super(manager);
@ -71,7 +71,7 @@ public class RenderPonyZombie<Zombie extends ZombieEntity> extends RenderPonyMob
}
public static class Giant extends RenderPonyMob.Caster<GiantEntity, ModelZombiePony<GiantEntity>> {
public static class Giant extends PonyRenderer.Caster<GiantEntity, ModelZombiePony<GiantEntity>> {
public Giant(EntityRenderDispatcher manager) {
super(manager, ModelType.ZOMBIE);

View file

@ -14,11 +14,11 @@ import net.minecraft.util.Identifier;
import com.minelittlepony.model.IModel;
// separate class in case I need it later
public abstract class LayerOverlayBase<T extends LivingEntity, M extends BipedEntityModel<T> & IModel> extends FeatureRenderer<T, M> {
public abstract class AbstractClothingFeature<T extends LivingEntity, M extends BipedEntityModel<T> & IModel> extends FeatureRenderer<T, M> {
protected final FeatureRendererContext<T, M> renderer;
public LayerOverlayBase(FeatureRendererContext<T, M> render) {
public AbstractClothingFeature(FeatureRendererContext<T, M> render) {
super(render);
renderer = render;
}

View file

@ -11,12 +11,12 @@ import net.minecraft.client.render.entity.model.EntityModel;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.entity.LivingEntity;
public abstract class AbstractPonyLayer<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends FeatureRenderer<T, M> {
public abstract class AbstractPonyFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends FeatureRenderer<T, M> {
private final IPonyRenderContext<T, M> context;
@SuppressWarnings("unchecked")
public AbstractPonyLayer(IPonyRenderContext<T, M> context) {
public AbstractPonyFeature(IPonyRenderContext<T, M> context) {
super((FeatureRendererContext<T, M>)context);
this.context = context;
}

View file

@ -27,13 +27,13 @@ import net.minecraft.item.DyeableArmorItem;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
public class LayerPonyArmor<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class ArmourFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
private static final IArmourTextureResolver<LivingEntity> textures = new DefaultArmourTextureResolver<>();
private ModelWrapper<T, M> pony;
public LayerPonyArmor(IPonyRenderContext<T, M> renderer) {
public ArmourFeature(IPonyRenderContext<T, M> renderer) {
super(renderer);
}
@ -55,7 +55,7 @@ public class LayerPonyArmor<T extends LivingEntity, M extends EntityModel<T> & I
if (!itemstack.isEmpty() && itemstack.getItem() instanceof ArmorItem) {
V armour = LayerPonyArmor.getArmorModel(entity, itemstack, armorSlot, layer, pony.<V>getArmor().getArmorForLayer(layer));
V armour = ArmourFeature.getArmorModel(entity, itemstack, armorSlot, layer, pony.<V>getArmor().getArmorForLayer(layer));
if (armour.prepareToRender(armorSlot, layer)) {
((BipedEntityModel<T>)pony.getBody()).setAttributes(armour);

View file

@ -18,9 +18,9 @@ import net.minecraft.util.math.MathHelper;
import static com.minelittlepony.model.PonyModelConstants.PI;
public class LayerPonyCape<M extends ClientPonyModel<AbstractClientPlayerEntity>> extends AbstractPonyLayer<AbstractClientPlayerEntity, M> {
public class CapeFeature<M extends ClientPonyModel<AbstractClientPlayerEntity>> extends AbstractPonyFeature<AbstractClientPlayerEntity, M> {
public LayerPonyCape(IPonyRenderContext<AbstractClientPlayerEntity, M> context) {
public CapeFeature(IPonyRenderContext<AbstractClientPlayerEntity, M> context) {
super(context);
}

View file

@ -12,11 +12,11 @@ import com.minelittlepony.client.model.ModelDeadMau5Ears;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.model.BodyPart;
public class LayerDJPon3Head<T extends AbstractClientPlayerEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class DJPon3Feature<T extends AbstractClientPlayerEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
private final ModelDeadMau5Ears deadMau5 = new ModelDeadMau5Ears();
public LayerDJPon3Head(IPonyRenderContext<T, M> context) {
public DJPon3Feature(IPonyRenderContext<T, M> context) {
super(context);
}

View file

@ -20,14 +20,14 @@ import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Identifier;
public class LayerPonyElytra<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class ElytraFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
private static final Identifier TEXTURE_ELYTRA = new Identifier("textures/entity/elytra.png");
@SuppressWarnings("unchecked")
private final PonyElytra<T> modelElytra = (PonyElytra<T>)ModelType.ELYTRA.createModel();
public LayerPonyElytra(IPonyRenderContext<T, M> rp) {
public ElytraFeature(IPonyRenderContext<T, M> rp) {
super(rp);
}

View file

@ -20,11 +20,11 @@ import java.util.HashMap;
import java.util.Map;
import java.util.stream.Collectors;
public class LayerGear<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class GearFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
private final Map<Wearable, IGear> gears;
public LayerGear(IPonyRenderContext<T, M> renderer) {
public GearFeature(IPonyRenderContext<T, M> renderer) {
super(renderer);
gears = ModelType.getWearables().collect(Collectors.toMap(

View file

@ -10,11 +10,11 @@ import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.client.render.IPonyRenderContext;
public class LayerEyeGlow<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends EyesFeatureRenderer<T, M> {
public class GlowingEyesFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends EyesFeatureRenderer<T, M> {
private final RenderLayer layer;
public <V extends FeatureRendererContext<T, M> & IPonyRenderContext<T, M> & IGlowingRenderer> LayerEyeGlow(V renderer) {
public <V extends FeatureRendererContext<T, M> & IPonyRenderContext<T, M> & IGlowingRenderer> GlowingEyesFeature(V renderer) {
super(renderer);
layer = RenderLayer.getEyes(renderer.getEyeTexture());
}

View file

@ -1,8 +1,8 @@
package com.minelittlepony.client.render.entity.feature;
import com.minelittlepony.client.PonyRenderManager;
import com.minelittlepony.client.model.IPonyModel;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.client.render.PonyRenderDispatcher;
import com.minelittlepony.model.IUnicorn;
import net.minecraft.client.model.ModelPart;
@ -14,9 +14,9 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Arm;
public class LayerHeldPonyItemMagical<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends LayerHeldPonyItem<T, M> {
public class GlowingItemFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends HeldItemFeature<T, M> {
public LayerHeldPonyItemMagical(IPonyRenderContext<T, M> context) {
public GlowingItemFeature(IPonyRenderContext<T, M> context) {
super(context);
}
@ -36,7 +36,7 @@ public class LayerHeldPonyItemMagical<T extends LivingEntity, M extends EntityMo
@Override
protected void postItemRender(T entity, ItemStack drop, ModelTransformation.Type transform, Arm hand, MatrixStack stack, VertexConsumerProvider renderContext) {
if (isUnicorn()) {
PonyRenderManager.getInstance().getMagicRenderer().renderItemGlow(entity, drop, transform, hand, ((IUnicorn<?>)getModel()).getMagicColor(), stack, renderContext);
PonyRenderDispatcher.getInstance().getMagicRenderer().renderItemGlow(entity, drop, transform, hand, ((IUnicorn<?>)getModel()).getMagicColor(), stack, renderContext);
}
}

View file

@ -15,9 +15,9 @@ import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Arm;
public class LayerHeldPonyItem<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class HeldItemFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
public LayerHeldPonyItem(IPonyRenderContext<T, M> livingPony) {
public HeldItemFeature(IPonyRenderContext<T, M> livingPony) {
super(livingPony);
}

View file

@ -8,9 +8,9 @@ import net.minecraft.util.Arm;
import com.minelittlepony.client.model.entity.race.ModelAlicorn;
import com.minelittlepony.client.render.IPonyRenderContext;
public class LayerHeldItemIllager<T extends IllagerEntity, M extends ModelAlicorn<T>> extends LayerHeldPonyItem<T, M> {
public class IllagerHeldItemFeature<T extends IllagerEntity, M extends ModelAlicorn<T>> extends HeldItemFeature<T, M> {
public LayerHeldItemIllager(IPonyRenderContext<T,M> livingPony) {
public IllagerHeldItemFeature(IPonyRenderContext<T,M> livingPony) {
super(livingPony);
}

View file

@ -15,11 +15,11 @@ import com.minelittlepony.client.model.ClientPonyModel;
import com.minelittlepony.client.render.IPonyRenderContext;
import com.minelittlepony.model.BodyPart;
public class LayerEntityOnPonyShoulder<T extends PlayerEntity, M extends ClientPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class PassengerFeature<T extends PlayerEntity, M extends ClientPonyModel<T>> extends AbstractPonyFeature<T, M> {
private final ParrotEntityModel model = new ParrotEntityModel();
public LayerEntityOnPonyShoulder(IPonyRenderContext<T, M> context) {
public PassengerFeature(IPonyRenderContext<T, M> context) {
super(context);
}

View file

@ -28,9 +28,9 @@ import net.minecraft.village.VillagerDataContainer;
import static com.mojang.blaze3d.platform.GlStateManager.*;
public class LayerPonyCustomHead<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyLayer<T, M> {
public class SkullFeature<T extends LivingEntity, M extends EntityModel<T> & IPonyModel<T>> extends AbstractPonyFeature<T, M> {
public LayerPonyCustomHead(IPonyRenderContext<T, M> renderPony) {
public SkullFeature(IPonyRenderContext<T, M> renderPony) {
super(renderPony);
}

View file

@ -6,13 +6,13 @@ import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.entity.ModelSkeletonPony;
public class LayerPonyStrayOverlay<Skeleton extends AbstractSkeletonEntity> extends LayerOverlayBase<Skeleton, ModelSkeletonPony<Skeleton>> {
public class StrayClothingFeature<Skeleton extends AbstractSkeletonEntity> extends AbstractClothingFeature<Skeleton, ModelSkeletonPony<Skeleton>> {
public static final Identifier STRAY_SKELETON_OVERLAY = new Identifier("minelittlepony", "textures/entity/skeleton/stray_pony_overlay.png");
private final ModelSkeletonPony<Skeleton> overlayModel = new ModelSkeletonPony<>();
public LayerPonyStrayOverlay(LivingEntityRenderer<Skeleton, ModelSkeletonPony<Skeleton>> render) {
public StrayClothingFeature(LivingEntityRenderer<Skeleton, ModelSkeletonPony<Skeleton>> render) {
super(render);
}

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity.villager;
package com.minelittlepony.client.render.entity.npc;
import net.minecraft.client.model.ModelPart;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
@ -9,7 +9,7 @@ import net.minecraft.village.VillagerDataContainer;
import net.minecraft.village.VillagerProfession;
import com.minelittlepony.client.model.ClientPonyModel;
import com.minelittlepony.client.render.entity.RenderPonyMob;
import com.minelittlepony.client.render.entity.PonyRenderer;
import com.minelittlepony.model.IUnicorn;
import com.minelittlepony.model.gear.IGear;
import com.minelittlepony.mson.api.ModelKey;
@ -18,7 +18,7 @@ import com.minelittlepony.util.resources.ITextureSupplier;
abstract class AbstractVillagerRenderer<
T extends MobEntity & VillagerDataContainer,
M extends ClientPonyModel<T> & IUnicorn<ModelPart> & ModelWithHat> extends RenderPonyMob.Caster<T, M> {
M extends ClientPonyModel<T> & IUnicorn<ModelPart> & ModelWithHat> extends PonyRenderer.Caster<T, M> {
private final ITextureSupplier<T> baseTextures;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity.villager;
package com.minelittlepony.client.render.entity.npc;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.entity.feature.FeatureRendererContext;

View file

@ -1,9 +1,10 @@
package com.minelittlepony.client.render.entity;
package com.minelittlepony.client.render.entity.npc;
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 com.minelittlepony.client.render.entity.feature.IllagerHeldItemFeature;
import com.minelittlepony.client.render.entity.PonyRenderer;
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
@ -16,19 +17,19 @@ import net.minecraft.util.Identifier;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderPonyMob<T, ModelIllagerPony<T>> {
public abstract class IllagerPonyRenderer<T extends IllagerEntity> extends PonyRenderer<T, ModelIllagerPony<T>> {
public static final Identifier ILLUSIONIST = new Identifier("minelittlepony", "textures/entity/illager/illusionist_pony.png");
public static final Identifier EVOKER = new Identifier("minelittlepony", "textures/entity/illager/evoker_pony.png");
public static final Identifier VINDICATOR = new Identifier("minelittlepony", "textures/entity/illager/vindicator_pony.png");
public RenderPonyIllager(EntityRenderDispatcher manager) {
public IllagerPonyRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.ILLAGER);
}
@Override
protected LayerHeldPonyItem<T, ModelIllagerPony<T>> createItemHoldingLayer() {
return new LayerHeldItemIllager<>(this);
protected HeldItemFeature<T, ModelIllagerPony<T>> createItemHoldingLayer() {
return new IllagerHeldItemFeature<>(this);
}
@Override
@ -37,7 +38,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
stack.scale(BASE_MODEL_SCALE, BASE_MODEL_SCALE, BASE_MODEL_SCALE);
}
public static class Vindicator extends RenderPonyIllager<VindicatorEntity> {
public static class Vindicator extends IllagerPonyRenderer<VindicatorEntity> {
public Vindicator(EntityRenderDispatcher manager) {
super(manager);
@ -50,7 +51,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
}
}
public static class Evoker extends RenderPonyIllager<EvokerEntity> {
public static class Evoker extends IllagerPonyRenderer<EvokerEntity> {
public Evoker(EntityRenderDispatcher manager) {
super(manager);
@ -62,7 +63,7 @@ public abstract class RenderPonyIllager<T extends IllagerEntity> extends RenderP
}
}
public static class Illusionist extends RenderPonyIllager<IllusionerEntity> {
public static class Illusionist extends IllagerPonyRenderer<IllusionerEntity> {
public Illusionist(EntityRenderDispatcher manager) {
super(manager);

View file

@ -0,0 +1,30 @@
package com.minelittlepony.client.render.entity.npc;
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.IllagerHeldItemFeature;
import com.minelittlepony.client.render.entity.PonyRenderer;
import com.minelittlepony.client.render.entity.feature.HeldItemFeature;
public class PillagerRenderer extends PonyRenderer<PillagerEntity, ModelPillagerPony<PillagerEntity>> {
private static final Identifier TEXTURES = new Identifier("minelittlepony", "textures/entity/illager/pillager_pony.png");
public PillagerRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.PILLAGER);
}
@Override
public Identifier findTexture(PillagerEntity entity) {
return TEXTURES;
}
@Override
protected HeldItemFeature<PillagerEntity, ModelPillagerPony<PillagerEntity>> createItemHoldingLayer() {
return new IllagerHeldItemFeature<>(this);
}
}

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity.villager;
package com.minelittlepony.client.render.entity.npc;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.LivingEntity;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity.villager;
package com.minelittlepony.client.render.entity.npc;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelVillagerPony;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity.villager;
package com.minelittlepony.client.render.entity.npc;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.ModelZombieVillagerPony;

View file

@ -1,4 +1,4 @@
package com.minelittlepony.client.render.entity;
package com.minelittlepony.client.render.entity.npc;
import net.minecraft.client.render.entity.EntityRenderDispatcher;
import net.minecraft.client.util.math.MatrixStack;
@ -7,12 +7,14 @@ import net.minecraft.util.Identifier;
import com.minelittlepony.client.model.ModelType;
import com.minelittlepony.client.model.entity.race.ModelAlicorn;
import com.minelittlepony.client.render.entity.PonyRenderer;
import com.minelittlepony.client.render.entity.PonyRenderer.Caster;
public class RenderPonyTrader extends RenderPonyMob.Caster<WanderingTraderEntity, ModelAlicorn<WanderingTraderEntity>> {
public class TraderRenderer extends PonyRenderer.Caster<WanderingTraderEntity, ModelAlicorn<WanderingTraderEntity>> {
public static final Identifier TEXTURE = new Identifier("minelittlepony", "textures/entity/wandering_trader_pony.png");
public RenderPonyTrader(EntityRenderDispatcher manager) {
public TraderRenderer(EntityRenderDispatcher manager) {
super(manager, ModelType.ALICORN.getKey(false));
}

View file

@ -3,7 +3,7 @@ package com.minelittlepony.client.settings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.entity.player.PlayerEntity;
import com.minelittlepony.client.render.entity.MobRenderers;
import com.minelittlepony.client.render.MobRenderers;
import com.minelittlepony.common.client.gui.VisibilityMode;
import com.minelittlepony.common.util.settings.Setting;
import com.minelittlepony.settings.PonyConfig;
@ -19,7 +19,7 @@ public class ClientPonyConfig extends PonyConfig {
public ClientPonyConfig(Path path) {
super(path);
MobRenderers.registry.forEach(r -> value(r.name().toLowerCase(), true));
MobRenderers.REGISTRY.values().forEach(r -> value(r.name, true));
}
@Override