Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
v1.1.2 (#17)
Browse files Browse the repository at this point in the history
* v.1.1.2

* typo

* typo

* Update KitMainMenu.php

* More test kits for examples..
  • Loading branch information
Infernus101 committed Nov 2, 2017
1 parent 8a8c458 commit b5bc652
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 7 deletions.
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: KitUI
author: Infernus101
api: [3.0.0-ALPHA1, 3.0.0-ALPHA2, 3.0.0-ALPHA3, 3.0.0-ALPHA4, 3.0.0-ALPHA5, 3.0.0-ALPHA6, 3.0.0-ALPHA7, 3.0.0-ALPHA8, 3.0.0-ALPHA9]
main: Infernus101\KitUI\Main
version: 1.1.1
version: 1.1.2
permission: # kit permissions - kit.<kit name>
kit.command:
description: kit command!
Expand Down
49 changes: 48 additions & 1 deletion resources/kits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,51 @@ testkit:

# Info to show when selected a Kit in UI form
info: "This kit is too op XD Cost: 50$"
...
testkit2:

items:
- "260:0:10"
- "267:0:1:Sword Name:sharpness:3:knockback:1"
helmet: "302:0:1"
chestplate: "303:0:1:DEFAULT:protection:1"
leggings: "304:0:1:Leggings Name"
boots: "305:0:1"

commands:
- "tell {player} Kit 2 claimed!"

cooldown:
hours: 24
minutes: 30

effects:
- "speed:120:2"

money: 50

info: "This kit is too op XD Cost: 50$"

testkit3:

items:
- "260:0:10"
- "267:0:1:Sword Name:sharpness:3:knockback:1"
helmet: "302:0:1"
chestplate: "303:0:1:DEFAULT:protection:1"
leggings: "304:0:1:Leggings Name"
boots: "305:0:1"

commands:
- "tell {player} Kit 3 claimed!"

cooldown:
hours: 24
minutes: 30

effects:
- "speed:120:2"

money: 50

info: "This kit is too op XD Cost: 50$"
...
4 changes: 2 additions & 2 deletions src/Infernus101/KitUI/Kit.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ public function loadItem(int $id = 0, int $damage = 0, int $count = 1, string $n
$ench = CustomEnchants::getEnchantByName((string) $name_level);
}
}elseif($ench !== null){
if($this->ak->piggyEnchants !== null && $ench instanceof CustomEnchants){
$this->ak->piggyEnchants->addEnchantment($item, $ench->getName(), (int) $name_level);
if($this->pl->piggyEnchants !== null && $ench instanceof CustomEnchants){
$this->pl->piggyEnchants->addEnchantment($item, $ench->getName(), (int) $name_level);
}else{
$item->addEnchantment($ench->setLevel((int) $name_level));
}
Expand Down
7 changes: 4 additions & 3 deletions src/Infernus101/KitUI/Main.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Infernus101\KitUI\lang\LangManager;
use Infernus101\KitUI\tasks\CoolDownTask;
use pocketmine\Player;
use pocketmine\item\enchantment\Enchantment;
use pocketmine\Server;
use pocketmine\command\CommandSender;
use pocketmine\command\ConsoleCommandSender;
Expand Down Expand Up @@ -47,9 +48,9 @@ public function onEnable(){
Enchantment::registerEnchantment(new Enchantment(Enchantment::SHARPNESS, "%enchantment.sharpness", Enchantment::RARITY_COMMON, Enchantment::ACTIVATION_SELF, Enchantment::SLOT_NONE));
}
$this->piggyEnchants = $this->getServer()->getPluginManager()->getPlugin("PiggyCustomEnchants");
if ($customEnchants !== null) {
$this->getServer()->getLogger()->info(TextFormat::GREEN . "[KitUI] Using PiggyCustomEnchants!");
}
if($this->piggyEnchants !== null){
$this->getServer()->getLogger()->info(TextFormat::GREEN . "[KitUI] Using PiggyCustomEnchants!");
}
$allKits = yaml_parse_file($this->getDataFolder()."kits.yml");
foreach($allKits as $name => $data){
$this->kits[$name] = new Kit($this, $data, $name);
Expand Down
1 change: 1 addition & 0 deletions src/Infernus101/KitUI/UI/windows/KitMainMenu.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

class KitMainMenu extends Window {
public function process(): void {
parent::$id = array();
$title = $this->pl->language->getTranslation("mainmenu-title");
$content = $this->pl->language->getTranslation("mainmenu-content");
$this->data = [
Expand Down

0 comments on commit b5bc652

Please sign in to comment.