Fix not creating plugin data folder; Round position broadcast; add icon

Bump version to 1.0.1
This commit is contained in:
Tim (robske_110) 2017-10-31 18:56:38 +01:00
parent dd4c3d95e8
commit 57dbbe2f6c
5 changed files with 6 additions and 2 deletions

View file

@ -4,4 +4,5 @@ branches:
projects:
Spooky:
path: ""
icon: "icon.png"
...

BIN
icon.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 240 B

View file

@ -1,7 +1,7 @@
---
name: Spooky
author: Ad5001
version: 1.0
version: 1.0.1
api: [3.0.0-ALPHA9]
main: Ad5001\Spooky\Main
commands: []

View file

@ -44,6 +44,9 @@ class Main extends PluginBase implements Listener{
$this->getServer()->getScheduler()->scheduleRepeatingTask(new TickTask($this), 2);
$this->getServer()->getPluginManager()->registerEvents($this, $this);
// Resource pack
if(!file_exists($this->getDataFolder())){
mkdir($this->getDataFolder());
}
$downRP = false;
if(!file_exists($this->getDataFolder() . "Spooky.mcpack")) {
$downRP = true;

View file

@ -430,7 +430,7 @@ class Ghost extends Human {
$pk->headYaw = $this->yaw;
$pk->pitch = $this->pitch;
$this->getPlayer()->dataPacket($pk);
$this->getPlayer()->sendPopup("He's " . ($this->x - $this->getPlayer()->x) . ", " . ($this->y - $this->getPlayer()->y) . ", " . ($this->z - $this->getPlayer()->z) . " blocks away");
$this->getPlayer()->sendPopup("He's " . round($this->x - $this->getPlayer()->x, 1) . ", " . round($this->y - $this->getPlayer()->y, 1) . ", " . round($this->z - $this->getPlayer()->z, 1) . " blocks away");
}