diff --git a/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch b/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch index ae8fd28dd7..6ac0e0adc2 100644 --- a/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch +++ b/Spigot-Server-Patches/Add-effect-to-block-break-naturally.patch @@ -20,11 +20,12 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 + public boolean breakNaturally(ItemStack item, boolean triggerEffect) { + // Paper end // Order matters here, need to drop before setting to air so skulls can get their data - net.minecraft.server.Block block = this.getNMSBlock(); - boolean result = false; - - if (block != null && block != Blocks.AIR) { - net.minecraft.server.Block.dropItems(getNMS(), world.getMinecraftWorld(), position, world.getTileEntity(position), null, CraftItemStack.asNMSCopy(item)); + net.minecraft.server.IBlockData iblockdata = this.getNMS(); + net.minecraft.server.Block block = iblockdata.getBlock(); +@@ -0,0 +0,0 @@ public class CraftBlock implements Block { + // Modelled off EntityHuman#hasBlock + if (block != Blocks.AIR && (iblockdata.getMaterial().isAlwaysDestroyable() || nmsItem.canDestroySpecialBlock(iblockdata))) { + net.minecraft.server.Block.dropItems(iblockdata, world.getMinecraftWorld(), position, world.getTileEntity(position), null, nmsItem); + if (triggerEffect) world.triggerEffect(org.bukkit.Effect.STEP_SOUND.getId(), position, net.minecraft.server.Block.getCombinedId(block.getBlockData())); // Paper result = true; } diff --git a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch index 47b8a02554..9588082029 100644 --- a/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch +++ b/Spigot-Server-Patches/InventoryCloseEvent-Reason-API.patch @@ -118,23 +118,23 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000 --- a/src/main/java/net/minecraft/server/WorldServer.java +++ b/src/main/java/net/minecraft/server/WorldServer.java @@ -0,0 +0,0 @@ public class WorldServer extends World { - { - if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) - { -- ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(); -+ ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper - } + for (TileEntity tileentity : chunk.getTileEntities().values()) { + if (tileentity instanceof IInventory) { + for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((IInventory) tileentity).getViewers())) { +- h.closeInventory(); ++ h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper } } + } @@ -0,0 +0,0 @@ public class WorldServer extends World { - { - if ( h instanceof org.bukkit.craftbukkit.entity.CraftHumanEntity ) - { -- ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(); -+ ( (org.bukkit.craftbukkit.entity.CraftHumanEntity) h).getHandle().closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper - } - } - } + // Spigot Start + if (entity.getBukkitEntity() instanceof org.bukkit.inventory.InventoryHolder) { + for (org.bukkit.entity.HumanEntity h : Lists.newArrayList(((org.bukkit.inventory.InventoryHolder) entity.getBukkitEntity()).getInventory().getViewers())) { +- h.closeInventory(); ++ h.closeInventory(org.bukkit.event.inventory.InventoryCloseEvent.Reason.UNLOADED); // Paper + } + } + // Spigot End diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java index 0000000000000000000000000000000000000000..0000000000000000000000000000000000000000 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftHumanEntity.java diff --git a/work/Bukkit b/work/Bukkit index da9ef3c55f..ffc8e4caa4 160000 --- a/work/Bukkit +++ b/work/Bukkit @@ -1 +1 @@ -Subproject commit da9ef3c55fa3bce91f7fdcd77d50171be7297d7d +Subproject commit ffc8e4caa484af8f3e4ec2647e546ec0f2b6e95f diff --git a/work/CraftBukkit b/work/CraftBukkit index 933e9094bf..d07a78b1f3 160000 --- a/work/CraftBukkit +++ b/work/CraftBukkit @@ -1 +1 @@ -Subproject commit 933e9094bfef3b0758f62342f06163bbba1bb6a1 +Subproject commit d07a78b1f3aa79945600e5e07d5a457909480b40 diff --git a/work/Spigot b/work/Spigot index 2040c4c476..2f5d615f15 160000 --- a/work/Spigot +++ b/work/Spigot @@ -1 +1 @@ -Subproject commit 2040c4c476931e2b1582cd14e2e4d1e260eb5322 +Subproject commit 2f5d615f157752a2b28b0986b34cc708d5e77674