From a63259be16c4cf3bc3653310dbe53c37327a6c17 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:08:26 +1000 Subject: [PATCH 01/35] Update plugin.yml --- plugin.yml | 84 ++---------------------------------------------------- 1 file changed, 2 insertions(+), 82 deletions(-) diff --git a/plugin.yml b/plugin.yml index fa6a964..06b0b3b 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,7 +1,7 @@ name: essentialsTP main: essentialsTP\essentialsTP version: 1.2.2 -api: [3.0.0] +api: 5.0.0 extensions: [sqlite3] commands: home: @@ -60,84 +60,4 @@ commands: description: decline all active teleport requests. usage: "/tpdeny" permission: essentialstp.command.tpdeny -permissions: - essentialstp.*: - default: op - description: "Allows all essentialsTP commands" - children: - essentialstp.command.*: - description: "Allows player to use commands" - default: op - children: - essentialstp.command.tpdeny: - description: "Allows player to decline request" - default: true - essentialstp.command.tpaccept: - description: "Allows player to accept request" - default: true - essentialstp.command.tpahere: - description: "Allows player to teleport player to them" - default: true - essentialstp.command.tpa: - description: "Allows player to teleport to another player" - default: true - essentialstp.command.delwarp: - description: "Allows player to delete warps" - default: op - essentialstp.command.setwarp: - description: "Allows player to set warps" - default: op - essentialstp.command.warp: - description: "Allows player use warps" - default: true - essentialstp.command.setspawn: - description: "Allows player to set spawn for world" - default: op - essentialstp.command.spawn: - description: "Allows player use spawn command" - default: true - essentialstp.command.wild: - description: "Allows player to teleport to a random location in world" - default: true - essentialstp.command.back: - description: "Allows player go back to their last death location" - default: true - essentialstp.command.delhome: - description: "Allows player to delete their homes" - default: true - essentialstp.command.sethome: - description: "Allows player to set their homes" - default: true - essentialstp.command.home: - description: "Allows player to use the home command" - default: true - essentialstp.command.bedsethome: - description: "Allows player to set home with their bed" - default: true - essentialstp.command.sign.warp: - description: "Allows player to use warp signs" - default: true - essentialstp.command.sign.wild: - description: "Allows player to use wild signs" - default: op - essentialstp.command.sign.spawn: - description: "Allows player to use spawn signs" - default: true - essentialstp.command.sign.warp.create: - description: "Allows player to create warp signs" - default: op - essentialstp.command.sign.wild.create: - description: "Allows player to create wild signs" - default: op - essentialstp.command.sign.spawn.create: - description: "Allows player to create spawn signs" - default: op - essentialstp.command.sign.warp.break: - description: "Allows player to break warp signs" - default: op - essentialstp.command.sign.wild.break: - description: "Allows player to break wild signs" - default: op - essentialstp.command.sign.spawn.break: - description: "Allows player to break spawn signs" - default: op + From 1e0a89e66572daee9cf18f9ba3b5eb0bd3704e5e Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:09:39 +1000 Subject: [PATCH 02/35] Update essentialsTP.php --- src/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/essentialsTP/essentialsTP.php b/src/essentialsTP/essentialsTP.php index 018110d..6cb0fb6 100644 --- a/src/essentialsTP/essentialsTP.php +++ b/src/essentialsTP/essentialsTP.php @@ -71,7 +71,7 @@ public function fetchall(){ return $row; } - public function onLoad(){ + public function onLoad(): void{ } From 1d4eb0a51f3fd2e28b16e101e15d8ffb249d53e3 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:11:07 +1000 Subject: [PATCH 03/35] Update essentialsTP.php --- src/essentialsTP/essentialsTP.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/essentialsTP/essentialsTP.php b/src/essentialsTP/essentialsTP.php index 6cb0fb6..370cdb3 100644 --- a/src/essentialsTP/essentialsTP.php +++ b/src/essentialsTP/essentialsTP.php @@ -1343,7 +1343,7 @@ public function check_config(){ } - public function onEnable(){ + public function onEnable(): void{ $this->getLogger()->info(TextFormat::GREEN."essentialsTP+ loading..."); @mkdir($this->getDataFolder()); $this->check_config(); @@ -1368,7 +1368,7 @@ public function onEnable(){ $this->getServer()->getPluginManager()->registerEvents($this, $this); } - public function onDisable(){ + public function onDisable(): void{ if($this->prepare){ $this->prepare->close(); } From a1ecc79a5768322c15395d40dc8cbfeaa899639a Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 8 Jul 2023 19:19:08 +1000 Subject: [PATCH 04/35] Update plugin.yml --- plugin.yml | 82 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 81 insertions(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index 06b0b3b..b1bffa3 100644 --- a/plugin.yml +++ b/plugin.yml @@ -60,4 +60,84 @@ commands: description: decline all active teleport requests. usage: "/tpdeny" permission: essentialstp.command.tpdeny - +permissions: + essentialstp.*: + default: op + description: "Allows all essentialsTP commands" + children: + essentialstp.command.*: + description: "Allows player to use commands" + default: op + children: + essentialstp.command.tpdeny: + description: "Allows player to decline request" + default: true + essentialstp.command.tpaccept: + description: "Allows player to accept request" + default: true + essentialstp.command.tpahere: + description: "Allows player to teleport player to them" + default: true + essentialstp.command.tpa: + description: "Allows player to teleport to another player" + default: true + essentialstp.command.delwarp: + description: "Allows player to delete warps" + default: op + essentialstp.command.setwarp: + description: "Allows player to set warps" + default: op + essentialstp.command.warp: + description: "Allows player use warps" + default: true + essentialstp.command.setspawn: + description: "Allows player to set spawn for world" + default: op + essentialstp.command.spawn: + description: "Allows player use spawn command" + default: true + essentialstp.command.wild: + description: "Allows player to teleport to a random location in world" + default: true + essentialstp.command.back: + description: "Allows player go back to their last death location" + default: true + essentialstp.command.delhome: + description: "Allows player to delete their homes" + default: true + essentialstp.command.sethome: + description: "Allows player to set their homes" + default: true + essentialstp.command.home: + description: "Allows player to use the home command" + default: true + essentialstp.command.bedsethome: + description: "Allows player to set home with their bed" + default: true + essentialstp.command.sign.warp: + description: "Allows player to use warp signs" + default: true + essentialstp.command.sign.wild: + description: "Allows player to use wild signs" + default: op + essentialstp.command.sign.spawn: + description: "Allows player to use spawn signs" + default: true + essentialstp.command.sign.warp.create: + description: "Allows player to create warp signs" + default: op + essentialstp.command.sign.wild.create: + description: "Allows player to create wild signs" + default: op + essentialstp.command.sign.spawn.create: + description: "Allows player to create spawn signs" + default: op + essentialstp.command.sign.warp.break: + description: "Allows player to break warp signs" + default: op + essentialstp.command.sign.wild.break: + description: "Allows player to break wild signs" + default: op + essentialstp.command.sign.spawn.break: + description: "Allows player to break spawn signs" + default: op From 3810722ab04a565bf6837d28ae08a4b579f35a3c Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:16:12 +1000 Subject: [PATCH 05/35] Update plugin.yml --- plugin.yml | 56 ++++++++++++++++++++++++++---------------------------- 1 file changed, 27 insertions(+), 29 deletions(-) diff --git a/plugin.yml b/plugin.yml index b1bffa3..a4224e5 100644 --- a/plugin.yml +++ b/plugin.yml @@ -64,80 +64,78 @@ permissions: essentialstp.*: default: op description: "Allows all essentialsTP commands" - children: - essentialstp.command.*: - description: "Allows player to use commands" - default: op - children: - essentialstp.command.tpdeny: + essentialstp.command.*: + description: "Allows player to use commands" + default: op + essentialstp.command.tpdeny: description: "Allows player to decline request" default: true - essentialstp.command.tpaccept: + essentialstp.command.tpaccept: description: "Allows player to accept request" default: true - essentialstp.command.tpahere: + essentialstp.command.tpahere: description: "Allows player to teleport player to them" default: true - essentialstp.command.tpa: + essentialstp.command.tpa: description: "Allows player to teleport to another player" default: true - essentialstp.command.delwarp: + essentialstp.command.delwarp: description: "Allows player to delete warps" default: op - essentialstp.command.setwarp: + essentialstp.command.setwarp: description: "Allows player to set warps" default: op - essentialstp.command.warp: + essentialstp.command.warp: description: "Allows player use warps" default: true - essentialstp.command.setspawn: + essentialstp.command.setspawn: description: "Allows player to set spawn for world" default: op - essentialstp.command.spawn: + essentialstp.command.spawn: description: "Allows player use spawn command" default: true - essentialstp.command.wild: + essentialstp.command.wild: description: "Allows player to teleport to a random location in world" default: true - essentialstp.command.back: + essentialstp.command.back: description: "Allows player go back to their last death location" default: true - essentialstp.command.delhome: + essentialstp.command.delhome: description: "Allows player to delete their homes" default: true - essentialstp.command.sethome: + essentialstp.command.sethome: description: "Allows player to set their homes" default: true - essentialstp.command.home: + essentialstp.command.home: description: "Allows player to use the home command" default: true - essentialstp.command.bedsethome: + essentialstp.command.bedsethome: description: "Allows player to set home with their bed" default: true - essentialstp.command.sign.warp: + essentialstp.command.sign.warp: description: "Allows player to use warp signs" default: true - essentialstp.command.sign.wild: + essentialstp.command.sign.wild: description: "Allows player to use wild signs" default: op - essentialstp.command.sign.spawn: + essentialstp.command.sign.spawn: description: "Allows player to use spawn signs" default: true - essentialstp.command.sign.warp.create: + essentialstp.command.sign.warp.create: description: "Allows player to create warp signs" default: op - essentialstp.command.sign.wild.create: + essentialstp.command.sign.wild.create: description: "Allows player to create wild signs" default: op - essentialstp.command.sign.spawn.create: + essentialstp.command.sign.spawn.create: description: "Allows player to create spawn signs" default: op - essentialstp.command.sign.warp.break: + essentialstp.command.sign.warp.break: description: "Allows player to break warp signs" default: op - essentialstp.command.sign.wild.break: + essentialstp.command.sign.wild.break: description: "Allows player to break wild signs" default: op - essentialstp.command.sign.spawn.break: + essentialstp.command.sign.spawn.break: description: "Allows player to break spawn signs" default: op From 95baa829591365a895a3bb60da391444e393b4e3 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:16:26 +1000 Subject: [PATCH 06/35] Delete .poggit.yml --- .poggit.yml | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .poggit.yml diff --git a/.poggit.yml b/.poggit.yml deleted file mode 100644 index 62e772c..0000000 --- a/.poggit.yml +++ /dev/null @@ -1,8 +0,0 @@ ---- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/poggit-orphanage/essentialsTP -branches: -- master -projects: - essentialsTP: - path: "" - icon: essentialstp.png -... From 50795685cded8046a0ad8530e3533c1f2143cbde Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:17:37 +1000 Subject: [PATCH 07/35] Update and rename src/essentialsTP/essentialsTP.php to src/skyss0fly/essentialsTP/essentialsTP.php --- src/{ => skyss0fly}/essentialsTP/essentialsTP.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename src/{ => skyss0fly}/essentialsTP/essentialsTP.php (99%) diff --git a/src/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php similarity index 99% rename from src/essentialsTP/essentialsTP.php rename to src/skyss0fly/essentialsTP/essentialsTP.php index 370cdb3..424ee55 100644 --- a/src/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -5,7 +5,7 @@ * skype: advocaite */ -namespace essentialsTP; +namespace skyss0fly\essentialsTP; use pocketmine\command\Command; use pocketmine\command\CommandExecutor; @@ -17,9 +17,9 @@ use pocketmine\event\player\PlayerInteractEvent; use pocketmine\event\player\PlayerBedEnterEvent; use pocketmine\event\Listener; -use pocketmine\level\Position; +use pocketmine\world\Position; use pocketmine\math\Vector3; -use pocketmine\Player; +use pocketmine\player\Player; use pocketmine\plugin\PluginBase; use pocketmine\utils\TextFormat; use pocketmine\utils\Config; From 99c43f60d4add77d5cd8cce28e24c037290a6fe1 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:18:22 +1000 Subject: [PATCH 08/35] Update plugin.yml --- plugin.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugin.yml b/plugin.yml index a4224e5..6286ce0 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,8 +1,9 @@ name: essentialsTP -main: essentialsTP\essentialsTP -version: 1.2.2 +main: skyss0fly\essentialsTP\essentialsTP +version: 1.2.3 api: 5.0.0 extensions: [sqlite3] +author: skyss0fly commands: home: description: Teleports you home /home will list homes /home will teleport you. From 7d65cb5b3eaadae9b24dcf1e07cfbdc9e5cb0714 Mon Sep 17 00:00:00 2001 From: poggit-bot Date: Sat, 26 Aug 2023 21:20:03 +1000 Subject: [PATCH 09/35] Create .poggit.yml Poggit-CI is enabled for this repo by @skyss0fly Visit the Poggit-CI page for this repo at https://poggit.pmmp.io/ci/skyss0fly/essentialsTP --- .poggit.yml | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 .poggit.yml diff --git a/.poggit.yml b/.poggit.yml new file mode 100644 index 0000000..0eb9e92 --- /dev/null +++ b/.poggit.yml @@ -0,0 +1,9 @@ +--- # Poggit-CI Manifest. Open the CI at https://poggit.pmmp.io/ci/skyss0fly/essentialsTP +build-by-default: true +branches: +- master +projects: + essentialsTP: + path: "" + icon: "essentialstp.png" +... From 2f7e4f36c9c7ef4b2cd006eb4cf1bd0cb1004ca7 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sat, 26 Aug 2023 21:31:35 +1000 Subject: [PATCH 10/35] Major fix Replace level with world --- src/skyss0fly/essentialsTP/essentialsTP.php | 74 ++++++++++----------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 424ee55..ca994a6 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -148,7 +148,7 @@ public function onPlayerDeath(PlayerDeathEvent $event){ round($player->getX()), round($player->getY()), round($player->getZ()), - $player->getLevel() + $player->getWorld() ); } @@ -159,7 +159,7 @@ public function onPlayerSleep(PlayerBedEnterEvent $event){ if ($player->hasPermission("essentialstp.command.bedsethome")) { $this->player_cords = array('x' => (int) $player->getX(),'y' => (int) $player->getY(),'z' => (int) $player->getZ()); $this->username = $player->getName(); - $this->world = $player->getLevel()->getName(); + $this->world = $player->getWorld()->getName(); $this->home_loc = "bed"; $this->prepare = $this->db2->prepare("SELECT player,title,x,y,z,world FROM homes WHERE player = :name AND title = :title"); $this->prepare->bindValue(":name", $this->username, SQLITE3_TEXT); @@ -224,8 +224,8 @@ public function onBlockTap(PlayerInteractEvent $event) if( count($sql) > 0 ) { $sql = $sql[0]; if(isset($sql['world'])){ - if(Server::getInstance()->loadLevel($sql['world']) != false){ - $curr_world = Server::getInstance()->getLevelByName($sql['world']); + if(Server::getInstance()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $player->teleport($pos); $this->update_cooldown($player->getName(), time(), 'warp'); @@ -254,19 +254,19 @@ public function onBlockTap(PlayerInteractEvent $event) return true; } $event->setCancelled(true); - $this->world = $player->getLevel()->getName(); - foreach($this->getServer()->getLevels() as $aval_world => $curr_world) + $this->world = $player->getWorld()->getName(); + foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { if ($this->world == $curr_world->getName()) { - $pos = $player->getLevel()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); - $pos->getLevel()->loadChunk($pos->getX(),$pos->getZ()); - $pos->getLevel()->getChunk($pos->getX(),$pos->getZ(),true); - $pos = $pos->getLevel()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); + $pos = $player->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); + $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); + $pos->geWorld()->getChunk($pos->getX(),$pos->getZ(),true); + $pos = $pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); - if($pos->getLevel()->isChunkLoaded($pos->getX(),$pos->getZ())) + if($pos->getWorld()->isChunkLoaded($pos->getX(),$pos->getZ())) { - $player->teleport($pos->getLevel()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ()))); + $player->teleport($pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ()))); $player->sendMessage($this->config->get("Lang_teleport_wild")); return true; } @@ -298,7 +298,7 @@ public function onBlockTap(PlayerInteractEvent $event) $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($this->getServer()->getLevels() as $aval_world => $curr_world) + foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { @@ -336,7 +336,7 @@ public function onBlockBreak(BlockBreakEvent $event) $player = $event->getPlayer(); $block = $event->getBlock(); //check tile above is not sign as breaking it will break sign - $tile_above = $block->getLevel()->getTile(new Vector3($block->getFloorX(), ($block->getFloorY()+1), $block->getFloorZ())); + $tile_above = $block->getWorld()->getTile(new Vector3($block->getFloorX(), ($block->getFloorY()+1), $block->getFloorZ())); if($tile_above instanceof Sign) { $text = $tile_above->getText(); @@ -368,7 +368,7 @@ public function onBlockBreak(BlockBreakEvent $event) } //normal tile - $tile = $block->getLevel()->getTile(new Vector3($block->getFloorX(), $block->getFloorY(), $block->getFloorZ())); + $tile = $block->getWorld()->getTile(new Vector3($block->getFloorX(), $block->getFloorY(), $block->getFloorZ())); if ($tile instanceof Sign) { $text = $tile->getText(); @@ -454,7 +454,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ $sql = $this->fetchall(); if (count($sql) > 0){ $sql = $sql[0]; - foreach($player->getServer()->getLevels() as $aval_world => $curr_world) + foreach($player->getServer()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { @@ -467,14 +467,14 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ } else { - $this->world = $player->getLevel()->getName(); + $this->world = $player->getWorld()->getName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($player->getServer()->getLevels() as $aval_world => $curr_world) + foreach($player->getServer()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { @@ -489,7 +489,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ else { $player->sendMessage(TextFormat::RED.$this->config->get("Lang_no_spawn_set")); - $event->setRespawnPosition($player->getLevel()->getSpawnLocation()); + $event->setRespawnPosition($player->getWorld()->getSpawnLocation()); $this->update_cooldown($player->getName(), time(), 'spawn'); $player->sendMessage($this->config->get("Lang_teleport_spawn_original")); return true; @@ -557,8 +557,8 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - if(isset($sql['world']) && Server::getInstance()->loadLevel($sql['world']) != false){ - $curr_world = Server::getInstance()->getLevelByName($sql['world']); + if(isset($sql['world']) && Server::getInstance()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $sender->teleport($pos); $this->update_cooldown($this->username, time(), 'home'); @@ -599,7 +599,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar { $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); $this->username = $sender->getName(); - $this->world = $sender->getLevel()->getName(); + $this->world = $sender->getWorld()->getName(); $this->home_loc = $args[0]; $this->prepare = $this->db2->prepare("SELECT player,title,x,y,z,world FROM homes WHERE player = :name AND title = :title"); $this->prepare->bindValue(":name", $this->username, SQLITE3_TEXT); @@ -902,8 +902,8 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if(count($sql) > 0){ $sql = $sql[0]; if(isset($sql['world'])){ - if(Server::getInstance()->loadLevel($sql['world']) != false){ - $curr_world = Server::getInstance()->getLevelByName($sql['world']); + if(Server::getInstance()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $sender->sendMessage($this->config->get("Lang_warp_to") . " " . TextFormat::GOLD . $sql['title']); $sender->teleport($pos); @@ -948,7 +948,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if((count($args) != 0) && (count($args) < 2)) { $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); - $this->world = $sender->getLevel()->getName(); + $this->world = $sender->getWorld()->getName(); $this->warp_loc = $args[0]; $this->prepare = $this->db2->prepare("SELECT title,x,y,z,world FROM warps WHERE title = :title"); $this->prepare->bindValue(":title", $this->warp_loc, SQLITE3_TEXT); @@ -1041,15 +1041,15 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } if ($sender instanceof Player) { - $this->world = $sender->getLevel()->getName(); - foreach($this->getServer()->getLevels() as $aval_world => $curr_world) + $this->world = $sender->getWorld()->getName(); + foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { if ($this->world == $curr_world->getName()) { - $pos = $sender->getLevel()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); - $pos->getLevel()->loadChunk($pos->getX(),$pos->getZ()); - $pos->getLevel()->getChunk($pos->getX(),$pos->getZ(),true); - $pos = $pos->getLevel()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); + $pos = $sender->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); + $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); + $pos->getWorld()->getChunk($pos->getX(),$pos->getZ(),true); + $pos = $pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); //var_dump($pos); //var_dump($pos->getLevel()->isChunkGenerated($pos->getX(),$pos->getZ())); @@ -1057,9 +1057,9 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar //var_dump($pos->getLevel()->isChunkPopulated($pos->getX(),$pos->getZ())); //$sender->getLevel()->loadChunk($pos->getX(),$pos->getZ()); - if($pos->getLevel()->isChunkLoaded($pos->getX(),$pos->getZ())) + if($pos->getWorld()->isChunkLoaded($pos->getX(),$pos->getZ())) { - $sender->teleport($pos->getLevel()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ()))); + $sender->teleport($pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ()))); $sender->sendMessage($this->config->get("Lang_teleport_wild")); return true; } @@ -1115,14 +1115,14 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $this->result = $this->prepare->execute(); $cool_sql = $this->fetchall(); if (count($cool_sql) > 0){ - $this->world = $sender->getLevel()->getName(); + $this->world = $sender->getWorld()->getName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($this->getServer()->getLevels() as $aval_world => $curr_world) + foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { @@ -1139,7 +1139,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar else { $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_no_spawn_set")); - $sender->teleport($sender->getLevel()->getSpawnLocation()); + $sender->teleport($sender->getWorld()->getSpawnLocation()); $this->update_cooldown($sender->getName(), time(), 'spawn'); $sender->sendMessage($this->config->get("Lang_teleport_spawn_original")); return true; @@ -1167,7 +1167,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if(count($args) == 0) { $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); - $this->world = $sender->getLevel()->getName(); + $this->world = $sender->getWorld()->getName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); From 49d5b934ea2b056e2109c907162b5b99b6485ec3 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 08:20:39 +1000 Subject: [PATCH 11/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index ca994a6..10a6d48 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -1,9 +1,4 @@ prepare->bindValue(":time", time(), SQLITE3_INTEGER); $this->result = $this->prepare->execute(); return true; - break; + // break; case 'warp': $this->prepare = $this->db2->prepare("UPDATE cooldowns SET warp = :time WHERE player = :name"); $this->prepare->bindValue(":name", $name, SQLITE3_TEXT); $this->prepare->bindValue(":time", time(), SQLITE3_INTEGER); $this->result = $this->prepare->execute(); return true; - break; + // break; case 'spawn': $this->prepare = $this->db2->prepare("UPDATE cooldowns SET spawn = :time WHERE player = :name"); $this->prepare->bindValue(":name", $name, SQLITE3_TEXT); $this->prepare->bindValue(":time", time(), SQLITE3_INTEGER); $this->result = $this->prepare->execute(); return true; - break; + // break; default: return false; } @@ -119,7 +114,7 @@ public function update_cooldown($name, $time, $type){ $this->result = $this->prepare->execute(); return true; - break; + // break; case 'warp': $this->prepare = $this->db2->prepare("INSERT INTO cooldowns (home, warp, spawn, player) VALUES (0, :time, 0, :name)"); $this->prepare->bindValue(":time", time(), SQLITE3_INTEGER); @@ -127,7 +122,7 @@ public function update_cooldown($name, $time, $type){ $this->result = $this->prepare->execute(); return true; - break; + // break; case 'spawn': $this->prepare = $this->db2->prepare("INSERT INTO cooldowns (home, warp, spawn, player) VALUES (0, 0, :time, :name)"); $this->prepare->bindValue(":time", time(), SQLITE3_INTEGER); @@ -135,7 +130,7 @@ public function update_cooldown($name, $time, $type){ $this->result = $this->prepare->execute(); return true; - break; + // break; default: return false; } From e86abf4d43d1c4c88c6b0a78f3be865d95addaf1 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 08:32:13 +1000 Subject: [PATCH 12/35] Update essentialsTP.php Player pos fix --- src/skyss0fly/essentialsTP/essentialsTP.php | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 10a6d48..ab05bbf 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -140,9 +140,10 @@ public function update_cooldown($name, $time, $type){ public function onPlayerDeath(PlayerDeathEvent $event){ $player = $event->getEntity(); $this->death_loc[$player->getName()] = new Position( - round($player->getX()), - round($player->getY()), - round($player->getZ()), + + round($player->getPosition()->getX()), + round($player->getPosition()->getY()), + round($player->getPosition()->getZ()), $player->getWorld() ); } @@ -152,7 +153,7 @@ public function onPlayerSleep(PlayerBedEnterEvent $event){ { $player = $event->getPlayer(); if ($player->hasPermission("essentialstp.command.bedsethome")) { - $this->player_cords = array('x' => (int) $player->getX(),'y' => (int) $player->getY(),'z' => (int) $player->getZ()); + $this->player_cords = array('x' => (int) $player->getPosition()->getX(),'y' => (int) $player->getPosition()->getY(),'z' => (int) $player->getPosition()->getZ()); $this->username = $player->getName(); $this->world = $player->getWorld()->getName(); $this->home_loc = "bed"; @@ -942,7 +943,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if((count($args) != 0) && (count($args) < 2)) { - $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); + $this->player_cords = array('x' => (int) $sender->getPosition()->getX(),'y' => (int) $sender->getPosition()->getY(),'z' => (int) $sender->getPosition()->getZ()); $this->world = $sender->getWorld()->getName(); $this->warp_loc = $args[0]; $this->prepare = $this->db2->prepare("SELECT title,x,y,z,world FROM warps WHERE title = :title"); @@ -1321,7 +1322,7 @@ public function check_config(){ } if($this->config->get("MOTD") == false) { - $this->config->set("MOTD", "EssintialsTP+ Welcomes you please change this motd in config"); + $this->config->set("MOTD", "EssentialsTP+ Welcomes you please change this motd in config"); $this->config->save(); } if($this->config->get("wild-MaxX") == false) From 9b3257a1fe81a08f8adb5ea95406f410aeb9c328 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 08:38:53 +1000 Subject: [PATCH 13/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index ab05bbf..ff18c2b 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -13,6 +13,7 @@ use pocketmine\event\player\PlayerBedEnterEvent; use pocketmine\event\Listener; use pocketmine\world\Position; +use pocketmine\world\World; use pocketmine\math\Vector3; use pocketmine\player\Player; use pocketmine\plugin\PluginBase; From f1b14c20d8670360ea5a530f8a164a6ea61598c4 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 08:49:40 +1000 Subject: [PATCH 14/35] Major fix --- src/skyss0fly/essentialsTP/essentialsTP.php | 26 ++++++++++----------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index ff18c2b..b65433b 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -156,7 +156,7 @@ public function onPlayerSleep(PlayerBedEnterEvent $event){ if ($player->hasPermission("essentialstp.command.bedsethome")) { $this->player_cords = array('x' => (int) $player->getPosition()->getX(),'y' => (int) $player->getPosition()->getY(),'z' => (int) $player->getPosition()->getZ()); $this->username = $player->getName(); - $this->world = $player->getWorld()->getName(); + $this->world = $player->getWorld()->getFolderName(); $this->home_loc = "bed"; $this->prepare = $this->db2->prepare("SELECT player,title,x,y,z,world FROM homes WHERE player = :name AND title = :title"); $this->prepare->bindValue(":name", $this->username, SQLITE3_TEXT); @@ -251,7 +251,7 @@ public function onBlockTap(PlayerInteractEvent $event) return true; } $event->setCancelled(true); - $this->world = $player->getWorld()->getName(); + $this->world = $player->getWorld()->getFolderName(); foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { if ($this->world == $curr_world->getName()) @@ -288,7 +288,7 @@ public function onBlockTap(PlayerInteractEvent $event) $this->result = $this->prepare->execute(); $cool_sql = $this->fetchall(); if (count($cool_sql) > 0){ - $this->world = $player->getLevel()->getName(); + $this->world = $player->getWorld()->getFolderName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); @@ -464,7 +464,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ } else { - $this->world = $player->getWorld()->getName(); + $this->world = $player->getWorld()->getFolderName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); @@ -594,9 +594,9 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } if((count($args) != 0) && (count($args) < 2)) { - $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); + $this->player_cords = array('x' => (int) $sender->getPosition()->getX(),'y' => (int) $sender->getPosition()->getY(),'z' => (int) $sender->getPosition()->getZ()); $this->username = $sender->getName(); - $this->world = $sender->getWorld()->getName(); + $this->world = $sender->getWorld()->getFolderName(); $this->home_loc = $args[0]; $this->prepare = $this->db2->prepare("SELECT player,title,x,y,z,world FROM homes WHERE player = :name AND title = :title"); $this->prepare->bindValue(":name", $this->username, SQLITE3_TEXT); @@ -945,7 +945,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if((count($args) != 0) && (count($args) < 2)) { $this->player_cords = array('x' => (int) $sender->getPosition()->getX(),'y' => (int) $sender->getPosition()->getY(),'z' => (int) $sender->getPosition()->getZ()); - $this->world = $sender->getWorld()->getName(); + $this->world = $sender->getWorld()->getFolderName(); $this->warp_loc = $args[0]; $this->prepare = $this->db2->prepare("SELECT title,x,y,z,world FROM warps WHERE title = :title"); $this->prepare->bindValue(":title", $this->warp_loc, SQLITE3_TEXT); @@ -1038,10 +1038,10 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } if ($sender instanceof Player) { - $this->world = $sender->getWorld()->getName(); + $this->world = $sender->getWorld()->getFolderName(); foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { - if ($this->world == $curr_world->getName()) + if ($this->world == $curr_world->getFolderName()) { $pos = $sender->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); @@ -1112,7 +1112,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $this->result = $this->prepare->execute(); $cool_sql = $this->fetchall(); if (count($cool_sql) > 0){ - $this->world = $sender->getWorld()->getName(); + $this->world = $sender->getWorld()->getFolderName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); @@ -1121,7 +1121,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sql = $sql[0]; foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { - if ($sql['world'] == $curr_world->getName()) + if ($sql['world'] == $curr_world->getFolderName()) { $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); @@ -1163,8 +1163,8 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar { if(count($args) == 0) { - $this->player_cords = array('x' => (int) $sender->getX(),'y' => (int) $sender->getY(),'z' => (int) $sender->getZ()); - $this->world = $sender->getWorld()->getName(); + $this->player_cords = array('x' => (int) $sender->getPosition()->getX(),'y' => (int) $sender->getPosition()->getY(),'z' => (int) $sender->getPosition()->getZ()); + $this->world = $sender->getWorld()->getFolderName(); $this->prepare = $this->db2->prepare("SELECT x,y,z,world FROM spawns WHERE world = :world"); $this->prepare->bindValue(":world", $this->world, SQLITE3_TEXT); $this->result = $this->prepare->execute(); From 8b6cab7d93782658368ecc81b91254e4360956ee Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:05:19 +1000 Subject: [PATCH 15/35] Update essentialsTP.php Fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index b65433b..4226c57 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -196,7 +196,7 @@ public function onBlockTap(PlayerInteractEvent $event) if ($event->isCancelled()) return true; $player = $event->getPlayer(); $block = $event->getBlock(); - $tile = $block->getLevel()->getTile(new Vector3($block->getFloorX(), $block->getFloorY(), $block->getFloorZ())); + $tile = $block->getLevel()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); if($tile instanceof Sign) { $text = $tile->getText(); @@ -333,7 +333,7 @@ public function onBlockBreak(BlockBreakEvent $event) $player = $event->getPlayer(); $block = $event->getBlock(); //check tile above is not sign as breaking it will break sign - $tile_above = $block->getWorld()->getTile(new Vector3($block->getFloorX(), ($block->getFloorY()+1), $block->getFloorZ())); + $tile_above = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), ($block->getPosition()->getFloorY()+1), $block->getPosition()->getFloorZ())); if($tile_above instanceof Sign) { $text = $tile_above->getText(); @@ -365,7 +365,7 @@ public function onBlockBreak(BlockBreakEvent $event) } //normal tile - $tile = $block->getWorld()->getTile(new Vector3($block->getFloorX(), $block->getFloorY(), $block->getFloorZ())); + $tile = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); if ($tile instanceof Sign) { $text = $tile->getText(); From be83fc22bec8cf733a213b7a7ca19155ede7d93b Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:05:49 +1000 Subject: [PATCH 16/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 4226c57..1d5b4a2 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -19,7 +19,7 @@ use pocketmine\plugin\PluginBase; use pocketmine\utils\TextFormat; use pocketmine\utils\Config; -use pocketmine\tile\Sign; +use pocketmine\block\tile\Sign; use pocketmine\event\block\SignChangeEvent; use pocketmine\Server; From e07529eebf309a703d064efe49ffebc0bc861029 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:11:52 +1000 Subject: [PATCH 17/35] Update essentialsTP.php Fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 1d5b4a2..eed39f0 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -196,7 +196,7 @@ public function onBlockTap(PlayerInteractEvent $event) if ($event->isCancelled()) return true; $player = $event->getPlayer(); $block = $event->getBlock(); - $tile = $block->getLevel()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); + $tile = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); if($tile instanceof Sign) { $text = $tile->getText(); From 6081b9801289fb78149c47db07898b7e5c78a614 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:12:55 +1000 Subject: [PATCH 18/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index eed39f0..999a7e7 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -196,7 +196,7 @@ public function onBlockTap(PlayerInteractEvent $event) if ($event->isCancelled()) return true; $player = $event->getPlayer(); $block = $event->getBlock(); - $tile = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); + $tile = $block->getPosition()->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); if($tile instanceof Sign) { $text = $tile->getText(); From c5d0b1468401b5dba76324b3b6dc23d787473ce5 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:23:57 +1000 Subject: [PATCH 19/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 999a7e7..23ba332 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -221,8 +221,8 @@ public function onBlockTap(PlayerInteractEvent $event) if( count($sql) > 0 ) { $sql = $sql[0]; if(isset($sql['world'])){ - if(Server::getInstance()->loadWorld($sql['world']) != false){ - $curr_world = Server::getInstance()->getWorldByName($sql['world']); + if(Server::getInstance()->getWorldManager()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldManager()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $player->teleport($pos); $this->update_cooldown($player->getName(), time(), 'warp'); @@ -250,7 +250,7 @@ public function onBlockTap(PlayerInteractEvent $event) $event->setCancelled(true); return true; } - $event->setCancelled(true); + $event->cancel(true); $this->world = $player->getWorld()->getFolderName(); foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) { From 96db4c38f457d3f380df6026d64c9207a48d96d9 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:27:12 +1000 Subject: [PATCH 20/35] More fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 23ba332..c5b81be 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -203,10 +203,10 @@ public function onBlockTap(PlayerInteractEvent $event) if(strtolower($text[0]) === "[warp]"){ if (!$player->hasPermission("essentialstp.command.sign.warp")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } - $event->setCancelled(true); + $event->cancel(); $this->prepare = $this->db2->prepare("SELECT home,warp,spawn,player FROM cooldowns WHERE player =:name AND warp < :time"); $this->prepare->bindValue(":name", $player->getName(), SQLITE3_TEXT); $this->prepare->bindValue(":time", ( time() - $this->config->get("tp-warp-cooldown")), SQLITE3_TEXT); @@ -247,18 +247,18 @@ public function onBlockTap(PlayerInteractEvent $event) }elseif((strtolower($text[0]) === "[wild]")){ if (!$player->hasPermission("essentialstp.command.sign.wild")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } - $event->cancel(true); + $event->cancel(); $this->world = $player->getWorld()->getFolderName(); - foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($this->world == $curr_world->getName()) { $pos = $player->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); - $pos->geWorld()->getChunk($pos->getX(),$pos->getZ(),true); + $pos->getWorld()->getChunk($pos->getX(),$pos->getZ(),true); $pos = $pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); if($pos->getWorld()->isChunkLoaded($pos->getX(),$pos->getZ())) @@ -278,10 +278,10 @@ public function onBlockTap(PlayerInteractEvent $event) }elseif(strtolower($text[0]) === "[spawn]"){ if (!$player->hasPermission("essentialstp.command.sign.spawn")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } - $event->setCancelled(true); + $event->cancel(); $this->prepare = $this->db2->prepare("SELECT home,warp,spawn,player FROM cooldowns WHERE player =:name AND spawn < :time"); $this->prepare->bindValue(":name", $player->getName(), SQLITE3_TEXT); $this->prepare->bindValue(":time", ( time() - $this->config->get("tp-spawn-cooldown")), SQLITE3_TEXT); @@ -295,7 +295,7 @@ public function onBlockTap(PlayerInteractEvent $event) $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { From 8812673b0bae01b94910d8401cad140778f35348 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:32:29 +1000 Subject: [PATCH 21/35] Even more fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 24 ++++++++++----------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index c5b81be..45c3222 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -254,11 +254,11 @@ public function onBlockTap(PlayerInteractEvent $event) $this->world = $player->getWorld()->getFolderName(); foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { - if ($this->world == $curr_world->getName()) + if ($this->world == $curr_world->getFolderName()) { $pos = $player->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); - $pos->getWorld()->getChunk($pos->getX(),$pos->getZ(),true); + $pos->getWorld()->getChunk($pos->getX(),$pos->getZ()); $pos = $pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); if($pos->getWorld()->isChunkLoaded($pos->getX(),$pos->getZ())) @@ -297,7 +297,7 @@ public function onBlockTap(PlayerInteractEvent $event) $sql = $sql[0]; foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { - if ($sql['world'] == $curr_world->getName()) + if ($sql['world'] == $curr_world->getFolderName()) { $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); @@ -312,7 +312,7 @@ public function onBlockTap(PlayerInteractEvent $event) else { $player->sendMessage(TextFormat::RED.$this->config->get("Lang_no_spawn_set")); - $player->teleport($player->getLevel()->getSpawnLocation()); + $player->teleport($player->getWorld()->getSpawnLocation()); $this->update_cooldown($player->getName(), time(), 'spawn'); $player->sendMessage($this->config->get("Lang_teleport_spawn_original")); return true; @@ -333,14 +333,14 @@ public function onBlockBreak(BlockBreakEvent $event) $player = $event->getPlayer(); $block = $event->getBlock(); //check tile above is not sign as breaking it will break sign - $tile_above = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), ($block->getPosition()->getFloorY()+1), $block->getPosition()->getFloorZ())); + $tile_above = $block->getPosition()->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), ($block->getPosition()->getFloorY()+1), $block->getPosition()->getFloorZ())); if($tile_above instanceof Sign) { $text = $tile_above->getText(); if(strtolower($text[0]) === "[warp]"){ if (!$player->hasPermission("essentialstp.command.sign.warp.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ return true; @@ -348,7 +348,7 @@ public function onBlockBreak(BlockBreakEvent $event) }elseif (strtolower($text[0]) === "[wild]"){ if (!$player->hasPermission("essentialstp.command.sign.wild.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ return true; @@ -356,7 +356,7 @@ public function onBlockBreak(BlockBreakEvent $event) }elseif (strtolower($text[0]) === "[spawn]"){ if (!$player->hasPermission("essentialstp.command.sign.spawn.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ return true; @@ -365,14 +365,14 @@ public function onBlockBreak(BlockBreakEvent $event) } //normal tile - $tile = $block->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); + $tile = $block->getPosition()->getWorld()->getTile(new Vector3($block->getPosition()->getFloorX(), $block->getPosition()->getFloorY(), $block->getPosition()->getFloorZ())); if ($tile instanceof Sign) { $text = $tile->getText(); if (strtolower($text[0]) === "[warp]") { if (!$player->hasPermission("essentialstp.command.sign.warp.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } else { return true; @@ -380,7 +380,7 @@ public function onBlockBreak(BlockBreakEvent $event) } elseif (strtolower($text[0]) === "[wild]") { if (!$player->hasPermission("essentialstp.command.sign.wild.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } else { return true; @@ -388,7 +388,7 @@ public function onBlockBreak(BlockBreakEvent $event) } elseif (strtolower($text[0]) === "[spawn]") { if (!$player->hasPermission("essentialstp.command.sign.spawn.break")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; } else { return true; From ef54f9ccef8393ffaf1eacb6dfc8ff8dc54e9aa8 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:41:34 +1000 Subject: [PATCH 22/35] Bunch more fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 45c3222..ba229e2 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -404,14 +404,14 @@ public function onSignChange(SignChangeEvent $event) if ($event->isCancelled()) return true; $player = $event->getPlayer(); - if(strtolower($event->getLine(0)) === "[warp]"){ + if(strtolower($event->getNewText()->getLine(0)) === "[warp]"){ if (!$player->hasPermission("essentialstp.command.sign.warp.create")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ // lets check warp exist first if not don't allow change - $this->warp_loc = $event->getLine(1); + $this->warp_loc = $event->getNewText()->getLine(1); $this->prepare = $this->db2->prepare("SELECT title,x,y,z,world FROM warps WHERE title = :title"); $this->prepare->bindValue(":title", $this->warp_loc, SQLITE3_TEXT); $this->result = $this->prepare->execute(); @@ -421,18 +421,18 @@ public function onSignChange(SignChangeEvent $event) } return true; } - }elseif(strtolower($event->getLine(0)) === "[wild]"){ + }elseif(strtolower($event->getNewText()->getLine(0)) === "[wild]"){ if (!$player->hasPermission("essentialstp.command.sign.wild.create")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ return true; } - }elseif(strtolower($event->getLine(0)) === "[spawn]"){ + }elseif(strtolower($event->getNewText()->getLine(0)) === "[spawn]"){ if (!$player->hasPermission("essentialstp.command.sign.spawn.create")) { $player->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); - $event->setCancelled(true); + $event->cancel(); return true; }else{ return true; @@ -451,7 +451,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ $sql = $this->fetchall(); if (count($sql) > 0){ $sql = $sql[0]; - foreach($player->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($player->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { @@ -471,7 +471,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($player->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($player->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getName()) { From 453d2c8b506b4c826e40e652046d751454b5627f Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:44:57 +1000 Subject: [PATCH 23/35] More fixes --- src/skyss0fly/essentialsTP/essentialsTP.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index ba229e2..14809aa 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -453,7 +453,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ $sql = $sql[0]; foreach($player->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { - if ($sql['world'] == $curr_world->getName()) + if ($sql['world'] == $curr_world->getFolderName()) { $event->setRespawnPosition(new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world)); $this->update_cooldown($this->username, time(), 'home'); @@ -473,7 +473,7 @@ public function onPlayerRespawn(PlayerRespawnEvent $event){ $sql = $sql[0]; foreach($player->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { - if ($sql['world'] == $curr_world->getName()) + if ($sql['world'] == $curr_world->getFolderName()) { $event->setRespawnPosition(new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world)); $this->update_cooldown($player->getName(), time(), 'spawn'); @@ -554,8 +554,8 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - if(isset($sql['world']) && Server::getInstance()->loadWorld($sql['world']) != false){ - $curr_world = Server::getInstance()->getWorldByName($sql['world']); + if(isset($sql['world']) && Server::getInstance()->getWorldManager()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldManager()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $sender->teleport($pos); $this->update_cooldown($this->username, time(), 'home'); From aef32c58266e2488e66b6bccf0e27ec78b1e74d1 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:49:24 +1000 Subject: [PATCH 24/35] Linting time is fun --- src/skyss0fly/essentialsTP/essentialsTP.php | 34 ++++++++++----------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 14809aa..65c854b 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -509,7 +509,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar case 'motd': $sender->sendMessage(TextFormat::GOLD.'[MOTD] '.TextFormat::WHITE.$this->config->get("MOTD")); return true; - break; + // break; case 'home': if ($sender instanceof Player) { @@ -584,7 +584,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'sethome': if ($sender instanceof Player) { @@ -641,7 +641,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'delhome': if ($sender instanceof Player) { @@ -684,7 +684,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'tpa': if (!$sender->hasPermission("essentialstp.command.tpa")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -727,7 +727,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'tpahere': if (!$sender->hasPermission("essentialstp.command.tpahere")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -772,7 +772,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'tpaccept': if (!$sender->hasPermission("essentialstp.command.tpaccept")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -804,7 +804,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_player_not_online")); return true; } - break; + // break; case 'tpahere': if($this->getServer()->getPlayer($sql['player_from']) instanceof Player) { @@ -819,7 +819,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_player_not_online")); return true; } - break; + // break; default: return false; } @@ -839,7 +839,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'tpdeny': if (!$sender->hasPermission("essentialstp.command.tpdeny")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -858,7 +858,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'warp': if (!$sender->hasPermission("essentialstp.command.warp")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -929,7 +929,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'setwarp': if (!$sender->hasPermission("essentialstp.command.setwarp")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -989,7 +989,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'delwarp': if (!$sender->hasPermission("essentialstp.command.delwarp")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -1030,7 +1030,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'wild': if (!$sender->hasPermission("essentialstp.command.wild")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -1075,7 +1075,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'back': if (!$sender->hasPermission("essentialstp.command.back")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -1098,7 +1098,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'spawn': if (!$sender->hasPermission("essentialstp.command.spawn")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); @@ -1153,7 +1153,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; case 'setspawn': if (!$sender->hasPermission("essentialstp.command.setspawn")) { $sender->sendMessage(TextFormat::RED .$this->config->get("Lang_no_permissions")); @@ -1202,7 +1202,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sender->sendMessage(TextFormat::RED.$this->config->get("Lang_command_only_use_ingame")); return true; } - break; + // break; default: return false; } From a005a20f342b9edb8333e6304769f4bcc7e14e4d Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:56:56 +1000 Subject: [PATCH 25/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 65c854b..a44df7c 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -699,11 +699,11 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } $this->tp_sender = $sender->getName(); $this->tp_reciver = $args[0]; - if ($this->getServer()->getPlayer($this->tp_reciver) instanceof Player) { - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage(TextFormat::GOLD . $this->tp_sender . TextFormat::WHITE . ' '.$this->config->get("Lang_sent_request_you")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' ' . TextFormat::GOLD . '/tpaccept' . TextFormat::WHITE . ' '.$this->config->get("Lang_accept_request")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' ' . TextFormat::GOLD . '/tpdecline' . TextFormat::WHITE . ' '.$this->config->get("Lang_decline_request")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_request_expire_1").' ' . TextFormat::GOLD .$this->config->get("tpa-here-cooldown").' '.$this->config->get("Lang_request_expire_2") . TextFormat::WHITE . ' '.$this->config->get("Lang_request_expire_3")); + if ($this->getServer()->getPlayerExact($this->tp_reciver) instanceof Player) { + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage(TextFormat::GOLD . $this->tp_sender . TextFormat::WHITE . ' '.$this->config->get("Lang_sent_request_you")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' ' . TextFormat::GOLD . '/tpaccept' . TextFormat::WHITE . ' '.$this->config->get("Lang_accept_request")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' ' . TextFormat::GOLD . '/tpdecline' . TextFormat::WHITE . ' '.$this->config->get("Lang_decline_request")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_request_expire_1").' ' . TextFormat::GOLD .$this->config->get("tpa-here-cooldown").' '.$this->config->get("Lang_request_expire_2") . TextFormat::WHITE . ' '.$this->config->get("Lang_request_expire_3")); $this->prepare = $this->db2->prepare("INSERT INTO tp_requests (player, player_from, type, time, status) VALUES (:name, :name_from, :type, :time, :status)"); $this->prepare->bindValue(":name", trim(strtolower($this->getServer()->getPlayer($this->tp_reciver)->getName())), SQLITE3_TEXT); $this->prepare->bindValue(":name_from", trim(strtolower($this->tp_sender)), SQLITE3_TEXT); From c39ca47940c97ae4a8f8e9a28da7445dc8c27806 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:57:54 +1000 Subject: [PATCH 26/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index a44df7c..cf75e36 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -705,7 +705,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' ' . TextFormat::GOLD . '/tpdecline' . TextFormat::WHITE . ' '.$this->config->get("Lang_decline_request")); $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_request_expire_1").' ' . TextFormat::GOLD .$this->config->get("tpa-here-cooldown").' '.$this->config->get("Lang_request_expire_2") . TextFormat::WHITE . ' '.$this->config->get("Lang_request_expire_3")); $this->prepare = $this->db2->prepare("INSERT INTO tp_requests (player, player_from, type, time, status) VALUES (:name, :name_from, :type, :time, :status)"); - $this->prepare->bindValue(":name", trim(strtolower($this->getServer()->getPlayer($this->tp_reciver)->getName())), SQLITE3_TEXT); + $this->prepare->bindValue(":name", trim(strtolower($this->getServer()->getPlayerExact($this->tp_reciver)->getName())), SQLITE3_TEXT); $this->prepare->bindValue(":name_from", trim(strtolower($this->tp_sender)), SQLITE3_TEXT); $this->prepare->bindValue(":type", 'tpa', SQLITE3_TEXT); $this->prepare->bindValue(":time", time(), SQLITE3_TEXT); From f7032527e93508fe207085294a042a2b44cb6fef Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 09:59:05 +1000 Subject: [PATCH 27/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index cf75e36..83f6abf 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -740,14 +740,14 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if(trim(strtolower($sender->getName())) == trim(strtolower($args[0]))){$sender->sendMessage(TextFormat::RED.$this->config->get("Lang_no_teleport_self"));return true;} $this->tp_sender = $sender->getName(); $this->tp_reciver = $args[0]; - if($this->getServer()->getPlayer($this->tp_reciver) instanceof Player) + if($this->getServer()->getPlayerExact($this->tp_reciver) instanceof Player) { - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage(TextFormat::GOLD.$this->tp_sender.TextFormat::WHITE.' '.$this->config->get("Lang_sent_request_them")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' '.TextFormat::GOLD.'/tpaccept'.TextFormat::WHITE.' '.$this->config->get("Lang_accept_request")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' '.TextFormat::GOLD.'/tpdecline'.TextFormat::WHITE.' '.$this->config->get("Lang_decline_request")); - $this->getServer()->getPlayer($this->tp_reciver)->sendMessage($this->config->get("Lang_request_expire_1").' '.TextFormat::GOLD.$this->config->get("tpa-here-cooldown").' '.$this->config->get("Lang_request_expire_2").TextFormat::WHITE.' '.$this->config->get("Lang_request_expire_3")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage(TextFormat::GOLD.$this->tp_sender.TextFormat::WHITE.' '.$this->config->get("Lang_sent_request_them")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' '.TextFormat::GOLD.'/tpaccept'.TextFormat::WHITE.' '.$this->config->get("Lang_accept_request")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_type").' '.TextFormat::GOLD.'/tpdecline'.TextFormat::WHITE.' '.$this->config->get("Lang_decline_request")); + $this->getServer()->getPlayerExact($this->tp_reciver)->sendMessage($this->config->get("Lang_request_expire_1").' '.TextFormat::GOLD.$this->config->get("tpa-here-cooldown").' '.$this->config->get("Lang_request_expire_2").TextFormat::WHITE.' '.$this->config->get("Lang_request_expire_3")); $this->prepare = $this->db2->prepare("INSERT INTO tp_requests (player, player_from, type, time, status) VALUES (:name, :name_from, :type, :time, :status)"); - $this->prepare->bindValue(":name", trim(strtolower($this->getServer()->getPlayer($this->tp_reciver)->getName())), SQLITE3_TEXT); + $this->prepare->bindValue(":name", trim(strtolower($this->getServer()->getPlayerExact($this->tp_reciver)->getName())), SQLITE3_TEXT); $this->prepare->bindValue(":name_from", trim(strtolower($this->tp_sender)), SQLITE3_TEXT); $this->prepare->bindValue(":type", 'tpahere', SQLITE3_TEXT); $this->prepare->bindValue(":time", time(), SQLITE3_TEXT); From 30822a0e6192e11ac09a47a48fc0c3452e9d29f9 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:26:07 +1000 Subject: [PATCH 28/35] Hooray common linting issues are gone --- src/skyss0fly/essentialsTP/essentialsTP.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 83f6abf..b228c85 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -791,9 +791,9 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar switch($sql['type']) { case 'tpa': - if($this->getServer()->getPlayer($sql['player_from']) instanceof Player) + if($this->getServer()->getPlayerExact($sql['player_from']) instanceof Player) { - $this->getServer()->getPlayer($sql['player_from'])->teleport($sender->getPosition()); + $this->getServer()->getPlayerExact($sql['player_from'])->teleport($sender->getPosition()); $this->prepare = $this->db2->prepare("UPDATE tp_requests SET status = 1 WHERE id = :id"); $this->prepare->bindValue(":id", $sql['id'], SQLITE3_INTEGER); $this->result = $this->prepare->execute(); @@ -806,9 +806,9 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } // break; case 'tpahere': - if($this->getServer()->getPlayer($sql['player_from']) instanceof Player) + if($this->getServer()->getPlayerExact($sql['player_from']) instanceof Player) { - $sender->teleport($this->getServer()->getPlayer($sql['player_from'])->getPosition()); + $sender->teleport($this->getServer()->getPlayerExact($sql['player_from'])->getPosition()); $this->prepare = $this->db2->prepare("UPDATE tp_requests SET status = 1 WHERE id = :id"); $this->prepare->bindValue(":id", $sql['id'], SQLITE3_INTEGER); $this->result = $this->prepare->execute(); @@ -899,8 +899,8 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if(count($sql) > 0){ $sql = $sql[0]; if(isset($sql['world'])){ - if(Server::getInstance()->loadWorld($sql['world']) != false){ - $curr_world = Server::getInstance()->getWorldByName($sql['world']); + if(Server::getInstance()->getWorldManager()->loadWorld($sql['world']) != false){ + $curr_world = Server::getInstance()->getWorldManager()->getWorldByName($sql['world']); $pos = new Position((int) $sql['x'], (int) $sql['y'], (int) $sql['z'], $curr_world); $sender->sendMessage($this->config->get("Lang_warp_to") . " " . TextFormat::GOLD . $sql['title']); $sender->teleport($pos); @@ -1039,13 +1039,13 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar if ($sender instanceof Player) { $this->world = $sender->getWorld()->getFolderName(); - foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($this->world == $curr_world->getFolderName()) { $pos = $sender->getWorld()->getSafeSpawn(new Vector3(rand('-'.$this->config->get("wild-MaxX"), $this->config->get("wild-MaxX")),rand(70,100),rand('-'.$this->config->get("wild-MaxY"), $this->config->get("wild-MaxY")))); $pos->getWorld()->loadChunk($pos->getX(),$pos->getZ()); - $pos->getWorld()->getChunk($pos->getX(),$pos->getZ(),true); + $pos->getWorld()->getChunk($pos->getX(),$pos->getZ()); $pos = $pos->getWorld()->getSafeSpawn(new Vector3($pos->getX(),rand(4,100),$pos->getZ())); //var_dump($pos); @@ -1119,7 +1119,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar $sql = $this->fetchall(); if( count($sql) > 0 ) { $sql = $sql[0]; - foreach($this->getServer()->getWorlds() as $aval_world => $curr_world) + foreach($this->getServer()->getWorldManager()->getWorlds() as $aval_world => $curr_world) { if ($sql['world'] == $curr_world->getFolderName()) { From a2bf40a0b87d88dd3973cf8bb720978a1c5e4373 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:31:13 +1000 Subject: [PATCH 29/35] Update essentialsTP.php --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index b228c85..4aa0a0b 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -53,6 +53,8 @@ class essentialsTP extends PluginBase implements CommandExecutor, Listener { /** @var \SQLite3Stmt */ public $prepare; + public $tpa_cooldown; + public function fetchall(){ $row = array(); From 2f29a55a017de264a042022c425c037383fc04e0 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:33:42 +1000 Subject: [PATCH 30/35] Could remove a lint --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 4aa0a0b..45ad06d 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -1208,7 +1208,7 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar default: return false; } - return false; + // return false; } public function create_db(){ From ed999dda6bbf2e999417b7e1a13f6aa05bc105a4 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:37:57 +1000 Subject: [PATCH 31/35] Maybe? --- src/skyss0fly/essentialsTP/essentialsTP.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 45ad06d..214eb36 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -933,16 +933,18 @@ public function onCommand(CommandSender $sender, Command $cmd, string $label, ar } // break; case 'setwarp': - if (!$sender->hasPermission("essentialstp.command.setwarp")) { + /* if (!$sender->hasPermission("essentialstp.command.setwarp")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); return true; } + */ if ($sender instanceof Player) { - if (!$sender->hasPermission("essentialstp.command.setwarp")) { + if (!$sender->hasPermission("essentialstp.command.setwarp")) { $sender->sendMessage(TextFormat::RED . $this->config->get("Lang_no_permissions")); return true; } + if((count($args) != 0) && (count($args) < 2)) { From 99b0e49fe0a3d38bc74716cb07523e2973a596e7 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:41:00 +1000 Subject: [PATCH 32/35] No lints? Please --- src/skyss0fly/essentialsTP/essentialsTP.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 214eb36..09bba8c 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -1370,7 +1370,7 @@ public function onEnable(): void{ } public function onDisable(): void{ - if($this->prepare){ + if (isset($this->prepare)){ $this->prepare->close(); } $this->getLogger()->info("essentialsTP+ Disabled"); From 47d734fc99dfa39f889d0c20762a4b85ede33110 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:43:01 +1000 Subject: [PATCH 33/35] No lints? Hopefully --- src/skyss0fly/essentialsTP/essentialsTP.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/skyss0fly/essentialsTP/essentialsTP.php b/src/skyss0fly/essentialsTP/essentialsTP.php index 09bba8c..3f3df86 100644 --- a/src/skyss0fly/essentialsTP/essentialsTP.php +++ b/src/skyss0fly/essentialsTP/essentialsTP.php @@ -1370,9 +1370,9 @@ public function onEnable(): void{ } public function onDisable(): void{ - if (isset($this->prepare)){ - $this->prepare->close(); - } - $this->getLogger()->info("essentialsTP+ Disabled"); + if($this->prepare !== null){ + $this->prepare->close(); } + $this->getLogger()->info("essentialsTP+ Disabled"); +} } From ab2b978a33b51471c42a7b2cf44d58932640a931 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Sun, 27 Aug 2023 18:52:54 +1000 Subject: [PATCH 34/35] Update plugin.yml --- plugin.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugin.yml b/plugin.yml index 6286ce0..b563dc5 100644 --- a/plugin.yml +++ b/plugin.yml @@ -1,6 +1,6 @@ name: essentialsTP main: skyss0fly\essentialsTP\essentialsTP -version: 1.2.3 +version: 1.2.4 api: 5.0.0 extensions: [sqlite3] author: skyss0fly From 632fde042ff4ef40eb39dd9dc98c5919a1658367 Mon Sep 17 00:00:00 2001 From: skyss0fly <100278495+skyss0fly@users.noreply.github.com> Date: Mon, 28 Aug 2023 16:19:47 +1000 Subject: [PATCH 35/35] Update README.md --- README.md | 216 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 216 insertions(+) diff --git a/README.md b/README.md index 54802da..f083936 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,218 @@ # essentialsTP EssentialsTP by ServerKart_Rod +------- +# Overview: +Welcome to EssentialsTP. + +# Offers: +This plugin Will provide you with the essentiality in essentialstp. you can warp. set spawn, tpa. Just like the original EssentialTP But updated:) +# Credits: +- Creator: ServerKart_Rod +- Updated by: poggit-orphanage to pm3 +- Updated by: skyss0fly to pm4 and pm5 + +# Configuration: +to add permissions to a user you will need to use a permission manager: +Examples: +- [LunarRanks](https://poggit.pmmp.io/p/LunarRanks) +- [RankSystem](https://poggit.pmmp.io/p/RankSystem) +- [PurePerms](https://poggit.pmmp.io/p/PurePerms) + +# Config: +``` +--- +plugin-name: essentalsTp+ +sqlite-dbname: essentials_tp +tpa-here-cooldown: "30" +tp-home-cooldown: "5" +tp-warp-cooldown: "5" +tp-spawn-cooldown: "5" +MOTD: Welcome to this awsome plugin showcase was hell for the first day but hey lol +wild-MaxX: "300" +wild-MaxY: "300" +bed-sets-home: "true" +Lang_invalid_usage: 'INVALID USAGE:' +Lang_command_only_use_ingame: This command can only be used in the game. +Lang_no_permissions: '[EssentialsTP] No permission.' +Lang_teleport_home: Teleported you home. +Lang_teleport_spawn: Teleported you to spawn. +Lang_teleport_wild: Teleported you some where wild. +Lang_teleport_death: Teleported to last death cords. +Lang_no_spawn_set: No spawn point set for this world.... Using original world spawn. +Lang_teleport_spawn_original: Teleported you to worlds original spawn. +Lang_spawn_set: Spawn set. +Lang_your_homes: 'Your Homes:' +Lang_no_home_set: You have not yet set a home. +Lang_no_home_name: You do not have a home by that name. +Lang_home_set: Home set as +Lang_home_delete_1: 'Home named:' +Lang_home_delete_2: has been deleted. +Lang_no_teleport_self: You cant teleport to your self. +Lang_player_not_online: Player is not online. +Lang_sent_request_you: sent a request to teleport to you. +Lang_sent_request_them: sent a request to you, to teleport to them. +Lang_accept_request: to accept this request. +Lang_decline_request: to decline this request. +Lang_request_expire_1: This request is only good for +Lang_request_expire_2: Seconds +Lang_request_expire_3: before it expires. +Lang_type: Type +Lang_no_active_request: No active request exist. +Lang_warps: 'Warps:' +Lang_no_warps: This server has no warps. +Lang_no_warp_listed: There is no warp by that name listed. +Lang_warp_set: Warp set as +Lang_warp_to: You warped to +Lang_warp_delete_1: 'Warp named:' +Lang_warp_delete_2: has been deleted. +Lang_no_warps_name: No Warps matching that name for this server. +Land_chunk_not_loaded: Could not load chunk It's not safe to teleport. +Lang_action_cooldown: This action is on cooldown. +Lang_no_death: Die already please. +... +``` + +# Commands: +The following commands are: +``` +- home: + description: Teleports you home /home will list homes /home will teleport you. + usage: "/home or /home " + permission: essentialstp.command.home +- sethome: + description: Sets your home, use names for multiple homes. + usage: "/sethome " + permission: essentialstp.command.sethome +- delhome: + description: Delete your selected home. + usage: "/delhome " + permission: essentialstp.command.delhome +- back: + description: Teleports you to your last known death location. + usage: "/back" + permission: essentialstp.command.back +- wild: + description: Teleport to a random location in the world. + usage: "/wild" + permission: essentialstp.command.wild +- setspawn: + description: Sets world spawn point. + usage: "/setspawn" + permission: essentialstp.command.setspawn +- spawn: + description: Teleports to world spawn point. + usage: "/spawn" + permission: essentialstp.command.spawn +- warp: + description: Warps you to a location /warp will list warps /warp will teleport you. + usage: "/warp or /warp " + permission: essentialstp.command.tpahere +- setwarp: + description: Sets a warp location. + usage: "/setwarp " + permission: essentialstp.command.setwarp +- delwarp: + description: Delete a warp location. + usage: "/delwarp " + permission: essentialstp.command.delwarp +- tpa: + description: Send teleport request to player to teleport you to player. + usage: "/tpa " + permission: essentialstp.command.tpa +- tpahere: + description: Send teleport request to teleport player to you. + usage: "/tpahere " + permission: essentialstp.command.tpahere +- tpaccept: + description: Accept a teleport request. + usage: "/tpaccept" + permission: essentialstp.command.tpaccept +- tpdeny: + description: decline all active teleport requests. + usage: "/tpdeny" + permission: essentialstp.command.tpdeny + +``` +- *also shown in* `plugin.yml` +# Permissions: +``` +- essentialstp.*: + default: op + description: "Allows all essentialsTP commands" +- essentialstp.command.*: + description: "Allows player to use commands" + default: op +- essentialstp.command.tpdeny: + description: "Allows player to decline request" + default: true +- essentialstp.command.tpaccept: + description: "Allows player to accept request" + default: true +- essentialstp.command.tpahere: + description: "Allows player to teleport player to them" + default: true +- essentialstp.command.tpa: + description: "Allows player to teleport to another player" + default: true +- essentialstp.command.delwarp: + description: "Allows player to delete warps" + default: op +- essentialstp.command.setwarp: + description: "Allows player to set warps" + default: op +- essentialstp.command.warp: + description: "Allows player use warps" + default: true +- essentialstp.command.setspawn: + description: "Allows player to set spawn for world" + default: op +- essentialstp.command.spawn: + description: "Allows player use spawn command" + default: true +- essentialstp.command.wild: + description: "Allows player to teleport to a random location in world" + default: true +- essentialstp.command.back: + description: "Allows player go back to their last death location" + default: true +- essentialstp.command.delhome: + description: "Allows player to delete their homes" + default: true +- essentialstp.command.sethome: + description: "Allows player to set their homes" + default: true +- essentialstp.command.home: + description: "Allows player to use the home command" + default: true +- essentialstp.command.bedsethome: + description: "Allows player to set home with their bed" + default: true +- essentialstp.command.sign.warp: + description: "Allows player to use warp signs" + default: true +- essentialstp.command.sign.wild: + description: "Allows player to use wild signs" + default: op +- essentialstp.command.sign.spawn: + description: "Allows player to use spawn signs" + default: true +- essentialstp.command.sign.warp.create: + description: "Allows player to create warp signs" + default: op +- essentialstp.command.sign.wild.create: + description: "Allows player to create wild signs" + default: op +- essentialstp.command.sign.spawn.create: + description: "Allows player to create spawn signs" + default: op +- essentialstp.command.sign.warp.break: + description: "Allows player to break warp signs" + default: op +- essentialstp.command.sign.wild.break: + description: "Allows player to break wild signs" + default: op +- essentialstp.command.sign.spawn.break: + description: "Allows player to break spawn signs" + default: op +``` +- *also seen in* `plugin.yml`