-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.php
33 lines (26 loc) · 927 Bytes
/
Main.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
declare(strict_types=1);
namespace MonoAdrian23\FunBoats;
use pocketmine\entity\Entity;
use pocketmine\inventory\ShapelessRecipe;
use pocketmine\item\Item;
use pocketmine\item\ItemFactory;
use pocketmine\plugin\PluginBase;
class Main extends PluginBase{
public function onEnable() : void{
//Register boat items
ItemFactory::registerItem(new BoatItem(), true);
$this->getServer()->getCraftingManager()->registerRecipe(
new ShapelessRecipe(
[
Item::get(Item::WOODEN_PLANKS, 0, 5),
Item::get(Item::WOODEN_SHOVEL, 0, 1)
],
[Item::get(Item::BOAT, 0, 1)])
);
//Register boat entities
Entity::registerEntity(BoatEntity::class, true);
//Register event listeners
$this->getServer()->getPluginManager()->registerEvents(new EventListener(), $this);
}
}