Update to Minecraft 1.21.2

By: md_5 <git@md-5.net>
This commit is contained in:
CraftBukkit/Spigot
2024-10-23 02:15:00 +11:00
parent 2c4beb962b
commit d3a23f42c3
522 changed files with 8501 additions and 6477 deletions

View File

@@ -23,13 +23,13 @@
IFluidSource ifluidsource = (IFluidSource) block;
+ // CraftBukkit start
+ ItemStack dummyFluid = ifluidsource.pickupBlock(entityhuman, DummyGeneratorAccess.INSTANCE, blockposition, iblockdata);
+ if (dummyFluid.isEmpty()) return InteractionResultWrapper.fail(itemstack); // Don't fire event if the bucket won't be filled.
+ if (dummyFluid.isEmpty()) return EnumInteractionResult.FAIL; // Don't fire event if the bucket won't be filled.
+ PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((WorldServer) world, entityhuman, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.getItem(), enumhand);
+
+ if (event.isCancelled()) {
+ ((EntityPlayer) entityhuman).connection.send(new PacketPlayOutBlockChange(world, blockposition)); // SPIGOT-5163 (see PlayerInteractManager)
+ ((EntityPlayer) entityhuman).getBukkitEntity().updateInventory(); // SPIGOT-4541
+ return InteractionResultWrapper.fail(itemstack);
+ return EnumInteractionResult.FAIL;
+ }
+ // CraftBukkit end