Skip to content

Commit

Permalink
Effects clear on kit change (Infernus101#58)
Browse files Browse the repository at this point in the history
* effects clear on kit change

* added config

added toggle for effect clearing
  • Loading branch information
artulloss authored and Infernus101 committed Feb 21, 2018
1 parent 98b71fd commit a2c582a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ reset-on-logout: true
start-from-first: false
# Clears player inventory before adding the kit
clear-inventory: false
# Clears player effect(s) before adding the kit
clear-effect: false
# Text on sign for kit form (case-insensitive)
text-on-sign: "[KitUI]"
...
4 changes: 4 additions & 0 deletions src/Infernus101/KitUI/Kit.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ public function getName() : string{
public function add(Player $player){
$inv = $player->getInventory();
$arm = $player->getArmorInventory();

if($this->pl->config->get("clear-effect")){
$player->removeAllEffects();
}

if($this->pl->config->get("clear-inventory")){
$inv->clearAll();
Expand Down

0 comments on commit a2c582a

Please sign in to comment.