SPIGOT-7195, SPIGOT-7197: Add DataPack API

By: Doc <nachito94@msn.com>
This commit is contained in:
Bukkit/Spigot
2023-05-30 19:05:41 +10:00
parent dc42ac1025
commit f45d2e6a77
10 changed files with 283 additions and 0 deletions

View File

@@ -444,4 +444,14 @@ public enum EntityType implements Keyed, Translatable {
public String getTranslationKey() {
return Bukkit.getUnsafe().getTranslationKey(this);
}
/**
* Gets if this EntityType is enabled by feature in a world.
*
* @param world the world to check
* @return true if this EntityType can be used to spawn an Entity for this World.
*/
public boolean isEnabledByFeature(@NotNull World world) {
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
}
}