mirror of
https://github.com/MineLittlePony/MineLittlePony.git
synced 2024-11-22 04:27:59 +01:00
Use config listeners for skulls.
This commit is contained in:
parent
0e211ba90b
commit
2676503d98
4 changed files with 7 additions and 8 deletions
|
@ -17,5 +17,6 @@ org.gradle.daemon=false
|
|||
|
||||
# Dependencies
|
||||
fabric_version=0.3.0+
|
||||
kirin_version=1.14.4-1.4.2
|
||||
# TODO update kirin before release
|
||||
kirin_version=1.14.4-1.4.3-SNAPSHOT
|
||||
hd_skins_version=1.14.4-5.4.2
|
||||
|
|
|
@ -93,9 +93,9 @@ public class MineLittlePony implements ClientModInitializer {
|
|||
ClientTickCallback.EVENT.register(this::onTick);
|
||||
ClientReadyCallback.EVENT.register(this::onClientReady);
|
||||
ScreenInitCallback.EVENT.register(this::onScreenInit);
|
||||
if (config.ponyskulls.get()) {
|
||||
PonySkullRenderer.resolve();
|
||||
}
|
||||
config.ponyskulls.onChanged(PonySkullRenderer::resolve);
|
||||
// TODO Config is loaded too early for listeners
|
||||
PonySkullRenderer.resolve(config.ponyskulls.get());
|
||||
|
||||
if (FabricLoader.getInstance().isModLoaded("hdskins")) {
|
||||
IndirectHDSkins.initialize();
|
||||
|
|
|
@ -155,7 +155,5 @@ public class GuiPonySettings extends GameGui {
|
|||
@Override
|
||||
public void removed() {
|
||||
config.save();
|
||||
|
||||
PonySkullRenderer.resolve();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -43,8 +43,8 @@ public class PonySkullRenderer extends SkullBlockEntityRenderer {
|
|||
*
|
||||
* Original/Existing renderer is stored to a backup variable as a fallback in case of mods.
|
||||
*/
|
||||
public static void resolve() {
|
||||
if (MineLittlePony.getInstance().getConfig().ponyskulls.get()) {
|
||||
public static void resolve(boolean ponySkulls) {
|
||||
if (ponySkulls) {
|
||||
if (!(INSTANCE instanceof PonySkullRenderer)) {
|
||||
backup = INSTANCE;
|
||||
BlockEntityRendererRegistry.INSTANCE.register(SkullBlockEntity.class, ponyInstance);
|
||||
|
|
Loading…
Reference in a new issue