From 10348cfed9c2bccbb38bcbca4b4f499ca63e886d Mon Sep 17 00:00:00 2001 From: genboy Date: Sun, 30 Dec 2018 01:59:27 +0100 Subject: [PATCH 01/11] Translate fixed & new codesign --- plugin.yml | 2 +- src/genboy/Festival/Main.php | 29 +++++++++++++---------------- 2 files changed, 14 insertions(+), 17 deletions(-) diff --git a/plugin.yml b/plugin.yml index 3f3daf9..f3c2a31 100644 --- a/plugin.yml +++ b/plugin.yml @@ -3,7 +3,7 @@ author: Genboy version: 1.0.8-dev2 main: genboy\Festival\Main load: POSTWORLD -api: [3.0.0-ALPHA10,3.0.0-ALPHA11,3.0.0-ALPHA12,3.0.0] +api: [3.0.0] website: "https://github.com/genboy/Festival" commands: fe: diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index c54ff85..c426860 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1186,10 +1186,10 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $this->saveAreas(); $o = TextFormat::GREEN . Language::translate("cmd-id"). ' '.$cid.' edited'; }else{ - $o = TextFormat::RED .Language::translate("cmd-id"). ' '.$cid.' '. Language::tranlate("cannot-be-found") .' ( /fe command list)'; + $o = TextFormat::RED .Language::translate("cmd-id"). ' '.$cid.' '. Language::translate("cannot-be-found") .' ( /fe command list)'; } }else{ - $o = TextFormat::RED .Language::tranlate("cmd-specify-id-and-command-usage"); + $o = TextFormat::RED .Language::translate("cmd-specify-id-and-command-usage"); } break; @@ -1778,9 +1778,9 @@ public function canPVP(EntityDamageEvent $ev) : bool{ $player = $ev->getDamager(); if( $this->skippTime( 2, strtolower($player->getName()) ) ){ if( $god ){ - $this->areaMessage( Language::tranlate("all-players-are-god"), $player ); + $this->areaMessage( Language::translate("all-players-are-god"), $player ); }else{ - $this->areaMessage( Language::tranlate("no-pvp-area"), $player ); + $this->areaMessage( Language::translate("no-pvp-area"), $player ); } } } @@ -2720,18 +2720,15 @@ public function saveAreas() : void{ * makes it easy to find Festival console output fast */ public function codeSigned(){ - $this->getLogger()->info( " " ); - $this->getLogger()->info( " |~ " ); - $this->getLogger()->info( " .___---^^^ ^^^---___. " ); - $this->getLogger()->info( " ___|~__/_____________________\___|~__ " ); - $this->getLogger()->info( " /_______\ ._____. /_______\ " ); - $this->getLogger()->info( " / |\ / | F | \ |\ \ " ); - $this->getLogger()->info( "------------------'-----'-------------------" ); - $this->getLogger()->info( " ____ ___ _ |_| _ " ); - $this->getLogger()->info( " | __|| -_| ___ | |_ | | _ _ ___ | | " ); - $this->getLogger()->info( " | _| |___||_ -|| _ | | | | || .'|| | " ); - $this->getLogger()->info( " |_| |___||_| |_| \__/ |__,||_| " ); - $this->getLogger()->info( " GENBOY 2018 " ); + + + $this->getLogger()->info( "~~__.__~~" ); + $this->getLogger()->info( "..-/-\-.." ); + $this->getLogger()->info( "by-Genboy" ); + $this->getLogger()->info( "--__|~_--" ); + $this->getLogger()->info( "-/_____\-" ); + $this->getLogger()->info( "./..|\.\." ); + } } From 4fb6e920f80c0e627b34c24638db9e2e3bf5c4d9 Mon Sep 17 00:00:00 2001 From: genboy Date: Sun, 30 Dec 2018 23:28:27 +0100 Subject: [PATCH 02/11] fire replace block->level setblock air --- resources/en.json | 2 +- src/genboy/Festival/Main.php | 28 ++++++++++++++++++++++++++-- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/resources/en.json b/resources/en.json index f4a470d..23e1825 100644 --- a/resources/en.json +++ b/resources/en.json @@ -39,7 +39,7 @@ "area-list" : "Area list", "players-in-area": "players in area", "area-whitelist": "whitelist", - "area-no-commands": "no commands attachted", + "area-no-commands": "no commands attached", "player-has-been-whitelisted": "has been whitelisted in area", "player-allready-whitelisted": "is allready whitelisted in area", "player-has-been-unwhitelisted": "has been unwhitelisted from area", diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index c426860..c71fdc4 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1442,16 +1442,40 @@ public function onBlockUpdate( BlockUpdateEvent $event ): void{ // BlockUpdateEv // kill fire - or lava - flowing_lava 10, lava 11 , Bucket item id 325 $f = true; - $aid = $this->getServer()->getLevelByName( $levelname )->getBlockIdAt($block->x, $block->y + 1, $block->z); + $aid = $block->getLevel()->getBlockIdAt($block->x, $block->y + 1, $block->z); + if( $aid == 51 || $aid == 10 || $aid == 11 ){ // is fire/lava above if( !$this->canBurn( $position ) ){ // is fire not allowed? // Block::FIRE - $this->getServer()->getLevelByName( $levelname )->setBlockIdAt( $block->x, $block->y + 1, $block->z, 0); + $block->getLevel()->setBlock(new Vector3($block->x, $block->y + 1, $block->z), Block::get(0,0) ); // $block->getLevel()->setBlockIdAt( $block->x, $block->y + 1, $block->z, 0 ); //Block::AIR //$msg = TextFormat::RED . "Fire removed from " . $block->getName() . "(". $block->getID() . ") at [x=" . round($block->x) . " y=" . round($block->y) . " z=" . round($block->z) . "]"; //$this->getLogger()->info( $msg ); } } } + + /** onBlockBurn + * BlockBurnEvent + * @param BlockUpdateEvent $event + * @return void + + // Should check BlockBurnEvent .. + // https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/event/block/BlockBurnEvent.php + + public function onBlockBurn( BlockBurnEvent $event ): void { // BlockBurnEvent + + $block = $event->getBlock(); + $position = new Position($block->getFloorX(), $block->getFloorY(), $block->getFloorZ(), $block->getLevel()); + $levelname = $block->getLevel()->getName(); + + if( !$this->canBurn( $position ) ){ // is fire not allowed? // Block::FIRE + $event->setCancelled(); + } + + } + */ + + /* public function onPlayerBucketEvent( PlayerBucketEvent $event): void{ $block = $event->getBlockClicked(); From fd72552d1d342faa2210d68799fc59d3ef36d20b Mon Sep 17 00:00:00 2001 From: genboy Date: Wed, 16 Jan 2019 22:47:20 +0100 Subject: [PATCH 03/11] Fix inArea Player availabillity, player damage cause check order and nl translation --- resources/nl.json | 2 +- src/genboy/Festival/Main.php | 49 +++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 19 deletions(-) diff --git a/resources/nl.json b/resources/nl.json index af8e580..8b47c75 100644 --- a/resources/nl.json +++ b/resources/nl.json @@ -92,7 +92,7 @@ "set-to": "aangepast naar", "for-area": "voor gebied", - "all-players-are-god": "Alle spelers zajin in god-mode in dit gebied!", + "all-players-are-god": "Alle spelers hebben god-mode in dit gebied!", "no-pvp-area": "Dit is geen PVP area!", "no-flight-area": "Vliegen is hier niet toegstaan!", "flight-area": "Vliegen is hier toegestaand!", diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index c71fdc4..c61173d 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1265,11 +1265,33 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar */ public function onJoin(PlayerJoinEvent $event){ $player = $event->getPlayer(); + $playername = strtolower($player->getName()); $level = $player->getLevel(); // $this->getServer()->getDefaultLevel(); - $this->areaTitles[strtolower($player->getName())] = []; + + $this->areaTitles[$playername] = []; + $this->inArea[$playername] = []; $this->checkAreaTitles( $player, $level ); } + + + /** onQuit + * @param Event $event + * @return bool + */ + public function onQuit(PlayerQuitEvent $event){ + + $playerName = strtolower($event->getPlayer()->getName()); + $lvl = $event->getPlayer()->getLevel()->getName(); + unset($this->inArea[$playerName]); + + foreach($this->areas as $area){ + $this->hideAreaTitle( $event->getPlayer(), $event->getPlayer()->getPosition()->getLevel(), $area ); + } + unset( $this->areaTitles[$playerName] ); + + } + /** levelChange * change Area Titles for Player ( FloatingTextParticle ) * @param EntityLevelChangeEvent $event @@ -1583,22 +1605,6 @@ public function Hunger(PlayerExhaustEvent $event){ } - /** onQuit - * @param Event $event - * @return bool - */ - public function onQuit(PlayerQuitEvent $event){ - - $playerName = strtolower($event->getPlayer()->getName()); - $lvl = $event->getPlayer()->getLevel()->getName(); - unset($this->inArea[$playerName]); - - foreach($this->areas as $area){ - $this->hideAreaTitle( $event->getPlayer(), $event->getPlayer()->getPosition()->getLevel(), $area ); - } - unset( $this->areaTitles[$playerName] ); - - } /** OUTBOUND ACTION */ @@ -1820,13 +1826,20 @@ public function canDamage(EntityDamageEvent $ev) : bool{ if($ev->getEntity() instanceof Player){ $player = $ev->getEntity(); $playerName = strtolower($player->getName()); - if( !$this->canGetHurt( $player ) || !$this->canBurn( $player->getPosition() )){ + if( !$this->canGetHurt( $player ) ){ if( $player->isOnFire() ){ $player->extinguish(); // 1.0.7-dev } $ev->setCancelled(); return false; } + if( !$this->canBurn( $player->getPosition() )){ + if( $player->isOnFire() ){ + $player->extinguish(); // 1.0.7-dev + $ev->setCancelled(); + return false; + } + } if(!$this->canPVP($ev)){ // v 1.0.6-13 $ev->setCancelled(); return false; From b69d8f38c67a07651b58c8e9feeb7b4504f514fd Mon Sep 17 00:00:00 2001 From: genboy Date: Wed, 16 Jan 2019 23:33:29 +0100 Subject: [PATCH 04/11] info --- README.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index b774632..3d3f6eb 100644 --- a/README.md +++ b/README.md @@ -2,6 +2,9 @@ If you like Festival please share your experience to help Festival plugin improve, thank you! +Festival 1.8 functionalities will not extend further more. Important bug fixes will still be done untill Festival 2 is ready. +Fetival 2 is in development including FormUI for easy control, a new code structure and some of the flags will be completely rewritten. I probably dump the translations untill there is request for it. Just to let you know .. + ![Festival plugin logo large](https://genboy.net/wp-content/uploads/2018/02/festival_plugin_logo.png) @@ -10,7 +13,7 @@ Create a festival with this custom area events plugin for Pocketmine Server: ### Manage area's and run commmands attachted to area events. -![Festival creation & usage](https://genboy.net/wp-content/uploads/2018/11/festival_usage_1.0.8.png) +![Festival creation & usage](https://genboy.net/wp-content/uploads/2018/11/festival_usage_1.0.8.png) ###### Copyright [Genboy](https://genboy.net) 2018 From 2b3fe90db0a160ded2310263334a06257e5c8f8a Mon Sep 17 00:00:00 2001 From: genboy Date: Wed, 16 Jan 2019 23:34:57 +0100 Subject: [PATCH 05/11] *_] --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 3d3f6eb..7a2617a 100644 --- a/README.md +++ b/README.md @@ -3,7 +3,7 @@ If you like Festival please share your experience to help Festival plugin improve, thank you! Festival 1.8 functionalities will not extend further more. Important bug fixes will still be done untill Festival 2 is ready. -Fetival 2 is in development including FormUI for easy control, a new code structure and some of the flags will be completely rewritten. I probably dump the translations untill there is request for it. Just to let you know .. +Festival 2 is in development including FormUI for easy control, a new code structure and some of the flags will be completely rewritten. I probably dump the translations untill there is request for it. Just to let you know .. ![Festival plugin logo large](https://genboy.net/wp-content/uploads/2018/02/festival_plugin_logo.png) @@ -16,7 +16,7 @@ Create a festival with this custom area events plugin for Pocketmine Server: ![Festival creation & usage](https://genboy.net/wp-content/uploads/2018/11/festival_usage_1.0.8.png) -###### Copyright [Genboy](https://genboy.net) 2018 +###### Copyright [Genboy](https://genboy.net) 2018 --- From aaae227d21d01d4ede6c3d7e67d7c775c95802a6 Mon Sep 17 00:00:00 2001 From: genboy Date: Fri, 18 Jan 2019 22:49:57 +0100 Subject: [PATCH 06/11] aded inArea array playername var checks --- src/genboy/Festival/Main.php | 255 ++++++++++++++++++++--------------- 1 file changed, 146 insertions(+), 109 deletions(-) diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index c61173d..328d220 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1655,19 +1655,23 @@ public function canTouch(Player $player, Position $position) : bool{ if($t){ $o = false; } - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if($area->getFlag("touch")){ - $o = false; - } - if(!$area->getFlag("touch") && $t){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = true; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if($area->getFlag("touch")){ + $o = false; + } + if(!$area->getFlag("touch") && $t){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = true; + } } } + }else{ + $o = false; } return $o; } @@ -1723,19 +1727,23 @@ public function canGetHurt(Entity $entity) : bool{ $o = false; } $playername = strtolower($entity->getName()); - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[ $areaname ]; - if($area->getFlag("god")){ - $o = false; - } - if(!$area->getFlag("god") && $g ){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = false; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[ $areaname ]; + if($area->getFlag("god")){ + $o = false; + } + if(!$area->getFlag("god") && $g ){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = false; + } } } + }else{ + $o = false; } } return $o; @@ -1754,19 +1762,23 @@ public function hasFallDamage(Entity $entity) : bool{ $o = false; } $playername = strtolower($entity->getName()); - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if($area->getFlag("falldamage")){ - $o = false; - } - if(!$area->getFlag("falldamage") && $f){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = false; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if($area->getFlag("falldamage")){ + $o = false; + } + if(!$area->getFlag("falldamage") && $f){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = false; + } } } + }else{ + $o = false; } } return $o; @@ -1869,23 +1881,26 @@ public function checkPlayerFlying(Player $player){ if( $f ){ $fly = false; // flag default } - - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if( $area->getFlag("flight") && !$area->isWhitelisted( $playername ) ){ - $fly = false; // flag area - } - if(!$area->getFlag("flight") && $f){ - $fly = true; - } - if( !$area->getFlag("msg") ){ - $sendmsg = true; - } - if( $area->getFlag("falldamage") ){ - $falldamage = true; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if( $area->getFlag("flight") && !$area->isWhitelisted( $playername ) ){ + $fly = false; // flag area + } + if(!$area->getFlag("flight") && $f){ + $fly = true; + } + if( !$area->getFlag("msg") ){ + $sendmsg = true; + } + if( $area->getFlag("falldamage") ){ + $falldamage = true; + } } } + }else{ + $fly = false; // flag default } // ! if( $player->isOp() ){ if( $player->hasPermission("festival") || $player->hasPermission("festival.access") ){ @@ -2009,21 +2024,24 @@ public function canUseEffects( Player $player ) : bool{ $o = false; } - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if($area->getFlag("effects")){ - $o = false; - } - if(!$area->getFlag("effects") && $e){ - $o = true; - } - if( $area->isWhitelisted( $playername ) ){ - $o = true; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if($area->getFlag("effects")){ + $o = false; + } + if(!$area->getFlag("effects") && $e){ + $o = true; + } + if( $area->isWhitelisted( $playername ) ){ + $o = true; + } } } + }else{ + $o = false; } - return $o; } @@ -2042,19 +2060,24 @@ public function canDrop(Player $player, Position $position) : bool{ $o = false; } $playername = strtolower($player->getName()); - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if($area->getFlag("drop")){ - $o = false; - } - if(!$area->getFlag("drop") && $d){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = true; + + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if($area->getFlag("drop")){ + $o = false; + } + if(!$area->getFlag("drop") && $d){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = true; + } } } + }else{ + $o = false; } return $o; } @@ -2133,22 +2156,27 @@ public function canUseTNT(Player $player, Position $position) : bool{ $o = false; } $playername = strtolower($player->getName()); - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - //if( $area->contains( $position, $position->getLevel()->getName() ) ){} + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; - if($area->getFlag("tnt")){ - $o = false; - } - if(!$area->getFlag("tnt") && $d){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = true; + //if( $area->contains( $position, $position->getLevel()->getName() ) ){} + + if($area->getFlag("tnt")){ + $o = false; + } + if(!$area->getFlag("tnt") && $d){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = true; + } } } + }else{ + $o = false; } return $o; } @@ -2201,24 +2229,28 @@ public function canShoot( Player $player ) : bool{ $o = false; } - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if($area->getFlag("shoot")){ - $o = false; - } - if(!$area->getFlag("shoot") && $s){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = true; - } - if( $area->getFlag("msg") ){ - $m = false; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if($area->getFlag("shoot")){ + $o = false; + } + if(!$area->getFlag("shoot") && $s){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = true; + } + if( $area->getFlag("msg") ){ + $m = false; + } } } + }else{ + $o = false; + $m = true; } - if( $m && !$o ){ // 'ínline' message method $msg = TextFormat::RED . "NO Shooting here!"; $player->areaMessage( $msg ); @@ -2272,19 +2304,23 @@ public function canHunger( PlayerExhaustEvent $event ): bool{ if ($h) { $o = false; } - foreach($this->inArea[$playername] as $areaname){ - if( isset($this->areaList[ $areaname ]) ){ - $area = $this->areaList[$areaname]; - if ($area->getFlag("hunger")) { - $o = false; - } - if(!$area->getFlag("hunger") && $h){ - $o = true; - } - if($area->isWhitelisted($playername)){ - $o = false; + if( isset( $this->inArea[$playername] ) && is_array( $this->inArea[$playername] ) ){ + foreach($this->inArea[$playername] as $areaname){ + if( isset($this->areaList[ $areaname ]) ){ + $area = $this->areaList[$areaname]; + if ($area->getFlag("hunger")) { + $o = false; + } + if(!$area->getFlag("hunger") && $h){ + $o = true; + } + if($area->isWhitelisted($playername)){ + $o = false; + } } } + }else{ + $o = false; } return $o; } @@ -2377,6 +2413,7 @@ public function enterArea(Area $area, PlayerMoveEvent $ev): void{ } } $playerName = strtolower( $player->getName() ); + $this->inArea[$playerName][] = strtolower( $area->getName() ); // player area's // effects check From ca34db78451be32eb70c180bf6c337d8fa724eea Mon Sep 17 00:00:00 2001 From: genboy Date: Tue, 22 Jan 2019 20:32:16 +0100 Subject: [PATCH 07/11] MysterySkull by CubePM --- src/genboy/Festival/Main.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index 328d220..a78f7ee 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1946,6 +1946,8 @@ public function canEntitySpawn( Entity $e ): bool{ || $e instanceof ItemEntity || $e instanceof Projectile || $e instanceof FloatingTextParticle + + || $e instanceof MysterySkull // https://github.com/CubePM/MysteryBox/blob/master/src/mysterybox/entity/MysterySkull.php ){ return $o; // might be allowed to spawn under different flag } From e61cd346542a84a32d554993f95942fdc34424cc Mon Sep 17 00:00:00 2001 From: genboy Date: Wed, 23 Jan 2019 08:13:15 +0100 Subject: [PATCH 08/11] ?_* --- src/genboy/Festival/Main.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index a78f7ee..3eaa1eb 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1947,7 +1947,7 @@ public function canEntitySpawn( Entity $e ): bool{ || $e instanceof Projectile || $e instanceof FloatingTextParticle - || $e instanceof MysterySkull // https://github.com/CubePM/MysteryBox/blob/master/src/mysterybox/entity/MysterySkull.php + || $e instanceof mysterybox\entity\MysterySkull // https://github.com/CubePM/MysteryBox/blob/master/src/mysterybox/entity/MysterySkull.php ){ return $o; // might be allowed to spawn under different flag } From 7938011e0eab78d364224f3480b5aeaa625d1d11 Mon Sep 17 00:00:00 2001 From: genboy Date: Thu, 24 Jan 2019 22:56:57 +0100 Subject: [PATCH 09/11] add methods check for unknown entity spawn --- src/genboy/Festival/Main.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index 3eaa1eb..5b74638 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1947,17 +1947,17 @@ 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 instanceof mysterybox\entity\MysterySkull // https://github.com/CubePM/MysteryBox/blob/master/src/mysterybox/entity/MysterySkull.php ){ return $o; // might be allowed to spawn under different flag } $nm = ''; // - if( null !== $e->getName() ){ + if( method_exists($e,'getName') && null !== $e->getName() ){ $nm = $e instanceof Item ? $e->getItem()->getName() : $e->getName(); } $pos = false; - if( null !== $e->getPosition() ){ + if( method_exists($e,'getPosition') && null !== $e->getPosition() ){ $pos = $e->getPosition(); } From ec5eb2343813aa4109f968fd59e2683fc1314ac2 Mon Sep 17 00:00:00 2001 From: genboy Date: Tue, 5 Mar 2019 22:45:29 +0100 Subject: [PATCH 10/11] gmc flying allowed --- src/genboy/Festival/Main.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/genboy/Festival/Main.php b/src/genboy/Festival/Main.php index 5b74638..7a89eb6 100644 --- a/src/genboy/Festival/Main.php +++ b/src/genboy/Festival/Main.php @@ -1903,7 +1903,8 @@ public function checkPlayerFlying(Player $player){ $fly = false; // flag default } // ! if( $player->isOp() ){ - if( $player->hasPermission("festival") || $player->hasPermission("festival.access") ){ + // Survival Mode = 0, Creative Mode = 1, Adventure Mode = 2, Spectator Mode = 4 + if( $player->hasPermission("festival") || $player->hasPermission("festival.access") || $player->getGamemode() === 1 ){ $fly = true; $player->setAllowFlight(true); return $fly; From 74e00640e5b4591d9c5b45ae7948e81904189e5c Mon Sep 17 00:00:00 2001 From: genboy Date: Sat, 9 Mar 2019 14:14:58 +0100 Subject: [PATCH 11/11] info update v1.0.9 --- README.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 7a2617a..88037f8 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,9 @@ -## Festival -If you like Festival please share your experience to help Festival plugin improve, thank you! +## Festival -Festival 1.8 functionalities will not extend further more. Important bug fixes will still be done untill Festival 2 is ready. -Festival 2 is in development including FormUI for easy control, a new code structure and some of the flags will be completely rewritten. I probably dump the translations untill there is request for it. Just to let you know .. +If you like Festival please [vote](https://poggit.pmmp.io/p/Festival/1.0.9) and [share your experience](https://github.com/genboy/Festival/issues) to help Festival plugin improve, thank you! ![Festival plugin logo large](https://genboy.net/wp-content/uploads/2018/02/festival_plugin_logo.png) - - Create a festival with this custom area events plugin for Pocketmine Server: ### Manage area's and run commmands attachted to area events. @@ -21,6 +17,8 @@ Create a festival with this custom area events plugin for Pocketmine Server: --- ## Info +Festival 1.0.9 functionalities will not extend further more. Important bug fixes will still be done untill Festival 2 is ready. +Festival 2 is in [development](https://github.com/genboy/Festival/projects/2) including FormUI for easy control, a new code structure and some of the flags will be completely rewritten. I probably dump the translations untill there is request for it. Just to let you know .. # Festival @@ -424,6 +422,11 @@ Thank you - Area messages display in chat with config option Msgtype 'msg' - cmd flag: area event commands for ops or whitelisted players only + **Since v1.0.9** + - gmc flying allowed by default + - fix inArea Player availabillity + - fix player damage cause check + ------ @@ -431,5 +434,4 @@ Thank you The area code derives from the [iProctector plugin](https://github.com/LDX-MCPE/iProtector). All credits for the area creation and protection code go to the iProtector creator [LDX-MCPE](https://github.com/LDX-MCPE) and [other iProtector devs](https://github.com/LDX-MCPE/iProtector/network). -The Festival code is written and tested by Genboy and first released on 12 Feb 2018, first extendomg the area object with area events (enter and leave messages) and soon added functions and ingame commands to attach a commandstring to a area-event. Since v1.0.7 the area's and players can be protected with 12 flags, and trigger commands on areaEnter, areaCenter and areaLeave. - +The Festival code is written and tested by Genboy and first released on 12 Feb 2018, first extending the area object with area events (enter and leave messages) and soon added functions and ingame commands to attach a commandstring to a area-event. Since v1.0.7 the area's and players can be protected with 12 flags, and trigger commands on areaEnter, areaCenter and areaLeave. \ No newline at end of file