mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-22 00:47:38 +01:00
Do not fire PlayerBucketFillEvent when no fluid (Fixes #4611)
This commit is contained in:
parent
6dfd1d9a71
commit
f2471d20b4
@ -0,0 +1,18 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Shane Freeder <theboyetronic@gmail.com>
|
||||
Date: Tue, 17 Aug 2021 15:42:21 +0100
|
||||
Subject: [PATCH] Do not fire PlayerBucketFillEvent when no fluid
|
||||
|
||||
|
||||
diff --git a/src/main/java/net/minecraft/world/item/BucketItem.java b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||
index 4fdb99240e6ebda946fd2e0a847654d92b7c56a1..fb25e1107db0a01b0803af031c117e57e03dc5c1 100644
|
||||
--- a/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||
+++ b/src/main/java/net/minecraft/world/item/BucketItem.java
|
||||
@@ -73,6 +73,7 @@ public class BucketItem extends Item implements DispensibleContainerItem {
|
||||
BucketPickup ifluidsource = (BucketPickup) iblockdata.getBlock();
|
||||
// CraftBukkit start
|
||||
ItemStack dummyFluid = ifluidsource.pickupBlock(DummyGeneratorAccess.INSTANCE, blockposition, iblockdata);
|
||||
+ if (dummyFluid.isEmpty()) return InteractionResultHolder.fail(itemstack); // Paper
|
||||
PlayerBucketFillEvent event = CraftEventFactory.callPlayerBucketFillEvent((ServerLevel) world, user, blockposition, blockposition, movingobjectpositionblock.getDirection(), itemstack, dummyFluid.getItem(), hand); // Paper - add enumhand
|
||||
|
||||
if (event.isCancelled()) {
|
Loading…
Reference in New Issue
Block a user