Re-activate MineLP integration

This commit is contained in:
Sollace 2020-04-22 22:41:00 +02:00
parent 46706bc3fb
commit 2536872aad
3 changed files with 12 additions and 29 deletions

View file

@ -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}"

View file

@ -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

View file

@ -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;
}
}
}