Skip to content

Commit

Permalink
Merge pull request #211 from genboy/test-entities
Browse files Browse the repository at this point in the history
Slapper entities persist
  • Loading branch information
genboy committed Jul 30, 2019
2 parents 58b92d0 + 86a8673 commit 400fc14
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/genboy/Festival/Festival.php
Expand Up @@ -2032,6 +2032,10 @@ public function canEntitySpawn( Entity $e ): bool{
|| $e instanceof Projectile
|| $e instanceof FloatingTextParticle
//|| $e instanceof mysterybox\entity\MysterySkull // https://github.com/CubePM/MysteryBox/blob/master/src/mysterybox/entity/MysterySkull.php

|| $e->getSaveId() === "Slapper" // https://forums.pmmp.io/threads/cleaning-entities.3759/
|| $e instanceof SlapperEntity // https://github.com/jojoe77777/Slapper

){
return $o; // might be allowed to spawn under different flag
}
Expand All @@ -2048,6 +2052,7 @@ public function canEntitySpawn( Entity $e ): bool{
if($pos && $nm != ''){
$animals =[ 'bat','chicken','cow', 'cat', 'chicken', 'fox', 'horse','donkey', 'mule', 'ocelot', 'parrot', 'fish', 'squit', 'pig','rabbit', 'panda', 'sheep', 'salmon','turtle', 'tropical_fish', 'cod', 'balloon', 'mooshroom', 'trader_llama', 'wolf', 'spider', 'cave_spider', 'dolphin', 'llama', 'polar_bear', 'pufferfish']; // passive <- wolf -> neutral
$thisarea = '';

if( in_array( strtolower($nm), $animals ) ){ // check animal flag

$a = ( ( isset($this->levels[strtolower($pos->getLevel()->getName())]) && $this->levels[strtolower($pos->getLevel()->getName())]->getOption("levelcontrol") != 'off') ? $this->levels[strtolower($pos->getLevel()->getName())]->getFlag("animals") : $this->config["defaults"]["animals"]);
Expand Down

0 comments on commit 400fc14

Please sign in to comment.