diff --git a/build.gradle b/build.gradle index 4f99ed42..520eb6cd 100644 --- a/build.gradle +++ b/build.gradle @@ -52,6 +52,8 @@ dependencies { modCompile "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}" + modApi "com.minelittlepony:MineLittlePony:${project.minelp_version}" + modApi "com.minelittlepony:Kirin:${project.kirin_version}" include "com.minelittlepony:Kirin:${project.kirin_version}" diff --git a/gradle.properties b/gradle.properties index a212e308..d09dac92 100644 --- a/gradle.properties +++ b/gradle.properties @@ -18,4 +18,5 @@ org.gradle.daemon=false # Dependencies fabric_version=0.4.29+ modmenu_version=1.8.+ + minelp_version=4.0.7-1.15.2 kirin_version=1.5.2-1.15.2 diff --git a/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java b/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java index 062bb4ef..d9e54fa2 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java +++ b/src/main/java/com/minelittlepony/unicopia/client/MineLPConnector.java @@ -1,45 +1,27 @@ package com.minelittlepony.unicopia.client; +import com.minelittlepony.client.MineLittlePony; import com.minelittlepony.unicopia.Race; +import net.fabricmc.loader.api.FabricLoader; +import net.minecraft.client.MinecraftClient; + public final class MineLPConnector { - private static boolean checkComplete; - private static boolean modIsActive; - - // TODO: MineLP - /** - * Returns true if mine little pony is present. That's all we need. - */ - static boolean modIsActive() { - if (!checkComplete) { - try { - // MineLittlePony.instance(); - - // always true, but this will throw if we don't have what we need. - // modIsActive = PonyRace.HUMAN.isHuman(); - } catch (Exception e) { - modIsActive = false; - } - } - return modIsActive; - } - public static Race getPlayerPonyRace() { - - if (!modIsActive()) { + if (!FabricLoader.getInstance().isModLoaded("minelp")) { return Race.HUMAN; } - /*switch (IPony.forPlayer(MinecraftClient.getInstance().player).getRace(false)) { + switch (MineLittlePony.getInstance().getManager().getPony(MinecraftClient.getInstance().player).getRace(false)) { case ALICORN: return Race.ALICORN; case CHANGELING: - case REFORMED_CHANGELING: + case CHANGEDLING: return Race.CHANGELING; case ZEBRA: case EARTH: return Race.EARTH; - case GRIFFIN: + case GRYPHON: case HIPPOGRIFF: case PEGASUS: case BATPONY: @@ -49,8 +31,6 @@ public final class MineLPConnector { return Race.UNICORN; default: return Race.EARTH; - - }*/ - return Race.EARTH; + } } } \ No newline at end of file