Wertzui123 / Rewards

A (daily) reward plugin for PocketMine-MP
GNU General Public License v3.0
15 stars 7 forks source link

Crash #23

Open NdaruAjaa opened 11 months ago

NdaruAjaa commented 11 months ago

THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: Rewards

Thread: Main Error: Wertzui123\Rewards\events\RewardClaimEvent::__construct(): Argument #2 ($commands) must be of type array, null given, called in phar:///home/container/plugins/Rewards.phar/src/Wertzui123/Rewards/commands/RewardCommand.php on line 49 File: plugins/Rewards.phar/src/Wertzui123/Rewards/events/RewardClaimEvent Line: 25 Type: TypeError Backtrace:

0 plugins/Rewards.phar/src/Wertzui123/Rewards/commands/RewardCommand(49): Wertzui123\Rewards\events\RewardClaimEvent->__construct(object pocketmine\player\Player#242312, null, int 1)

1 pmsrc/src/command/SimpleCommandMap(212): Wertzui123\Rewards\commands\RewardCommand->execute(object pocketmine\player\Player#242312, string[5] daily, array[0])

2 pmsrc/src/Server(1442): pocketmine\command\SimpleCommandMap->dispatch(object pocketmine\player\Player#242312, string[5] daily)

3 plugins/Slapper/src/slapper/Main(228): pocketmine\Server->dispatchCommand(object pocketmine\player\Player#242312, string[5] daily)

4 pmsrc/src/command/PluginCommand(46): slapper\Main->onCommand(object slapper\SlapperCommandSender#44106, object pocketmine\command\PluginCommand#61002, string[3] rca, array[1])

5 pmsrc/src/command/SimpleCommandMap(212): pocketmine\command\PluginCommand->execute(object slapper\SlapperCommandSender#44106, string[3] rca, array[2])

6 pmsrc/src/Server(1442): pocketmine\command\SimpleCommandMap->dispatch(object slapper\SlapperCommandSender#44106, string[20] rca "jvupiter" daily)

7 plugins/Slapper/src/slapper/Main(694): pocketmine\Server->dispatchCommand(object slapper\SlapperCommandSender#44106, string[20] rca "jvupiter" daily)

8 pmsrc/src/event/RegisteredListener(61): slapper\Main->onEntityDamage(object pocketmine\event\entity\EntityDamageByEntityEvent#90270)

9 pmsrc/src/event/Event(63): pocketmine\event\RegisteredListener->callEvent(object pocketmine\event\entity\EntityDamageByEntityEvent#90270)

Wertzui123 commented 11 months ago

Could you please send me the contents of your config after # The /reward command?

NdaruAjaa commented 11 months ago

Don't edit this if you don't know what you're doing

config-version: 5.0

In which data provider the user data should be stored. If you don't know what that means, don't edit this

data_storage: "JSON" # Providers: JSON, YAML

Multiple permission groups can be set up to allow certain players to get other rewards than normal players

If a player has the permission for multiple permission groups, the first group in the list will be their permission group

'default' is the default permission group

permission_groups:

Reward streaks are strikes when you claim your reward multiple times in a row

Strikes start at 1 when you claim your reward 2 times in the timespan of waiting_time * 3

E.g. when you have to wait 1 day, you can wait up to 48 hours after you claimed your reward to claim it again to start a streak

reward_streaks: true # false to disable this feature

The time how long the players have to wait before claiming their rewards again

The time is in seconds

86400 seconds is one day

Each permission group has its own waiting time

wait_time: default: 86400 vip: 86400 vip+: 86400

These are the commands which will be executed if the players get their rewards

The commands will be executed through the console

{player} is the player who claimed his reward, {asplayer} to run the command as the player

IMPORTANT: Use \" instead of normal quotes

Each permission group has its own commands

You can set up rewards for different streaks

The default strike is 0

Don't forget to set up 'max', which is the highest possible streak

A missing streak reward will be replaced with the max reward

commands: default: 1:

The /reward command

command: command: "daily" description: "Take daily rewards" usage: "/daily" aliases: [""] ...

Wertzui123 commented 11 months ago

Are you using the latest version for Rewards? I'm unable to reproduce your issue.

NdaruAjaa commented 11 months ago

Yes, I use the latest version of the rewards plugin

Wertzui123 commented 11 months ago

Which permission group is the player who caused the crash part of?

NdaruAjaa commented 11 months ago

I don't know, most likely I made a mistake in the config

Wertzui123 commented 11 months ago

Ok, I was actually able to reproduce it now. Try adding a space before the vip+ in the commands sections, so it looks like this:

commands:
 default:
  1:
   - "givemoney {player} 5000"
   - "key Daily 1 {player}"
  max:
   - "givemoney {player} 5000"
   - "key Daily 1 {player}"
 vip:
  1:
   - "givemoney {player} 10000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
  max:
   - "givemoney {player} 10000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
 vip+:
  1:
   - "givemoney {player} 15000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"
  max:
   - "givemoney {player} 15000"
   - "key Daily 1 {player}"
   - "key Money 1 {player}"