mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
SPIGOT-5504: cancelling InventoryMoveItemEvent on composter doesn't properly cancel
By: md_5 <git@md-5.net>
This commit is contained in:
parent
26c66710ce
commit
b2fd1fcbe1
1 changed files with 17 additions and 1 deletions
|
@ -42,7 +42,23 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -313,8 +317,9 @@
|
@@ -306,15 +310,23 @@
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void update() {
|
||||||
|
- BlockComposter.d(this.a, this.b, this.c);
|
||||||
|
- this.d = true;
|
||||||
|
+ // CraftBukkit start - allow putting items back (eg cancelled InventoryMoveItemEvent)
|
||||||
|
+ if (this.isNotEmpty()) {
|
||||||
|
+ BlockComposter.d(this.a, this.b, this.c);
|
||||||
|
+ this.d = true;
|
||||||
|
+ } else {
|
||||||
|
+ this.b.setTypeAndData(this.c, this.a, 3);
|
||||||
|
+ this.d = false;
|
||||||
|
+ }
|
||||||
|
+ // CraftBukkit end
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
static class ContainerEmpty extends InventorySubcontainer implements IWorldInventory {
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue