Add basic Datapack API
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com>
This commit is contained in:
@@ -328,9 +328,11 @@ public final class Bukkit {
|
||||
/**
|
||||
* Get the DataPack Manager.
|
||||
*
|
||||
* @deprecated use {@link #getDatapackManager()}
|
||||
* @return the manager
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated(forRemoval = true, since = "1.20")
|
||||
public static DataPackManager getDataPackManager() {
|
||||
return server.getDataPackManager();
|
||||
}
|
||||
@@ -2641,6 +2643,14 @@ public final class Bukkit {
|
||||
public static com.destroystokyo.paper.entity.ai.MobGoals getMobGoals() {
|
||||
return server.getMobGoals();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the datapack manager
|
||||
*/
|
||||
@NotNull
|
||||
public static io.papermc.paper.datapack.DatapackManager getDatapackManager() {
|
||||
return server.getDatapackManager();
|
||||
}
|
||||
// Paper end
|
||||
|
||||
@NotNull
|
||||
|
||||
@@ -5654,6 +5654,7 @@ public enum Material implements Keyed, Translatable, net.kyori.adventure.transla
|
||||
* @param world the world to check
|
||||
* @return true if this material can be used in this World.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.20") // Paper
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
if (isItem()) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(asItemType(), world);
|
||||
|
||||
@@ -267,9 +267,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
/**
|
||||
* Get the DataPack Manager.
|
||||
*
|
||||
* @deprecated use {@link #getDatapackManager()}
|
||||
* @return the manager
|
||||
*/
|
||||
@NotNull
|
||||
@Deprecated(forRemoval = true, since = "1.20") // Paper
|
||||
public DataPackManager getDataPackManager();
|
||||
|
||||
/**
|
||||
@@ -2302,5 +2304,11 @@ public interface Server extends PluginMessageRecipient, net.kyori.adventure.audi
|
||||
*/
|
||||
@NotNull
|
||||
com.destroystokyo.paper.entity.ai.MobGoals getMobGoals();
|
||||
|
||||
/**
|
||||
* @return the datapack manager
|
||||
*/
|
||||
@NotNull
|
||||
io.papermc.paper.datapack.DatapackManager getDatapackManager();
|
||||
// Paper end
|
||||
}
|
||||
|
||||
@@ -485,6 +485,7 @@ public enum EntityType implements Keyed, Translatable, net.kyori.adventure.trans
|
||||
* @param world the world to check
|
||||
* @return true if this EntityType can be used to spawn an Entity for this World.
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.20") // Paper
|
||||
public boolean isEnabledByFeature(@NotNull World world) {
|
||||
return Bukkit.getDataPackManager().isEnabledByFeature(this, world);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import org.jetbrains.annotations.NotNull;
|
||||
* Represents a data pack.
|
||||
*
|
||||
* @see <a href="https://minecraft.wiki/w/Data_pack">Minecraft wiki</a>
|
||||
* @deprecated use {@link io.papermc.paper.datapack.Datapack}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.20") // Paper
|
||||
public interface DataPack extends Keyed {
|
||||
|
||||
/**
|
||||
|
||||
@@ -13,7 +13,9 @@ import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* Manager of data packs.
|
||||
* @deprecated use {@link io.papermc.paper.datapack.DatapackManager}
|
||||
*/
|
||||
@Deprecated(forRemoval = true, since = "1.20") // Paper
|
||||
public interface DataPackManager {
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user