Skip to content

Commit

Permalink
Release V1.5.2 (bug fix update)
Browse files Browse the repository at this point in the history
- Tasks are now properly cancelled
  • Loading branch information
supercrafter333 committed Dec 4, 2021
1 parent 490d831 commit cf28b3b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 10 deletions.
6 changes: 6 additions & 0 deletions .changlogs.md
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,10 @@ End of theSpawn PM3 support
### Changelog V1.5.0 » V1.5.1
> This version doesn't contain any major code changes from the previous version. It's only a bug fix update.
- *[FIX]* - Fixed a bug on player respawn
- *[VERSION]* - Version bump


### Changelog V1.5.1 » V1.5.2
> This version doesn't contain any major code changes from the previous version. It's only a bug fix update.
- *[FIX]* - Tasks are now properly canceled
- *[VERSION]* - Version bump
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![Discord](https://img.shields.io/badge/chat-on%20discord-7289da.svg)](https://discord.gg/ca6cWPpERp)
# theSpawn - V1.5.1 [![](https://poggit.pmmp.io/shield.state/theSpawn)](https://poggit.pmmp.io/p/theSpawn) [![](https://poggit.pmmp.io/shield.dl.total/theSpawn)](https://poggit.pmmp.io/p/theSpawn)
# theSpawn - V1.5.2 [![](https://poggit.pmmp.io/shield.state/theSpawn)](https://poggit.pmmp.io/p/theSpawn) [![](https://poggit.pmmp.io/shield.dl.total/theSpawn)](https://poggit.pmmp.io/p/theSpawn)

**This plugin will replace MSpawns! Help me to make this plugin better!**

Expand Down
2 changes: 1 addition & 1 deletion plugin.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: theSpawn
version: 1.5.0
version: 1.5.2
api: 4.0.0
main: supercrafter333\theSpawn\theSpawn
author: supercrafter333
Expand Down
2 changes: 1 addition & 1 deletion resources/Languages/messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ no-spawn-set-for-world: "§cThere's no spawn set for world {world}!"


#don't change this
version: "1.5.1"
version: "1.5.2"


############################
Expand Down
2 changes: 1 addition & 1 deletion resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ language: "en_BE"


#DON'T CHANGE THIS!!
version: "1.5.1"
version: "1.5.2"

############################
##########theSpawn##########
Expand Down
8 changes: 4 additions & 4 deletions src/supercrafter333/theSpawn/Tasks/TpaTask.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,18 @@ public function onRun(): void
if ($this->tpa->getSourceAsPlayer() == null && $this->tpa->getTargetAsPlayer() instanceof Player) {
$this->tpa->getTargetAsPlayer()->sendMessage(str_replace("{source}", $this->tpa->getSource(), MsgMgr::getMsg("tpa-cancelled-by-source")));
theSpawn::getInstance()->removeTpa($this->tpa->getSource());
$this->onCancel();
$this->getHandler()->cancel();
return;
}
if ($this->tpa->getTargetAsPlayer() == null && $this->tpa->getSourceAsPlayer() instanceof Player) {
$this->tpa->getSourceAsPlayer()->sendMessage(str_replace("{target}", $this->tpa->getTarget(), MsgMgr::getMsg("tpa-cancelled-by-target")));
theSpawn::getInstance()->removeTpa($this->tpa->getSource());
$this->onCancel();
$this->getHandler()->cancel();
return;
}
if ($this->tpa->getTargetAsPlayer() == null && $this->tpa->getSourceAsPlayer() == null) {
theSpawn::getInstance()->removeTpa($this->tpa->getSource());
$this->onCancel();
$this->getHandler()->cancel();
return;
}
if ($this->seconds > 10) {
Expand All @@ -51,7 +51,7 @@ public function onRun(): void
$this->seconds--;
} elseif ($this->seconds <= 0) {
$this->tpa->getTargetAsPlayer()->sendMessage(str_replace(["{target}", "{source}"], [$this->tpa->getTarget(), $this->tpa->getSource()], MsgMgr::getMsg("tpa-ended")));
$this->onCancel();
$this->getHandler()->cancel();
}
}
}
4 changes: 2 additions & 2 deletions src/supercrafter333/theSpawn/theSpawn.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ class theSpawn extends PluginBase implements Listener
/**
* @var string
*/
public string $version = "1.5.1";
public string $version = "1.5.2";


/**
Expand Down Expand Up @@ -1164,7 +1164,7 @@ public function stopSpawnDelay(Player $player): bool
if (!isset($this->spawnDelays[$player->getName()])) return false;
$task = $this->spawnDelays["task"];
if ($task instanceof Task) {
$task->onCancel();
$task->getHandler()->cancel();
}
unset($this->spawnDelays[$player->getName()]);
return true;
Expand Down

0 comments on commit cf28b3b

Please sign in to comment.