[DEV] Deprecate old "isFabric" check in ModloaderEnvironment
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
package com.hypherionmc.craterlib.core.platform;
|
||||
|
||||
public enum LoaderType {
|
||||
FABRIC,
|
||||
FORGE,
|
||||
NEOFORGE,
|
||||
PAPER
|
||||
}
|
@@ -12,8 +12,11 @@ public interface ModloaderEnvironment {
|
||||
|
||||
public final ModloaderEnvironment INSTANCE = InternalServiceUtil.load(ModloaderEnvironment.class);
|
||||
|
||||
@Deprecated(forRemoval = true, since = "2.0.2")
|
||||
boolean isFabric();
|
||||
|
||||
LoaderType getLoaderType();
|
||||
|
||||
String getGameVersion();
|
||||
|
||||
File getGameFolder();
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.hypherionmc.craterlib.common;
|
||||
|
||||
import com.hypherionmc.craterlib.core.platform.Environment;
|
||||
import com.hypherionmc.craterlib.core.platform.LoaderType;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.fabricmc.loader.api.FabricLoader;
|
||||
import net.minecraft.SharedConstants;
|
||||
@@ -19,6 +20,11 @@ public class FabricLoaderHelper implements ModloaderEnvironment {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderType getLoaderType() {
|
||||
return LoaderType.FABRIC;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGameVersion() {
|
||||
return SharedConstants.VERSION_STRING;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.hypherionmc.craterlib.common;
|
||||
|
||||
import com.hypherionmc.craterlib.core.platform.Environment;
|
||||
import com.hypherionmc.craterlib.core.platform.LoaderType;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -23,6 +24,11 @@ public class ForgeLoaderHelper implements ModloaderEnvironment {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderType getLoaderType() {
|
||||
return LoaderType.FORGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGameVersion() {
|
||||
return SharedConstants.VERSION_STRING;
|
||||
|
@@ -1,6 +1,7 @@
|
||||
package com.hypherionmc.craterlib.common;
|
||||
|
||||
import com.hypherionmc.craterlib.core.platform.Environment;
|
||||
import com.hypherionmc.craterlib.core.platform.LoaderType;
|
||||
import com.hypherionmc.craterlib.core.platform.ModloaderEnvironment;
|
||||
import net.minecraft.SharedConstants;
|
||||
import net.minecraft.client.Minecraft;
|
||||
@@ -23,6 +24,11 @@ public class NeoForgeLoaderHelper implements ModloaderEnvironment {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public LoaderType getLoaderType() {
|
||||
return LoaderType.NEOFORGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGameVersion() {
|
||||
return SharedConstants.VERSION_STRING;
|
||||
|
Reference in New Issue
Block a user