Add API for CanPlaceOn and CanDestroy NBT values

This commit is contained in:
Jake Potrebic
2018-09-12 18:53:55 +03:00
parent 334058fa69
commit f6f6664716
2 changed files with 133 additions and 0 deletions

View File

@@ -690,4 +690,22 @@ public class MaterialRerouting {
return ItemStack.of(material, amount);
}
// Paper end
// Paper start - methods added post 1.13, no-op (https://github.com/PaperMC/Paper/pull/1015)
public static Set<Material> getCanDestroy(final ItemMeta meta) {
return meta.getCanDestroy();
}
public static void setCanDestroy(final ItemMeta meta, final Set<Material> materials) {
meta.setCanDestroy(materials);
}
public static Set<Material> getCanPlaceOn(final ItemMeta meta) {
return meta.getCanPlaceOn();
}
public static void setCanPlaceOn(final ItemMeta meta, final Set<Material> materials) {
meta.setCanPlaceOn(materials);
}
// Paper end
}