jasonw4331 / MyPlot

Plot and protection plugin for PocketMine-MP
https://discord.gg/Qqcpp9Q
MIT License
101 stars 89 forks source link

Fix crash when generating a new plots world. (#385) #386

Closed ghost closed 3 years ago

ghost commented 3 years ago

Introduction

Relevant issues

385 - Internal Server error when a player creates a new plot world. ReflectionProperty->getValue() requires 1 parameter, 0 were passed in EventListener at line 77. It says that the value can be null, but that was added in PHP 8.0

Changed lien 77 in EventListener from

$randomTickBlocks = $prop->getValue();

to

$randomTickBlocks = $prop->getValue($event->getLevel());

Changes

API changes

none

Behavioural changes

none

Backwards compatibility

none

Follow-up

none

Tests

Ran /plot generate myplots with no changes and crashed. When I changed the line I was able to generate the world successfully.