Removed EntityInventoryChangeEvent and EntityArmorChangeEvent

there is nothing that these events do that can't be fulfilled by transactions. They complicate the internal implementation and produce unexpected behaviour for plugins when cancelled.

TL;DR: Use transactions. That's what they are there for.
This commit is contained in:
Dylan K. Taylor
2019-05-19 16:02:03 +01:00
parent 67affcea32
commit dec6c9f49b
6 changed files with 7 additions and 144 deletions

View File

@ -60,9 +60,8 @@ class Furnace extends Spawnable implements InventoryHolder, Container, Nameable{
public function __construct(World $world, Vector3 $pos){
$this->inventory = new FurnaceInventory($this);
$this->inventory->setSlotChangeListener(function(Inventory $inventory, int $slot, Item $oldItem, Item $newItem) : ?Item{
$this->inventory->setSlotChangeListener(function(Inventory $inventory, int $slot) : void{
$this->scheduleUpdate();
return $newItem;
});
parent::__construct($world, $pos);