Paper/Spigot-API-Patches/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch

48 lines
1.6 KiB
Diff
Raw Normal View History

From f0bdeecfc35f492bd8b81ad517e209611fff0d6f Mon Sep 17 00:00:00 2001
From: Mark Vainomaa <mikroskeem@mikroskeem.eu>
Date: Wed, 12 Sep 2018 18:53:35 +0300
Subject: [PATCH] Add an API for CanPlaceOn and CanDestroy NBT values
diff --git a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
index 8d8f09879..97fa7807b 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -350,4 +350,33 @@ public interface ItemMeta extends Cloneable, ConfigurationSerializable {
Spigot spigot();
// Spigot end
+ // Paper start - Add an API for CanPlaceOn and CanDestroy NBT values
+ /**
+ * Gets set of materials what given item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of materials
+ */
+ Set<org.bukkit.Material> getCanDestroy();
+
+ /**
+ * Sets set of materials what given item can destroy in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canDestroy Set of materials
+ */
+ void setCanDestroy(Set<org.bukkit.Material> canDestroy);
+
+ /**
+ * Gets set of materials where given item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @return Set of materials
+ */
+ Set<org.bukkit.Material> getCanPlaceOn();
+
+ /**
+ * Sets set of materials where given item can be placed on in {@link org.bukkit.GameMode#ADVENTURE}
+ *
+ * @param canPlaceOn Set of materials
+ */
+ void setCanPlaceOn(Set<org.bukkit.Material> canPlaceOn);
+ // Paper end
}
--
2.19.0