mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Added mooshroom
This commit is contained in:
parent
abe7846bb9
commit
2da0fb2326
4 changed files with 32 additions and 1 deletions
|
|
@ -27,12 +27,18 @@ class EntityAPI{
|
|||
"cow" => 11,
|
||||
"pig" => 12,
|
||||
"sheep" => 13,
|
||||
"wolf" => 14,
|
||||
"villager" => 15,
|
||||
"mooshroom" => 16,
|
||||
|
||||
"zombie" => 32,
|
||||
"creeper" => 33,
|
||||
"skeleton" => 34,
|
||||
"spider" => 35,
|
||||
"pigman" => 36
|
||||
"pigman" => 36,
|
||||
"slime" => 37,
|
||||
"enderman" => 38,
|
||||
"silverfish" => 39,
|
||||
];
|
||||
$output = "";
|
||||
switch($cmd){
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ define("ENTITY_MOB", 2);
|
|||
define("MOB_SHEEP", 13);
|
||||
define("MOB_WOLF", 14);
|
||||
define("MOB_VILLAGER", 15);
|
||||
define("MOB_MOOSHROOM", 16);
|
||||
|
||||
define("MOB_ZOMBIE", 32);
|
||||
define("MOB_CREEPER", 33);
|
||||
|
|
|
|||
23
src/entity/animal/Mooshroom.php
Normal file
23
src/entity/animal/Mooshroom.php
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
<?php
|
||||
|
||||
class Mooshroom extends Cow{
|
||||
const TYPE = MOB_MOOSHROOM;
|
||||
function __construct(Level $level, $eid, $class, $type = 0, $data = []){
|
||||
parent::__construct($level, $eid, $class, $type, $data);
|
||||
$this->setName("Mooshroom");
|
||||
$this->update();
|
||||
}
|
||||
|
||||
public function interactWith(Entity $e, $action){
|
||||
if($e->isPlayer() && $action === InteractPacket::ACTION_HOLD){
|
||||
$slot = $e->player->getHeldItem();
|
||||
if($slot->getID() === SHEARS){
|
||||
//drop
|
||||
$this->close();
|
||||
$this->server->api->entity->summon($this, ENTITY_MOB, MOB_COW, $this->data);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
parent::interactWith($e, $action);
|
||||
}
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ class EntityRegistry{
|
|||
self::registerEntity(Chicken::class);
|
||||
self::registerEntity(Sheep::class);
|
||||
self::registerEntity(Cow::class);
|
||||
self::registerEntity(Mooshroom::class);
|
||||
self::registerEntity(Creeper::class);
|
||||
self::registerEntity(PigZombie::class);
|
||||
self::registerEntity(Skeleton::class);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue