CLADevs / Minion

A plugin which adds minion on your server!
GNU General Public License v3.0
25 stars 23 forks source link

Server keeps crashing #30

Closed AGTHARN closed 4 years ago

AGTHARN commented 4 years ago

Server keeps crashing when i go to a world with a miner. Please help, ill appreciate it.

PocketMine-MP Crash Dump Thu Apr 9 23:57:18 UTC 2020

Error: Modulo by zero File: plugins/Minion_dev-18 (1).phar/src/CLADevs/Minion/minion/Minion Line: 64 Type: DivisionByZeroError

THIS CRASH WAS CAUSED BY A PLUGIN BAD PLUGIN: Minion v1.0.4

Code: [55] public function entityBaseTick(int $tickDiff = 1): bool{ [56] $update = parent::entityBaseTick($tickDiff); [57] //random names [58] if($this->getLevel()->getServer()->getTick() % 30 == 0){ [59] if(Main::get()->getConfig()->get("random-names")){ [60] $names = Main::get()->getConfig()->get("names"); [61] $this->setNameTag($this->minionname . "\n" . $names[array_rand($names)]); [62] } [63] } [64] if($this->getLevel()->getServer()->getTick() % $this->getMineTime() == 0){ [65] //Checks if theres a chest behind him [66] if($this->getLookingBehind() instanceof Chest){ [67] $b = $this->getLookingBehind(); [68] $this->namedtag->setString("xyz", $b->getX() . ":" . $b->getY() . ":" . $b->getZ()); [69] } [70] //Update the coordinates [71] if($this->namedtag->getString("xyz") !== "n"){ [72] if(isset($this->getCoord()[1])){ [73] $block = $this->getLevel()->getBlock(new Vector3(intval($this->getCoord()[0]), intval($this->getCoord()[1]), intval($this->getCoord()[2]))); [74] if(!$block instanceof Chest){

Backtrace:

0 src/pocketmine/entity/Entity(1383): CLADevs\Minion\minion\Minion->entityBaseTick(integer 1)

1 src/pocketmine/level/Level(844): pocketmine\entity\Entity->onUpdate(integer 2492)

2 src/pocketmine/level/Level(777): pocketmine\level\Level->actuallyDoTick(integer 2492)

3 src/pocketmine/Server(2256): pocketmine\level\Level->doTick(integer 2492)

4 src/pocketmine/Server(2387): pocketmine\Server->checkTickUpdates(integer 2492, double 1586476638.9431)

5 src/pocketmine/Server(2143): pocketmine\Server->tick()

6 src/pocketmine/Server(1990): pocketmine\Server->tickProcessor()

7 src/pocketmine/Server(1584): pocketmine\Server->start()

8 src/pocketmine/PocketMine(273): pocketmine\Server->__construct(object BaseClassLoader, object pocketmine\utils\MainLogger, string[26] /home/minecraft-pe/server/, string[34] /home/minecraft-pe/server/plugins/)

9 src/pocketmine/PocketMine(296): pocketmine\server()

10 (11): require(string[81] phar:///home/minecraft-pe/server/PocketMine-MP.phar/src/pocketmine/PocketMine.ph)

xXNiceYT commented 4 years ago

Can I see your config.yml

AGTHARN commented 4 years ago

random names allow?

random-names: false names: ["Miner"]

What worlds can minions not spawn in?

worlds: ["world", "pvp", "mine"]

The default size is 0.8 beacuse the pickaxe gonna stick out

size: 0.8

blocks:

if this is false than it would mine everything expect the cannot but wont smelt it auto

if this is true it would act like normal pickaxe

normal: true

Blocks that cannot be broken

ids of block that cannot be broken

cannot: [7, 8, 9, 10, 11, 51]

level:

every level it will cost 10 * level

cost: 10000

this is the max level

max: 3

Let the minion work when the owner is offline when its true

offline: false

...

AGTHARN commented 4 years ago

nvm