From 3fb9b46013192802a215e13003cd914ccfdafc45 Mon Sep 17 00:00:00 2001 From: Sollace Date: Sun, 11 Dec 2022 00:38:00 +0000 Subject: [PATCH] Move configs to the api package and remove some references to client classes --- .../{settings => api/config}/PonyConfig.java | 18 ++++++++++++++---- .../{settings => api/config}/PonyLevel.java | 2 +- .../com/minelittlepony/api/pony/IPony.java | 5 ++--- .../minelittlepony/api/pony/IPonyManager.java | 4 ++++ .../minelittlepony/api/pony/meta/Sizes.java | 14 +++++++------- .../api/pony/network/fabric/Channel.java | 2 +- .../com/minelittlepony/client/HorseCam.java | 2 +- .../minelittlepony/client/MineLittlePony.java | 5 ++--- .../client/hdskins/DummyPony.java | 3 +-- .../client/hdskins/GuiSkinsMineLP.java | 8 +++----- .../client/hdskins/PonyPreview.java | 3 +-- .../client/mixin/MixinCamera.java | 3 +-- .../client/mixin/MixinClientPlayerEntity.java | 3 +-- .../client/mixin/MixinDefaultSkinHelper.java | 5 +++-- .../mixin/MixinEntityRenderDispatcher.java | 4 ++-- .../client/pony/NativePonyData.java | 2 +- .../minelittlepony/client/pony/PonyData.java | 2 +- .../client/pony/PonyManager.java | 6 ++++-- .../client/render/LevitatingItemRenderer.java | 2 +- .../render/blockentity/skull/MobSkull.java | 2 +- .../blockentity/skull/PlayerPonySkull.java | 4 ++-- .../blockentity/skull/PonySkullRenderer.java | 4 ++-- .../render/entity/PlayerPonyRenderer.java | 3 +-- .../client/render/entity/PonyRenderer.java | 3 +-- .../client/settings/ClientPonyConfig.java | 2 +- 25 files changed, 59 insertions(+), 52 deletions(-) rename src/main/java/com/minelittlepony/{settings => api/config}/PonyConfig.java (90%) rename src/main/java/com/minelittlepony/{settings => api/config}/PonyLevel.java (87%) diff --git a/src/main/java/com/minelittlepony/settings/PonyConfig.java b/src/main/java/com/minelittlepony/api/config/PonyConfig.java similarity index 90% rename from src/main/java/com/minelittlepony/settings/PonyConfig.java rename to src/main/java/com/minelittlepony/api/config/PonyConfig.java index b680e9ba..14a97da5 100644 --- a/src/main/java/com/minelittlepony/settings/PonyConfig.java +++ b/src/main/java/com/minelittlepony/api/config/PonyConfig.java @@ -1,10 +1,10 @@ -package com.minelittlepony.settings; +package com.minelittlepony.api.config; import net.minecraft.util.math.MathHelper; import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.api.pony.meta.Sizes; -import com.minelittlepony.client.MineLittlePony; +import com.minelittlepony.common.util.GamePaths; import com.minelittlepony.common.util.settings.*; import java.nio.file.Path; @@ -13,6 +13,15 @@ import java.nio.file.Path; * Storage container for MineLP client settings. */ public class PonyConfig extends Config { + private static PonyConfig instance; + + public static PonyConfig getInstance() { + if (instance != null) { + return instance; + } + return new PonyConfig(GamePaths.getConfigDirectory().resolve("minelp.json")); + } + /** * Sets the pony level. Want MOAR PONEHS? Well here you go. */ @@ -59,6 +68,7 @@ public class PonyConfig extends Config { public PonyConfig(Path path) { super(HEIRARCHICAL_JSON_ADAPTER, path); + instance = this; } public float setGlobalScaleFactor(float f) { @@ -103,12 +113,12 @@ public class PonyConfig extends Config { */ public static Race getEffectiveRace(Race race) { - Race override = MineLittlePony.getInstance().getConfig().raceOverride.get(); + Race override = instance.raceOverride.get(); if (override != Race.HUMAN) { return override; } - if (MineLittlePony.getInstance().getConfig().ponyLevel.get() == PonyLevel.HUMANS) { + if (instance.ponyLevel.get() == PonyLevel.HUMANS) { return Race.HUMAN; } diff --git a/src/main/java/com/minelittlepony/settings/PonyLevel.java b/src/main/java/com/minelittlepony/api/config/PonyLevel.java similarity index 87% rename from src/main/java/com/minelittlepony/settings/PonyLevel.java rename to src/main/java/com/minelittlepony/api/config/PonyLevel.java index ff50392e..9bcb3fe7 100644 --- a/src/main/java/com/minelittlepony/settings/PonyLevel.java +++ b/src/main/java/com/minelittlepony/api/config/PonyLevel.java @@ -1,4 +1,4 @@ -package com.minelittlepony.settings; +package com.minelittlepony.api.config; public enum PonyLevel { PONIES, diff --git a/src/main/java/com/minelittlepony/api/pony/IPony.java b/src/main/java/com/minelittlepony/api/pony/IPony.java index c5ced63c..07375913 100644 --- a/src/main/java/com/minelittlepony/api/pony/IPony.java +++ b/src/main/java/com/minelittlepony/api/pony/IPony.java @@ -5,9 +5,8 @@ import net.minecraft.util.Identifier; import org.jetbrains.annotations.Nullable; import com.google.common.collect.ComparisonChain; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.meta.Race; -import com.minelittlepony.client.MineLittlePony; -import com.minelittlepony.settings.PonyConfig; public interface IPony extends Comparable { @@ -15,7 +14,7 @@ public interface IPony extends Comparable { * Gets the global pony manager instance. */ static IPonyManager getManager() { - return MineLittlePony.getInstance().getManager(); + return IPonyManager.Instance.instance; } /** diff --git a/src/main/java/com/minelittlepony/api/pony/IPonyManager.java b/src/main/java/com/minelittlepony/api/pony/IPonyManager.java index 1d0e8b7e..0ce48b77 100644 --- a/src/main/java/com/minelittlepony/api/pony/IPonyManager.java +++ b/src/main/java/com/minelittlepony/api/pony/IPonyManager.java @@ -63,4 +63,8 @@ public interface IPonyManager { void removePony(Identifier resource); interface ForcedPony {} + + final class Instance { + public static IPonyManager instance; + } } diff --git a/src/main/java/com/minelittlepony/api/pony/meta/Sizes.java b/src/main/java/com/minelittlepony/api/pony/meta/Sizes.java index 60f194be..e286444f 100644 --- a/src/main/java/com/minelittlepony/api/pony/meta/Sizes.java +++ b/src/main/java/com/minelittlepony/api/pony/meta/Sizes.java @@ -1,6 +1,6 @@ package com.minelittlepony.api.pony.meta; -import com.minelittlepony.client.MineLittlePony; +import com.minelittlepony.api.config.PonyConfig; /** * Represents the different model sizes that are possible. @@ -35,28 +35,28 @@ public enum Sizes implements Size { @Override public float getShadowSize() { - return shadowSize * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor(); + return shadowSize * PonyConfig.getInstance().getGlobalScaleFactor(); } @Override public float getScaleFactor() { - return scale * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor(); + return scale * PonyConfig.getInstance().getGlobalScaleFactor(); } @Override public float getEyeHeightFactor() { - if (!MineLittlePony.getInstance().getConfig().fillycam.get()) { + if (!PonyConfig.getInstance().fillycam.get()) { return 1; } - return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor(); + return camera * PonyConfig.getInstance().getGlobalScaleFactor(); } @Override public float getEyeDistanceFactor() { - if (!MineLittlePony.getInstance().getConfig().fillycam.get()) { + if (!PonyConfig.getInstance().fillycam.get()) { return 1; } - return camera * MineLittlePony.getInstance().getConfig().getGlobalScaleFactor(); + return camera * PonyConfig.getInstance().getGlobalScaleFactor(); } @Override diff --git a/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java b/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java index c8bafe0f..ce292da0 100644 --- a/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java +++ b/src/main/java/com/minelittlepony/api/pony/network/fabric/Channel.java @@ -35,7 +35,7 @@ public class Channel { ClientPlayNetworking.registerGlobalReceiver(REQUEST_PONY_DATA, (client, handler, ignored, sender) -> { if (client.player != null) { - IPony pony = MineLittlePony.getInstance().getManager().getPony(client.player); + IPony pony = IPony.getManager().getPony(client.player); registered = true; MineLittlePony.logger.info("Server has just consented"); diff --git a/src/main/java/com/minelittlepony/client/HorseCam.java b/src/main/java/com/minelittlepony/client/HorseCam.java index 4ae1e34a..0213eeef 100644 --- a/src/main/java/com/minelittlepony/client/HorseCam.java +++ b/src/main/java/com/minelittlepony/client/HorseCam.java @@ -45,7 +45,7 @@ public class HorseCam { return pitch; } - IPony pony = MineLittlePony.getInstance().getManager().getPony(player); + IPony pony = IPony.getManager().getPony(player); if (!pony.race().isHuman()) { Setting fillyCam = MineLittlePony.getInstance().getConfig().fillycam; diff --git a/src/main/java/com/minelittlepony/client/MineLittlePony.java b/src/main/java/com/minelittlepony/client/MineLittlePony.java index dfebcc3b..0b011afb 100644 --- a/src/main/java/com/minelittlepony/client/MineLittlePony.java +++ b/src/main/java/com/minelittlepony/client/MineLittlePony.java @@ -1,6 +1,6 @@ package com.minelittlepony.client; -import com.minelittlepony.api.pony.IPonyManager; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.network.fabric.Channel; import com.minelittlepony.client.model.ModelType; import com.minelittlepony.client.pony.PonyManager; @@ -14,7 +14,6 @@ import com.minelittlepony.common.event.ClientReadyCallback; import com.minelittlepony.common.event.ScreenInitCallback; import com.minelittlepony.common.event.SkinFilterCallback; import com.minelittlepony.common.util.GamePaths; -import com.minelittlepony.settings.PonyConfig; import net.fabricmc.api.ClientModInitializer; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents; @@ -142,7 +141,7 @@ public class MineLittlePony implements ClientModInitializer { return config; } - public IPonyManager getManager() { + public PonyManager getManager() { return ponyManager; } diff --git a/src/main/java/com/minelittlepony/client/hdskins/DummyPony.java b/src/main/java/com/minelittlepony/client/hdskins/DummyPony.java index 643c5192..d345d23d 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/DummyPony.java +++ b/src/main/java/com/minelittlepony/client/hdskins/DummyPony.java @@ -6,7 +6,6 @@ import com.minelittlepony.api.model.ModelAttributes; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.IPonyManager; import com.minelittlepony.client.IPreviewModel; -import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.render.EquineRenderManager; import com.minelittlepony.hdskins.client.dummy.*; @@ -34,7 +33,7 @@ class DummyPony extends DummyPlayer implements IPreviewModel, ModelAttributes.Sw if (getTextures().getPosture().getActiveSkinType() == MineLPHDSkins.seaponySkinType) { return getTextures().usesThinSkin() ? "slimseapony" : "seapony"; } - return MineLittlePony.getInstance().getManager() + return IPony.getManager() .getPony(this) .metadata() .getRace() diff --git a/src/main/java/com/minelittlepony/client/hdskins/GuiSkinsMineLP.java b/src/main/java/com/minelittlepony/client/hdskins/GuiSkinsMineLP.java index 9d3d9dc0..76d9259e 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/GuiSkinsMineLP.java +++ b/src/main/java/com/minelittlepony/client/hdskins/GuiSkinsMineLP.java @@ -1,6 +1,6 @@ package com.minelittlepony.client.hdskins; -import com.minelittlepony.api.pony.IPonyManager; +import com.minelittlepony.api.pony.IPony; import com.minelittlepony.client.GuiPonySettings; import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.common.client.gui.element.Button; @@ -21,8 +21,6 @@ import org.lwjgl.glfw.GLFW; */ class GuiSkinsMineLP extends GuiSkins { - private IPonyManager ponyManager = MineLittlePony.getInstance().getManager(); - private static final String[] PANORAMAS = new String[] { "minelittlepony:textures/cubemap/sugarcubecorner", "minelittlepony:textures/cubemap/quillsandsofas", @@ -77,7 +75,7 @@ class GuiSkinsMineLP extends GuiSkins { MineLittlePony.logger.debug("Invalidating old local skin, checking updated local skin"); if (type == SkinType.SKIN) { - previewer.getLocal().ifPresent(local -> ponyManager.removePony(local.getTextures().get(SkinType.SKIN).getId())); + previewer.getLocal().ifPresent(local -> IPony.getManager().removePony(local.getTextures().get(SkinType.SKIN).getId())); } } @@ -87,7 +85,7 @@ class GuiSkinsMineLP extends GuiSkins { MineLittlePony.logger.debug("Invalidating old remote skin, checking updated remote skin"); if (type == SkinType.SKIN) { - ponyManager.removePony(location); + IPony.getManager().removePony(location); } } } diff --git a/src/main/java/com/minelittlepony/client/hdskins/PonyPreview.java b/src/main/java/com/minelittlepony/client/hdskins/PonyPreview.java index ecdb1e24..f26ee06b 100644 --- a/src/main/java/com/minelittlepony/client/hdskins/PonyPreview.java +++ b/src/main/java/com/minelittlepony/client/hdskins/PonyPreview.java @@ -10,7 +10,6 @@ import org.jetbrains.annotations.Nullable; import com.minelittlepony.api.pony.*; import com.minelittlepony.api.pony.meta.TriggerPixel; import com.minelittlepony.api.pony.meta.Wearable; -import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.render.entity.SeaponyRenderer; import com.minelittlepony.common.client.gui.dimension.Bounds; import com.minelittlepony.hdskins.client.dummy.*; @@ -56,7 +55,7 @@ class PonyPreview extends PlayerPreview { MatrixStack matrices, @Nullable Consumer postAction) { super.renderWorldAndPlayer(thePlayer, frame, horizon, mouseX, mouseY, ticks, partialTick, scale, matrices, postAction); thePlayer.ifPresent(p -> { - IPonyData data = MineLittlePony.getInstance().getManager().getPony(p).metadata(); + IPonyData data = IPony.getManager().getPony(p).metadata(); int[] index = new int[1]; data.getTriggerPixels().forEach((key, value) -> { drawLegendBlock(matrices, index[0]++, frame.left, frame.top, mouseX, mouseY, key, value); diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinCamera.java b/src/main/java/com/minelittlepony/client/mixin/MixinCamera.java index 19581a25..db5976d5 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinCamera.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinCamera.java @@ -6,7 +6,6 @@ import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import com.minelittlepony.api.pony.IPony; -import com.minelittlepony.client.MineLittlePony; import net.minecraft.client.MinecraftClient; import net.minecraft.client.render.Camera; @@ -19,7 +18,7 @@ abstract class MixinCamera { private void redirectCameraDistance(double initial, CallbackInfoReturnable info) { double value = info.getReturnValueD(); - IPony pony = MineLittlePony.getInstance().getManager().getPony(MinecraftClient.getInstance().player); + IPony pony = IPony.getManager().getPony(MinecraftClient.getInstance().player); if (!pony.race().isHuman()) { value *= pony.metadata().getSize().getEyeDistanceFactor(); diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java index 1479621e..c76f05be 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinClientPlayerEntity.java @@ -1,7 +1,6 @@ package com.minelittlepony.client.mixin; import com.minelittlepony.api.pony.IPony; -import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.pony.Pony; import com.minelittlepony.client.render.EquineRenderManager; @@ -48,7 +47,7 @@ abstract class MixinClientPlayerEntity extends AbstractClientPlayerEntity implem public float getActiveEyeHeight(EntityPose pose, EntityDimensions dimensions) { float value = super.getActiveEyeHeight(pose, dimensions); - IPony pony = MineLittlePony.getInstance().getManager().getPony(this); + IPony pony = IPony.getManager().getPony(this); if (!pony.race().isHuman()) { float factor = pony.metadata().getSize().getEyeHeightFactor(); diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinDefaultSkinHelper.java b/src/main/java/com/minelittlepony/client/mixin/MixinDefaultSkinHelper.java index b7aea7ff..5cb4758f 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinDefaultSkinHelper.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinDefaultSkinHelper.java @@ -1,8 +1,9 @@ package com.minelittlepony.client.mixin; +import com.minelittlepony.api.config.PonyLevel; import com.minelittlepony.api.pony.DefaultPonySkinHelper; +import com.minelittlepony.api.pony.IPony; import com.minelittlepony.client.MineLittlePony; -import com.minelittlepony.settings.PonyLevel; import net.minecraft.client.util.DefaultSkinHelper; import net.minecraft.util.Identifier; @@ -38,7 +39,7 @@ abstract class MixinDefaultSkinHelper { cancellable = true) private static void onGetModel(UUID uuid, CallbackInfoReturnable cir) { if (MineLittlePony.getInstance().getConfig().ponyLevel.get() == PonyLevel.PONIES) { - cir.setReturnValue(MineLittlePony.getInstance().getManager() + cir.setReturnValue(IPony.getManager() .getPony(DefaultSkinHelper.getTexture(uuid), uuid) .race() .getModelId("slim".equalsIgnoreCase(cir.getReturnValue()))); diff --git a/src/main/java/com/minelittlepony/client/mixin/MixinEntityRenderDispatcher.java b/src/main/java/com/minelittlepony/client/mixin/MixinEntityRenderDispatcher.java index dc9fa477..0f9293cd 100644 --- a/src/main/java/com/minelittlepony/client/mixin/MixinEntityRenderDispatcher.java +++ b/src/main/java/com/minelittlepony/client/mixin/MixinEntityRenderDispatcher.java @@ -1,7 +1,7 @@ package com.minelittlepony.client.mixin; +import com.minelittlepony.api.pony.IPony; import com.minelittlepony.client.IPreviewModel; -import com.minelittlepony.client.MineLittlePony; import net.minecraft.client.network.AbstractClientPlayerEntity; import net.minecraft.client.render.entity.EntityRenderDispatcher; @@ -21,7 +21,7 @@ abstract class MixinEntityRenderDispatcher { if (player instanceof IPreviewModel) { return player.getModel(); } - return MineLittlePony.getInstance().getManager() + return IPony.getManager() .getPony(player) .race() .getModelId(player.getModel().contains("slim")); diff --git a/src/main/java/com/minelittlepony/client/pony/NativePonyData.java b/src/main/java/com/minelittlepony/client/pony/NativePonyData.java index 8ee0faa7..f282d303 100644 --- a/src/main/java/com/minelittlepony/client/pony/NativePonyData.java +++ b/src/main/java/com/minelittlepony/client/pony/NativePonyData.java @@ -3,6 +3,7 @@ package com.minelittlepony.client.pony; import net.minecraft.client.texture.NativeImage; import com.google.common.base.MoreObjects; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.IPonyData; import com.minelittlepony.api.pony.TriggerPixelSet; import com.minelittlepony.api.pony.TriggerPixelType; @@ -10,7 +11,6 @@ import com.minelittlepony.api.pony.TriggerPixelValue; import com.minelittlepony.api.pony.meta.*; import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.common.util.animation.Interpolator; -import com.minelittlepony.settings.PonyConfig; import java.util.Map; import java.util.TreeMap; diff --git a/src/main/java/com/minelittlepony/client/pony/PonyData.java b/src/main/java/com/minelittlepony/client/pony/PonyData.java index 755146fb..55d8fd2a 100644 --- a/src/main/java/com/minelittlepony/client/pony/PonyData.java +++ b/src/main/java/com/minelittlepony/client/pony/PonyData.java @@ -4,13 +4,13 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.util.Identifier; import com.google.common.base.MoreObjects; import com.google.gson.annotations.Expose; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.IPonyData; import com.minelittlepony.api.pony.TriggerPixelType; import com.minelittlepony.api.pony.meta.*; import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.util.render.NativeUtil; import com.minelittlepony.common.util.animation.Interpolator; -import com.minelittlepony.settings.PonyConfig; import java.io.IOException; import java.util.*; diff --git a/src/main/java/com/minelittlepony/client/pony/PonyManager.java b/src/main/java/com/minelittlepony/client/pony/PonyManager.java index e3bec42d..dec53be7 100644 --- a/src/main/java/com/minelittlepony/client/pony/PonyManager.java +++ b/src/main/java/com/minelittlepony/client/pony/PonyManager.java @@ -1,13 +1,14 @@ package com.minelittlepony.client.pony; import com.google.common.cache.*; +import com.minelittlepony.api.config.PonyConfig; +import com.minelittlepony.api.config.PonyLevel; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.IPonyManager; import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.render.PonyRenderDispatcher; import com.minelittlepony.client.render.blockentity.skull.PonySkullRenderer; -import com.minelittlepony.settings.PonyConfig; -import com.minelittlepony.settings.PonyLevel; + import org.jetbrains.annotations.Nullable; import net.fabricmc.fabric.api.resource.SimpleSynchronousResourceReloadListener; @@ -44,6 +45,7 @@ public class PonyManager implements IPonyManager, SimpleSynchronousResourceReloa public PonyManager(PonyConfig config) { this.config = config; + Instance.instance = this; } @Override diff --git a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java index 1ddc4cda..905d4cba 100644 --- a/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/LevitatingItemRenderer.java @@ -80,7 +80,7 @@ public class LevitatingItemRenderer { if (entity instanceof PlayerEntity && (mode.isFirstPerson() || mode == ModelTransformation.Mode.THIRD_PERSON_LEFT_HAND || mode == ModelTransformation.Mode.THIRD_PERSON_RIGHT_HAND)) { - IPony pony = MineLittlePony.getInstance().getManager().getPony((PlayerEntity)entity); + IPony pony = IPony.getManager().getPony((PlayerEntity)entity); matrix.push(); diff --git a/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java b/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java index 8bf327e7..10b6f48c 100644 --- a/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java +++ b/src/main/java/com/minelittlepony/client/render/blockentity/skull/MobSkull.java @@ -1,12 +1,12 @@ package com.minelittlepony.client.render.blockentity.skull; import com.google.common.base.Suppliers; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.client.model.AbstractPonyModel; import com.minelittlepony.client.render.MobRenderers; import com.minelittlepony.client.render.blockentity.skull.PonySkullRenderer.ISkull; import com.minelittlepony.mson.api.ModelKey; -import com.minelittlepony.settings.PonyConfig; import com.mojang.authlib.GameProfile; import java.util.function.Supplier; diff --git a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java index deed71c8..1478ce86 100644 --- a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java +++ b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PlayerPonySkull.java @@ -1,13 +1,13 @@ package com.minelittlepony.client.render.blockentity.skull; import com.google.common.base.Suppliers; +import com.minelittlepony.api.config.PonyConfig; +import com.minelittlepony.api.config.PonyLevel; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.client.SkinsProxy; import com.minelittlepony.client.model.*; import com.minelittlepony.client.render.blockentity.skull.PonySkullRenderer.ISkull; -import com.minelittlepony.settings.PonyConfig; -import com.minelittlepony.settings.PonyLevel; import com.mojang.authlib.GameProfile; import java.util.HashMap; diff --git a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PonySkullRenderer.java b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PonySkullRenderer.java index eb9064e2..9ea0a843 100644 --- a/src/main/java/com/minelittlepony/client/render/blockentity/skull/PonySkullRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/blockentity/skull/PonySkullRenderer.java @@ -1,6 +1,7 @@ package com.minelittlepony.client.render.blockentity.skull; import com.google.common.collect.Maps; +import com.minelittlepony.api.config.PonyConfig; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.model.ModelType; @@ -8,7 +9,6 @@ import com.minelittlepony.client.render.LevitatingItemRenderer; import com.minelittlepony.client.render.MobRenderers; import com.minelittlepony.client.render.entity.SkeleponyRenderer; import com.minelittlepony.client.render.entity.ZomponyRenderer; -import com.minelittlepony.settings.PonyConfig; import com.mojang.authlib.GameProfile; import net.minecraft.block.SkullBlock; @@ -69,7 +69,7 @@ public class PonySkullRenderer { return false; } - if (!selectedSkull.bindPony(MineLittlePony.getInstance().getManager().getPony(selectedSkin))) { + if (!selectedSkull.bindPony(IPony.getManager().getPony(selectedSkin))) { return false; } diff --git a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java index 62c13e35..06f012ed 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PlayerPonyRenderer.java @@ -4,7 +4,6 @@ import com.minelittlepony.api.model.ModelAttributes; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.meta.Race; import com.minelittlepony.api.pony.meta.Wearable; -import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.SkinsProxy; import com.minelittlepony.client.model.ClientPonyModel; import com.minelittlepony.client.model.ModelWrapper; @@ -194,7 +193,7 @@ public class PlayerPonyRenderer extends PlayerEntityRenderer implements IPonyRen @Override public IPony getEntityPony(AbstractClientPlayerEntity entity) { - return MineLittlePony.getInstance().getManager().getPony(entity); + return IPony.getManager().getPony(entity); } @Override diff --git a/src/main/java/com/minelittlepony/client/render/entity/PonyRenderer.java b/src/main/java/com/minelittlepony/client/render/entity/PonyRenderer.java index 3709bfc5..ddeae170 100644 --- a/src/main/java/com/minelittlepony/client/render/entity/PonyRenderer.java +++ b/src/main/java/com/minelittlepony/client/render/entity/PonyRenderer.java @@ -2,7 +2,6 @@ package com.minelittlepony.client.render.entity; import com.minelittlepony.api.pony.IPony; import com.minelittlepony.api.pony.meta.Wearable; -import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.client.model.ClientPonyModel; import com.minelittlepony.client.model.IPonyModel; import com.minelittlepony.client.model.ModelWrapper; @@ -123,7 +122,7 @@ public abstract class PonyRenderer @Override public IPony getEntityPony(T entity) { - return MineLittlePony.getInstance().getManager().getPony(getTexture(entity)); + return IPony.getManager().getPony(getTexture(entity)); } public abstract static class Caster> extends PonyRenderer { diff --git a/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java b/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java index 7c7245ae..3b385017 100644 --- a/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java +++ b/src/main/java/com/minelittlepony/client/settings/ClientPonyConfig.java @@ -3,10 +3,10 @@ package com.minelittlepony.client.settings; import net.minecraft.client.MinecraftClient; import net.minecraft.entity.player.PlayerEntity; +import com.minelittlepony.api.config.PonyConfig; 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; import java.nio.file.Path;