-
-
Notifications
You must be signed in to change notification settings - Fork 380
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Registry - more registries * BukkitClasses - make registryExists method public * BukkitUtils - create a bukkit utils class --------- Co-authored-by: sovdee <[email protected]>
- Loading branch information
Showing
3 changed files
with
80 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package ch.njol.skript.bukkitutil; | ||
|
||
import ch.njol.skript.Skript; | ||
import org.bukkit.Registry; | ||
|
||
/** | ||
* Utility class with methods pertaining to Bukkit API | ||
*/ | ||
public class BukkitUtils { | ||
|
||
/** | ||
* Check if a registry exists | ||
* | ||
* @param registry Registry to check for (Fully qualified name of registry) | ||
* @return True if registry exists else false | ||
*/ | ||
public static boolean registryExists(String registry) { | ||
return Skript.classExists("org.bukkit.Registry") && Skript.fieldExists(Registry.class, registry); | ||
} | ||
|
||
} |
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
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