3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-18 12:30:06 +01:00

SPIGOT-1790: Fix bucket behaviour

Dieser Commit ist enthalten in:
md_5 2016-03-06 16:41:13 +11:00
Ursprung 23a94053b0
Commit 55b0def5d9

Datei anzeigen

@ -50,7 +50,7 @@
if (!entityhuman.a(blockposition1, movingobjectposition.direction, itemstack)) { if (!entityhuman.a(blockposition1, movingobjectposition.direction, itemstack)) {
return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack); return new InteractionResultWrapper(EnumInteractionResult.FAIL, itemstack);
- } else if (this.a(entityhuman, world, blockposition1)) { - } else if (this.a(entityhuman, world, blockposition1)) {
+ } else if (this.a(entityhuman, world, blockposition, movingobjectposition.direction, itemstack)) { // CraftBukkit + } else if (this.a(entityhuman, world, blockposition1, movingobjectposition.direction, blockposition, itemstack)) { // CraftBukkit
entityhuman.b(StatisticList.b((Item) this)); entityhuman.b(StatisticList.b((Item) this));
return !entityhuman.abilities.canInstantlyBuild ? new InteractionResultWrapper(EnumInteractionResult.SUCCESS, new ItemStack(Items.BUCKET)) : new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack); return !entityhuman.abilities.canInstantlyBuild ? new InteractionResultWrapper(EnumInteractionResult.SUCCESS, new ItemStack(Items.BUCKET)) : new InteractionResultWrapper(EnumInteractionResult.SUCCESS, itemstack);
} else { } else {
@ -79,10 +79,10 @@
+ // CraftBukkit start + // CraftBukkit start
public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition) { public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition) {
+ return a(entityhuman, world, blockposition, null, null); + return a(entityhuman, world, blockposition, null, blockposition, null);
+ } + }
+ +
+ public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, ItemStack itemstack) { + public boolean a(EntityHuman entityhuman, World world, BlockPosition blockposition, EnumDirection enumdirection, BlockPosition clicked, ItemStack itemstack) {
+ // CraftBukkit end + // CraftBukkit end
if (this.a == Blocks.AIR) { if (this.a == Blocks.AIR) {
return false; return false;
@ -93,7 +93,7 @@
} else { } else {
+ // CraftBukkit start + // CraftBukkit start
+ if (entityhuman != null) { + if (entityhuman != null) {
+ PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, blockposition.getX(), blockposition.getY(), blockposition.getZ(), enumdirection, itemstack); + PlayerBucketEmptyEvent event = CraftEventFactory.callPlayerBucketEmptyEvent(entityhuman, clicked.getX(), clicked.getY(), clicked.getZ(), enumdirection, itemstack);
+ if (event.isCancelled()) { + if (event.isCancelled()) {
+ // TODO: inventory not updated + // TODO: inventory not updated
+ return false; + return false;