mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-30 20:03:51 -07:00
Update to Minecraft 1.16.2
This commit is contained in:
@@ -15,14 +15,14 @@
|
||||
@@ -10,11 +15,34 @@
|
||||
@Override
|
||||
protected ItemStack a(ISourceBlock isourceblock, ItemStack itemstack) {
|
||||
World world = isourceblock.getWorld();
|
||||
WorldServer worldserver = isourceblock.getWorld();
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.block.Block bukkitBlock = world.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
||||
+ org.bukkit.block.Block bukkitBlock = worldserver.getWorld().getBlockAt(isourceblock.getBlockPosition().getX(), isourceblock.getBlockPosition().getY(), isourceblock.getBlockPosition().getZ());
|
||||
+ CraftItemStack craftItem = CraftItemStack.asCraftMirror(itemstack);
|
||||
+
|
||||
+ BlockDispenseEvent event = new BlockDispenseEvent(bukkitBlock, craftItem.clone(), new org.bukkit.util.Vector(0, 0, 0));
|
||||
+ if (!BlockDispenser.eventFired) {
|
||||
+ world.getServer().getPluginManager().callEvent(event);
|
||||
+ worldserver.getServer().getPluginManager().callEvent(event);
|
||||
+ }
|
||||
+
|
||||
+ if (event.isCancelled()) {
|
||||
@@ -40,12 +40,12 @@
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
|
||||
if (!world.s_()) {
|
||||
if (!worldserver.s_()) {
|
||||
BlockPosition blockposition = isourceblock.getBlockPosition().shift((EnumDirection) isourceblock.getBlockData().get(BlockDispenser.FACING));
|
||||
|
||||
- this.a(a((WorldServer) world, blockposition) || b((WorldServer) world, blockposition));
|
||||
+ this.a(a((WorldServer) world, blockposition) || b((WorldServer) world, blockposition, bukkitBlock, craftItem)); // CraftBukkit
|
||||
if (this.a() && itemstack.isDamaged(1, world.getRandom(), (EntityPlayer) null)) {
|
||||
- this.a(a((WorldServer) worldserver, blockposition) || b((WorldServer) worldserver, blockposition));
|
||||
+ this.a(a((WorldServer) worldserver, blockposition) || b((WorldServer) worldserver, blockposition, bukkitBlock, craftItem)); // CraftBukkit
|
||||
if (this.a() && itemstack.isDamaged(1, worldserver.getRandom(), (EntityPlayer) null)) {
|
||||
itemstack.setCount(0);
|
||||
}
|
||||
@@ -40,7 +68,7 @@
|
||||
|
Reference in New Issue
Block a user