mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
170382fe35
Upstream has released updates that appear to apply and compile correctly. This update has not been tested by PaperMC and as with ANY update, please do your own testing Bukkit Changes: e7b0f8d6 #642: Add Crafting methods to API 9e58831e SPIGOT-6641: Use varargs in sendMessage e409fe49 SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled 6997c726 SPIGOT-6661: Fix missing radius from GenericGameEvent 02d03f35 SPIGOT-6369: Add ItemStack to HangingPlaceEvent CraftBukkit Changes: 0abf420c SPIGOT-6665: Shearing a Snowman does not drop a carved pumpkin e8e3cbcc #893: Add Crafting methods to API 879acfee Fix missing varargs from previous commit 6572b9c3 SPIGOT-6641: Use varargs in sendMessage 9e06bb2a SPIGOT-6663: Chicken Jockeys chickens don't despawn 699f2d36 SPIGOT-6545: Unable to set Guardian target via API while awareness is disabled 8ffa54ba SPIGOT-6369: Add ItemStack to HangingPlaceEvent c851639c SPIGOT-6645: Call EntityChangeBlockEvent before PlayerHarvestBlockEvent 8d244b0b SPIGOT-3725, SPIGOT-6638, MC-136917: Properly clear tile entities before replacing Spigot Changes: 18c71bf4 Rebuild patches
106 lines
3.1 KiB
Diff
106 lines
3.1 KiB
Diff
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
From: Connor Linfoot <connorlinfoot@me.com>
|
|
Date: Sun, 16 May 2021 15:07:34 +0100
|
|
Subject: [PATCH] Add basic Datapack API
|
|
|
|
|
|
diff --git a/src/main/java/io/papermc/paper/datapack/Datapack.java b/src/main/java/io/papermc/paper/datapack/Datapack.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..7b2ab0be10a21e0496ad1d485ff8cb2c0b92a2cb
|
|
--- /dev/null
|
|
+++ b/src/main/java/io/papermc/paper/datapack/Datapack.java
|
|
@@ -0,0 +1,32 @@
|
|
+package io.papermc.paper.datapack;
|
|
+
|
|
+import org.checkerframework.checker.nullness.qual.NonNull;
|
|
+
|
|
+public interface Datapack {
|
|
+
|
|
+ /**
|
|
+ * @return the name of the pack
|
|
+ */
|
|
+ @NonNull
|
|
+ String getName();
|
|
+
|
|
+ /**
|
|
+ * @return the compatibility of the pack
|
|
+ */
|
|
+ @NonNull
|
|
+ Compatibility getCompatibility();
|
|
+
|
|
+ /**
|
|
+ * @return whether or not the pack is currently enabled
|
|
+ */
|
|
+ boolean isEnabled();
|
|
+
|
|
+ void setEnabled(boolean enabled);
|
|
+
|
|
+ enum Compatibility {
|
|
+ TOO_OLD,
|
|
+ TOO_NEW,
|
|
+ COMPATIBLE,
|
|
+ }
|
|
+
|
|
+}
|
|
diff --git a/src/main/java/io/papermc/paper/datapack/DatapackManager.java b/src/main/java/io/papermc/paper/datapack/DatapackManager.java
|
|
new file mode 100644
|
|
index 0000000000000000000000000000000000000000..58f78d5e91beacaf710f62461cf869f70d08b2a2
|
|
--- /dev/null
|
|
+++ b/src/main/java/io/papermc/paper/datapack/DatapackManager.java
|
|
@@ -0,0 +1,21 @@
|
|
+package io.papermc.paper.datapack;
|
|
+
|
|
+import org.checkerframework.checker.nullness.qual.NonNull;
|
|
+
|
|
+import java.util.Collection;
|
|
+
|
|
+public interface DatapackManager {
|
|
+
|
|
+ /**
|
|
+ * @return all the packs known to the server
|
|
+ */
|
|
+ @NonNull
|
|
+ Collection<Datapack> getPacks();
|
|
+
|
|
+ /**
|
|
+ * @return all the packs which are currently enabled
|
|
+ */
|
|
+ @NonNull
|
|
+ Collection<Datapack> getEnabledPacks();
|
|
+
|
|
+}
|
|
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java
|
|
index 6bec329379971532eaa44cc8d231c2244ed84975..85a6687be7d26215680054af1524dc946960b75a 100644
|
|
--- a/src/main/java/org/bukkit/Bukkit.java
|
|
+++ b/src/main/java/org/bukkit/Bukkit.java
|
|
@@ -2028,6 +2028,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
|
|
diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java
|
|
index dccd769cdd63f78b51caa09aaf6931a4c1882fb9..024da3febe3fd6c54aa30e99cb08300bc38ddb92 100644
|
|
--- a/src/main/java/org/bukkit/Server.java
|
|
+++ b/src/main/java/org/bukkit/Server.java
|
|
@@ -1780,5 +1780,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
|
|
}
|