Paper/Spigot-API-Patches/0151-Add-an-API-for-CanPlaceOn-and-CanDestroy-NBT-values.patch
Aikar 80b6894798
[Auto] Updated Upstream (Bukkit)
Upstream has released updates that appears 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:
162807b3 Remove some draft API designations
2018-10-25 06:01:38 -04:00

48 lines
1.6 KiB
Diff

From 7ac07ac07ac07ac07ac07ac07ac07ac07ac07ac0 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 7ac07ac07ac0..7ac07ac07ac0 100644
--- a/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
+++ b/src/main/java/org/bukkit/inventory/meta/ItemMeta.java
@@ -348,4 +348,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.1