Merge remote-tracking branch 'origin/master'

This commit is contained in:
HaHaWTH 2024-05-31 14:38:12 +08:00
commit 5981af630a
2 changed files with 4 additions and 4 deletions

View File

@ -513,7 +513,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.0</version>
<version>3.1.2</version>
</plugin>
<!-- Deploy the jars as artifacts into the remote repository -->
<plugin>
@ -1193,7 +1193,7 @@
<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.45.3.0</version>
<version>3.46.0.0</version>
<scope>test</scope>
</dependency>
<dependency>

View File

@ -10,7 +10,7 @@ public final class PlayerUtils {
// Utility class
private PlayerUtils() {
}
private static final boolean IS_LEAVES_SERVER = Utils.isClassLoaded("top.leavesmc.leaves.LeavesConfig");
private static final boolean isLeavesServer = Utils.isClassLoaded("top.leavesmc.leaves.LeavesConfig") || Utils.isClassLoaded("org.leavesmc.leaves.LeavesConfig");
/**
* Returns the IP of the given player.
@ -29,7 +29,7 @@ public final class PlayerUtils {
* @return True if the player is an NPC, false otherwise
*/
public static boolean isNpc(Player player) {
if (IS_LEAVES_SERVER) {
if (isLeavesServer) {
return player.hasMetadata("NPC") || player.getAddress() == null;
} else {
return player.hasMetadata("NPC");