forked from Outfenneced/Combat-Tag
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
39 additions
and
124 deletions.
There are no files selected for viewing
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
123 changes: 0 additions & 123 deletions
123
src/main/java/com/trc202/CombatTag/CombatTagIncompatibles.java
This file was deleted.
Oops, something went wrong.
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
26 changes: 26 additions & 0 deletions
26
src/main/java/techcable/minecraft/combattag/PluginCompatibility.java
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package techcable.minecraft.combattag; | ||
|
||
import org.bukkit.entity.Player; | ||
|
||
import fr.xephi.authme.api.API; | ||
|
||
import lombok.*; | ||
|
||
@Getter | ||
public class PluginCompatibility { | ||
private PluginCompatibility() {} | ||
|
||
public static boolean isAuthenticated(Player player) { | ||
if (!hasAuthme()) return true; | ||
return API.isAuthenticated(player); | ||
} | ||
|
||
public static boolean hasAuthme() { | ||
try { | ||
Class.forName("fr.xephi.authme.AuthMe"); | ||
} catch (ClassNotFoundException ex) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
} |