mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
added StaticBlock
This commit is contained in:
parent
0b28ed8042
commit
c6c088a7d5
7 changed files with 211 additions and 23 deletions
30
src/material/block/misc/MobSpawnerBlock.php
Normal file
30
src/material/block/misc/MobSpawnerBlock.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
|
||||
class MobSpawnerBlock extends SolidBlock
|
||||
{
|
||||
|
||||
public function __construct($meta = 0){
|
||||
parent::__construct(MONSTER_SPAWNER, $meta, "Mob Spawner");
|
||||
$this->isActivable = true;
|
||||
}
|
||||
|
||||
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
$api = ServerAPI::request();
|
||||
$tile = $api->api->tile->add($this->level, TILE_MOB_SPAWNER, $this->x, $this->y, $this->z, [
|
||||
"id" => TILE_MOB_SPAWNER,
|
||||
"x" => $this->x,
|
||||
"y" => $this->y,
|
||||
"z" => $this->z,
|
||||
"EntityId" => MOB_SPIDER, //TODO vanilla values
|
||||
"Delay" => 5,
|
||||
"MinSpawnDelay" => 20,
|
||||
"MaxSpawnDelay" => 80,
|
||||
"SpawnCount" => 4,
|
||||
"MaxNearbyEntities" => 0,
|
||||
"RequiredPlayerRange" => 0,
|
||||
"SpawnRange" => 4
|
||||
]);
|
||||
parent::place($item, $player, $block, $target, $face, $fx, $fy, $fz);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue