mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-19 15:36:08 +00:00
Weird Painting spawn (WiP)
This commit is contained in:
@@ -194,11 +194,12 @@ class BlockAPI{
|
||||
for($count = $stack; $count > 0; ){
|
||||
$data["stack"] = min(64, $count);
|
||||
$count -= $data["stack"];
|
||||
$e = $this->server->api->entity->add(ENTITY_ITEM, $block, $data);
|
||||
$server = ServerAPI::request();
|
||||
$e = $server->api->entity->add(ENTITY_ITEM, $block, $data);
|
||||
//$e->speedX = mt_rand(-10, 10) / 100;
|
||||
//$e->speedY = mt_rand(0, 5) / 100;
|
||||
//$e->speedZ = mt_rand(-10, 10) / 100;
|
||||
$this->server->api->entity->spawnToAll($e->eid);
|
||||
$server->api->entity->spawnToAll($e->eid);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -262,6 +263,10 @@ class BlockAPI{
|
||||
if($block->y > 127 or $block->y < 0){
|
||||
return false;
|
||||
}
|
||||
|
||||
if($item->isActivable === true and $item->onActivate($this, $player, $block, $target, $face, $fx, $fy, $fz)){
|
||||
return $this->cancelAction($block);
|
||||
}
|
||||
|
||||
if($item->isPlaceable()){
|
||||
$hand = $item->getBlock();
|
||||
|
@@ -27,10 +27,15 @@ the Free Software Foundation, either version 3 of the License, or
|
||||
|
||||
class ServerAPI{
|
||||
var $restart = false;
|
||||
private static $serverRequest = false;
|
||||
private $server;
|
||||
private $config;
|
||||
private $apiList = array();
|
||||
|
||||
public static function request(){
|
||||
return self::$serverRequest;
|
||||
}
|
||||
|
||||
public function run(){
|
||||
$this->load();
|
||||
return $this->init();
|
||||
@@ -107,6 +112,7 @@ class ServerAPI{
|
||||
$this->parseProperties();
|
||||
define("DEBUG", $this->getProperty("debug"));
|
||||
$this->server = new PocketMinecraftServer($this->getProperty("server-name"), $this->getProperty("gamemode"), false, $this->getProperty("port"), $this->getProperty("server-id"), $this->getProperty("server-ip"));
|
||||
self::$serverRequest = $this->server;
|
||||
$this->setProperty("server-id", $this->server->serverID);
|
||||
$this->server->api = $this;
|
||||
if($this->getProperty("upnp-forwarding") === true){
|
||||
|
Reference in New Issue
Block a user