Update to Minecraft 1.16.2

This commit is contained in:
md_5
2020-08-12 07:00:00 +10:00
parent 4b9bc9daa5
commit 9c9fb593f5
208 changed files with 2144 additions and 2455 deletions

View File

@@ -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 @@