mirror of
https://github.com/HibiscusMC/HMCCosmetics.git
synced 2025-12-20 15:39:16 +00:00
Merge remote-tracking branch 'origin/remapped' into remapped
This commit is contained in:
@@ -61,7 +61,7 @@ public final class HMCCosmeticsPlugin extends JavaPlugin {
|
|||||||
Metrics metrics = new Metrics(this, pluginId);
|
Metrics metrics = new Metrics(this, pluginId);
|
||||||
|
|
||||||
// NMS version check
|
// NMS version check
|
||||||
if (!NMSHandlers.getHandler().getSupported()) {
|
if (NMSHandlers.isVersionSupported()) {
|
||||||
getLogger().severe("This version is not supported! Consider switching versions?");
|
getLogger().severe("This version is not supported! Consider switching versions?");
|
||||||
getServer().getPluginManager().disablePlugin(this);
|
getServer().getPluginManager().disablePlugin(this);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.hibiscusmc.hmccosmetics.nms;
|
|||||||
import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin;
|
import com.hibiscusmc.hmccosmetics.HMCCosmeticsPlugin;
|
||||||
import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
|
import com.hibiscusmc.hmccosmetics.util.MessagesUtil;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.lang.reflect.InvocationTargetException;
|
import java.lang.reflect.InvocationTargetException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
@@ -14,6 +15,7 @@ public class NMSHandlers {
|
|||||||
@Getter
|
@Getter
|
||||||
private static String version;
|
private static String version;
|
||||||
|
|
||||||
|
@Nullable
|
||||||
public static NMSHandler getHandler() {
|
public static NMSHandler getHandler() {
|
||||||
if (handler != null) {
|
if (handler != null) {
|
||||||
return handler;
|
return handler;
|
||||||
@@ -23,6 +25,11 @@ public class NMSHandlers {
|
|||||||
return handler;
|
return handler;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isVersionSupported() {
|
||||||
|
if (getHandler() == null) return false;
|
||||||
|
return getHandler().getSupported();
|
||||||
|
}
|
||||||
|
|
||||||
public static void setup() {
|
public static void setup() {
|
||||||
if (handler != null) return;
|
if (handler != null) return;
|
||||||
final String packageName = HMCCosmeticsPlugin.getInstance().getServer().getClass().getPackage().getName();
|
final String packageName = HMCCosmeticsPlugin.getInstance().getServer().getClass().getPackage().getName();
|
||||||
|
|||||||
Reference in New Issue
Block a user