Don't throw NPE for unplaced blockstate on #getDrops (#10366)

This commit is contained in:
Lulu13022002
2024-04-06 23:26:56 +02:00
parent 8a2bd44f1f
commit 2089697232
2 changed files with 10 additions and 12 deletions

View File

@@ -16,17 +16,8 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
}
+
+ @Override
+ public java.util.Collection<org.bukkit.inventory.ItemStack> getDrops() {
+ return this.getDrops(null);
+ }
+
+ @Override
+ public java.util.Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack item) {
+ return this.getDrops(item, null);
+ }
+
+ @Override
+ public java.util.Collection<org.bukkit.inventory.ItemStack> getDrops(org.bukkit.inventory.ItemStack item, org.bukkit.entity.Entity entity) {
+ this.requirePlaced();
+ net.minecraft.world.item.ItemStack nms = org.bukkit.craftbukkit.inventory.CraftItemStack.asNMSCopy(item);
+
+ // Modelled off EntityHuman#hasBlock