Infernus101/KitUI

Claim Unlimited Kits

Closed this issue · 2 comments

KitUI Issue

  • This issue isn't duplicated - you can check if it is by using the search bar located at the top left hand corner and select "Issues" on the left.
  • This issue includes appropriate markdown for sections - e.g. code blocks for crash dumps.
  • This issue is understandable in English.
    Claim Kits as many times as you want. Throws error each time.

Issue description

...
When you claim a kit everything seems to work fine except you can claim it over and over again. Each time it throws an error and ignores timer.

Reproducing the issue

  1. ...Claim kit with timer.
  2. ...Observe console error.
  3. ...Repeat.

Client information

PocketMine-MP Version: (insert commit hash here)
3.1.1
Kit-UI Version: (insert commit hash or version from plugin.yml here)
KitUI v1.3.0
MCPE Version: (insert game version here)
1.5
Plugin Version: (insert commit hash here)
KitUI v1.3.0
PHP version: 7.2

Optional information

...

26.07 03:26:47 [Server] Server thread/CRITICAL Could not pass event 'pocketmine\event\server\DataPacketReceiveEvent' to 'KitUI v1.3.0': Argument 1 passed to pocketmine\entity\EffectInstance::__construct() must be an instance of pocketmine\entity\Effect, null given, called in /plugins/KitUI/src/Infernus101/KitUI/Kit.php on line 129 on Infernus101\KitUI\PlayerEvents
26.07 03:26:47 [Server] Server thread/CRITICAL TypeError: "Argument 1 passed to pocketmine\entity\EffectInstance::__construct() must be an instance of pocketmine\entity\Effect, null given, called in /plugins/KitUI/src/Infernus101/KitUI/Kit.php on line 129" (EXCEPTION) in "src/pocketmine/entity/EffectInstance" at line 55

Config

---
Daily:
  # Format: "id:damage:count:name:ench_name:ench_level"

  # If you want only custom name (no enchantments): "id:damage:count:name"

  # If you don't want enchantments or custom name: "id:damage:count"

  # If you want only enchantments (no custom name): "id:damage:count:DEFAULT:ench_name:ench_level" -- you have to put DEFAULT in the name field

  # If you want more than one enchantment just do: "id:damage:count:name:ench1_name:ench1_level:ench2_name:ench2_level"
  # or "id:damage:count:DEFAULT:ench1_name:ench1_level:ench2_name:ench2_level" if you don't want a custom item name

  # Please note: You have to write numeric IDs
  items:
  - "364:0:32"
  - "267:0:1"
  - "302:0:1"
  - "303:0:1"
  - "304:0:1"
  - "305:0:1"

  commands: # {player} will get replaced by player's name
  - "givemoney {player} 1000"
  - "tell {player} §bDaily Kit Claimed! "


  cooldown:
    hours: 24
    minutes: 30

  # Format: "name:time:amplifier"
  # Time is in seconds
  effects:
  - ""

  # Add a cost for the kit. Compatible with EconomyAPI only
  # Put 0 if you want the kit to be free
  money: 0

  #Enter image url for the kit. png image. The image will be shown in kit main menu if its compatible.
  image-url: "http://eververse.net/wp-content/uploads/2017/11/Evercraft2TP.png"

  # Info to show when selected a Kit in UI form
  info: "§bClaim this kit once daily! Includes: §a$1,000, §6Chain Armor, Iron Sword, and §eBeef. §aTotal Estimated Value: $2,466.50."
Summer:
  # Format: "id:damage:count:name:ench_name:ench_level"

  # If you want only custom name (no enchantments): "id:damage:count:name"

  # If you don't want enchantments or custom name: "id:damage:count"

  # If you want only enchantments (no custom name): "id:damage:count:DEFAULT:ench_name:ench_level" -- you have  to put DEFAULT in the name field

  # If you want more than one enchantment just do: "id:damage:count:name:ench1_name:ench1_level:ench2_name:ench2_level"
  # or "id:damage:count:DEFAULT:ench1_name:ench1_level:ench2_name:ench2_level" if you don't want a custom item name

  # Please note: You have to write numeric IDs
  items:
  - "296:0:64"
  - "360:0:64"
  - "279:0:1:DEFAULT:unbreaking:3:fortune:3:efficiency:5"

  commands: # {player} will get replaced by player's name
  - "tell {player} §bSummer Kit §aClaimed!"


  cooldown:
    hours: 24
    minutes: 30

  # Format: "name:time:amplifier"
  # Time is in seconds
  effects:
  - ""

  # Add a cost for the kit. Compatible with EconomyAPI only
  # Put 0 if you want the kit to be free
  money: 0

  #Enter image url for the kit. png image. The image will be shown in kit main menu if its compatible.
  image-url: "http://eververse.net/wp-content/uploads/2018/03/sprout.png"

  # Info to show when selected a Kit in UI form
  info: "§bClaim this kit once daily during the Summer Season!§a Includes: 64 Wheat, 64 Melons, and a Summer Axe!§d Visit the Bonus Block at the Emporium to trade Wheat and Melons for money!"
...

...

Are you op on your server?

Yes, thank you. I fixed the timer issue with deop. I think this specific console log error I pasted was due to having an empty effects string in the kits.yml. In any case, all good now.