Skip to content

Instantly share code, notes, and snippets.

@PJZ9n
Created August 5, 2020 11:28
Show Gist options
  • Save PJZ9n/1acb214a36dd943c4435f510a0745885 to your computer and use it in GitHub Desktop.
Save PJZ9n/1acb214a36dd943c4435f510a0745885 to your computer and use it in GitHub Desktop.
<?php
/**
* Copyright (c) 2020 PJZ9n.
*
* This file is part of NewChestShop.
*
* NewChestShop is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* NewChestShop is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with NewChestShop. If not, see <http://www.gnu.org/licenses/>.
*/
declare(strict_types=1);
namespace pjz9n\newchestshop;
use pocketmine\event\Cancellable;
use pocketmine\event\Event;
use pocketmine\inventory\ChestInventory;
use pocketmine\inventory\PlayerCursorInventory;
use pocketmine\item\Item;
class PlayerChestInventoryChangeEvent extends Event implements Cancellable
{
/** @var PlayerCursorInventory */
private $playerCursorInventory;
/** @var ChestInventory */
private $chestInventory;
/** @var Item */
private $source;
/** @var Item */
private $target;
public function __construct(PlayerCursorInventory $playerCursorInventory, ChestInventory $chestInventory, Item $source, Item $target)
{
$this->playerCursorInventory = $playerCursorInventory;
$this->chestInventory = $chestInventory;
$this->source = $source;
$this->target = $target;
}
/**
* @return PlayerCursorInventory
*/
public function getPlayerCursorInventory(): PlayerCursorInventory
{
return $this->playerCursorInventory;
}
/**
* @return ChestInventory
*/
public function getChestInventory(): ChestInventory
{
return $this->chestInventory;
}
/**
* @return Item
*/
public function getSource(): Item
{
return $this->source;
}
/**
* @return Item
*/
public function getTarget(): Item
{
return $this->target;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment