Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash when nonplayer entity "edit" area #299

Open
janiiik opened this issue Oct 16, 2020 · 1 comment
Open

Crash when nonplayer entity "edit" area #299

janiiik opened this issue Oct 16, 2020 · 1 comment

Comments

@janiiik
Copy link

janiiik commented Oct 16, 2020

hi, great plugin at first...

Now not sure if I get that correctly but looks like when non player entity like creeper explodes in Festival area , plugin will crash.
Is it possible to implement something to get around this?

PocketMine-MP Crash Dump Fri Oct 16 15:24:10 UTC 2020

Error: Argument 1 passed to genboy\Festival\Festival::canEdit() must be an instance of pocketmine\Player, instance of hmmhmmmm\boss\entity\walk\BossCreeper given, called in phar:///home/container/plugins/Festival_dev-119.phar/src/genboy/Festival/Festival.php on line 1924
File: plugins/Festival_dev-119.phar/src/genboy/Festival/Festival
Line: 1997
Type: TypeError

THIS CRASH WAS CAUSED BY A PLUGIN
BAD PLUGIN: Festival v2.1.2.1

Code:
[1988]
[1989] /** OUTBOUND ACTION /
[1990]
[1991]
[1992] /
* canEdit
[1993] * @param Player $player
[1994] * @param Position $position
[1995] * @return bool
[1996] */
[1997] public function canEdit(Player $player, Position $position) : bool{
[1998] if($player->hasPermission("festival") || $player->hasPermission("festival.access")){
[1999] return true;
[2000] }
[2001] $o = true;
[2002]
[2003] $e = ( ( isset($this->levels[strtolower($position->getLevel()->getName())]) && $this->levels[strtolower($position->getLevel()->getName())]->getOption("levelcontrol") != 'off') ? $this->levels[strtolower($position->getLevel()->getName())]->getFlag("edit") : $this->config["defaults"]["edit"]);
[2004] if($e){
[2005] $o = false;
[2006] }
[2007]

@genboy
Copy link
Owner

genboy commented Oct 21, 2020

@janiiik thank you for the full report. This might have to do with the registration of entities, there are problems with new registered entities like reported with mysterybox (issue #281).
The problem has to do with Festival not recognizing (the custom id of) the exploding entity.
Can you confirm this bosscreeper comes from the hmmhmmmm plugin? (link?)
Maybe i can learn from that what code is used to track custom entities with Festival.
Hope to help you enjoy Festival to the fullest, cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants