Skip to content

Commit

Permalink
Update to the new API methods (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
Muqsit authored Aug 12, 2017
1 parent ccb1a0a commit d57de98
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/PlayerVaults/PlayerVaults.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public static function getInstance() : self{
return self::$instance;
}

public function onCommand(CommandSender $sender, Command $cmd, $label, array $args){
public function onCommand(CommandSender $sender, Command $cmd, string $label, array $args) : bool{

This comment has been minimized.

Copy link
@SalmonDE

SalmonDE Aug 20, 2017

Well you should also actually return a boolean

if(isset($args[0]) && $args[0] !== "help" && $args[0] !== ""){
if(is_numeric($args[0])){
if(strpos($args[0], ".") !== false){
Expand Down
4 changes: 2 additions & 2 deletions src/PlayerVaults/Vault/Vault.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ public function sendReplacement(Player $player){
}
}

public function spawnToAll(){
public function addAdditionalSpawnData(CompoundTag $nbt){
}
}
}
6 changes: 1 addition & 5 deletions src/PlayerVaults/Vault/VaultInventory.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,11 @@

class VaultInventory extends ChestInventory{

public function __construct(Vault $tile){
parent::__construct($tile, InventoryType::get(InventoryType::CHEST));
}

public function onClose(Player $who){
if(isset($this->getHolder()->namedtag->Vault)){
PlayerVaults::getInstance()->getData()->saveContents($this->getHolder(), $this->getContents());
}
$this->holder->sendReplacement($who);
$this->holder->close();
}
}
}

0 comments on commit d57de98

Please sign in to comment.