Merge pull request #3 from robske110/master

Fix not creating plugin data folder; Round position broadcast; add icon
This commit is contained in:
Adsooi 2017-10-31 23:10:52 +01:00 committed by GitHub
commit 0203f6e9a0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
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");
}