Last active
August 5, 2023 11:59
-
-
Save Mr-EmPee/2a6faec0d8ba2e86265a6701e828d0c1 to your computer and use it in GitHub Desktop.
[Paper Utils] #Minecraft
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import lombok.AccessLevel; | |
import lombok.NoArgsConstructor; | |
/** | |
* Utilities for falling back from paper | |
*/ | |
@NoArgsConstructor(access = AccessLevel.PRIVATE) | |
public final class PaperUtils { | |
public static final boolean IS_RUNNING_PAPER; | |
static { | |
IS_RUNNING_PAPER = hasClass("com.destroystokyo.paper.PaperConfig") || hasClass("io.papermc.paper.configuration.Configuration"); | |
} | |
private static boolean hasClass(String className) { | |
try { | |
Class.forName(className); | |
return true; | |
} catch (ClassNotFoundException e) { | |
return false; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment