mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 20:19:44 +00:00
names were fixed, ->loop->stop();
This commit is contained in:
parent
50006a0189
commit
f6897cf862
242 changed files with 111 additions and 166 deletions
|
|
@ -1,25 +0,0 @@
|
|||
<?php
|
||||
|
||||
class MinecartItem extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(MINECART, 0, $count, "Minecart");
|
||||
$this->isActivable = true;
|
||||
$this->maxStackSize = 1;
|
||||
}
|
||||
public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
|
||||
if($target->getID() !== 66 and $target->getID() !== 27){
|
||||
return;
|
||||
}
|
||||
$server = ServerAPI::request();
|
||||
$data = [
|
||||
"x" => $target->getX(),
|
||||
"y" => $target->getY() + 0.8,
|
||||
"z" => $target->getZ(),
|
||||
];
|
||||
$e = $server->api->entity->add($level, ENTITY_OBJECT, OBJECT_MINECART, $data);
|
||||
$server->api->entity->spawnToAll($e);
|
||||
if(($player->gamemode & 0x01) === 0x00){
|
||||
$player->removeItem($this->getID(), $this->getMetadata(), 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue