Browse Source

Size of the plugin divided by 300.

tags/1.0
Ad5001 2 years ago
parent
commit
383c154768
4 changed files with 11 additions and 2 deletions
  1. 1
    1
      README.md
  2. 0
    0
      Spooky.mcpack
  3. BIN
      img/struct.jpeg
  4. 10
    1
      src/Ad5001/Spooky/Main.php

+ 1
- 1
README.md View File

@@ -2,7 +2,7 @@
Halloween plugin.
A new bossfight's waiting for you and your players. <b>The Ghost is <i>here</i></b>.
Build a structure like this one: (be sure to place the pumpkin in last!)
<img src="https://github.com/Ad5001/Spooky/raw/master/img/struct.jpeg"></img>
<img src="https://download.ad5001.eu/other/Spooky/struct.jpeg"></img>


Afterwards let the boss fight go!

resources/Spooky.mcpack → Spooky.mcpack View File


BIN
img/struct.jpeg View File


+ 10
- 1
src/Ad5001/Spooky/Main.php View File

@@ -12,6 +12,8 @@ use pocketmine\event\block\BlockPlaceEvent;
use pocketmine\network\mcpe\protocol\PlaySoundPacket;
use pocketmine\block\Block;
use pocketmine\resourcepacks\ZippedResourcePack;
use pocketmine\utils\Utils;
use pocketmine\utils\TextFormat;

use pocketmine\nbt\tag\ListTag;
use pocketmine\nbt\tag\CompoundTag;
@@ -42,7 +44,13 @@ class Main extends PluginBase implements Listener{
$this->getServer()->getScheduler()->scheduleRepeatingTask(new TickTask($this), 2);
$this->getServer()->getPluginManager()->registerEvents($this, $this);
// Resource pack
$this->saveResource("Spooky.mcpack");
$downRP = false;
if(!file_exists($this->getDataFolder() . "Spooky.mcpack")) {
$downRP = true;
echo TextFormat::toANSI("§f[Spooky] ⚪ Downloading resource pack...");
file_put_contents($this->getDataFolder() . "Spooky.mcpack", Utils::getURL("https://download.ad5001.eu/other/Spooky/Spooky.mcpack"));
}
echo str_repeat("\010", $downRP ? strlen(TextFormat::toANSI("§f[Spooky] ⚪ Downloading resource pack...")) : 0) . TextFormat::toANSI("§f[Spooky] ⚪ Applying resource pack... "); // Replacing latest message
$pack = new ZippedResourcePack($this->getDataFolder() . "Spooky.mcpack");
$r = new \ReflectionClass("pocketmine\\resourcepacks\\ResourcePackManager");
if($pack instanceof \pocketmine\resourcepacks\ResourcePack){
@@ -62,6 +70,7 @@ class Main extends PluginBase implements Listener{
$forceResources->setAccessible(true);
$forceResources->setValue($this->getServer()->getResourceManager(), true);
}
echo str_repeat("\010", strlen("⚪ Applying resource pack... ")) . TextFormat::toANSI("§a✔️ Done! Spooky enabled! \n");
}

/**

Loading…
Cancel
Save