mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
commit
edafff16db
14 changed files with 7 additions and 39 deletions
|
|
@ -337,7 +337,6 @@ class BlockAPI{
|
|||
$output .= "Giving ".$item->count." of ".$item->getName()." (".$item->getID().":".$item->getMetadata().") to ".$issuer->username;
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
return $output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -92,7 +92,7 @@ class ConsoleAPI{
|
|||
$end = strlen($line);
|
||||
}
|
||||
$cmd = strtolower(substr($line, 0, $end));
|
||||
$params = (string) substr($line, $end + 1);
|
||||
$params = substr($line, $end + 1);
|
||||
if(isset($this->alias[$cmd])){
|
||||
return $this->run($this->alias[$cmd] . ($params !== "" ? " " . $params : ""), $issuer, $cmd);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -170,7 +170,6 @@ class LevelAPI{
|
|||
}
|
||||
$issuer->entity->level->setSpawn(new Vector3($issuer->entity->x, $issuer->entity->y, $issuer->entity->z));
|
||||
return ("Spawn set!");
|
||||
break;
|
||||
case "save-all":
|
||||
$output .= "Saving...\n";
|
||||
foreach($this->server->clients as $p){
|
||||
|
|
|
|||
|
|
@ -218,7 +218,6 @@ class PlayerAPI{
|
|||
}else{
|
||||
return "Usage: /$cmd [player]\n";
|
||||
}
|
||||
break;
|
||||
case "list":
|
||||
$output .= "There are " . count($this->server->clients) . "/" . $this->server->maxClients . " players online:\n";
|
||||
if(count($this->server->clients) == 0){
|
||||
|
|
@ -228,7 +227,6 @@ class PlayerAPI{
|
|||
$output .= $c->username . ", ";
|
||||
}
|
||||
return substr($output, 0, -2) . "\n";
|
||||
break;
|
||||
case "loc":
|
||||
if(!($issuer instanceof Player)) return "Please run this command in-game.";
|
||||
$x = round($issuer->entity->x, 1, PHP_ROUND_HALF_UP);
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ class TimeAPI{
|
|||
$output = "";
|
||||
switch($cmd){
|
||||
case "time":
|
||||
$level = false;
|
||||
if($issuer instanceof Player){
|
||||
$level = $issuer->level;
|
||||
}else{
|
||||
|
|
|
|||
|
|
@ -666,22 +666,6 @@ class Player{
|
|||
|
||||
public function sendInventorySlot($s){
|
||||
$this->sendInventory();
|
||||
return;
|
||||
$s = (int) $s;
|
||||
if(!isset($this->inventory[$s])){
|
||||
$pk = new ContainerSetSlotPacket;
|
||||
$pk->windowid = 0;
|
||||
$pk->slot = (int) $s;
|
||||
$pk->item = BlockAPI::getItem(AIR, 0, 0);
|
||||
$this->dataPacket($pk);
|
||||
}
|
||||
|
||||
$slot = $this->inventory[$s];
|
||||
$pk = new ContainerSetSlotPacket;
|
||||
$pk->windowid = 0;
|
||||
$pk->slot = (int) $s;
|
||||
$pk->item = $slot;
|
||||
$this->dataPacket($pk);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1727,7 +1711,7 @@ class Player{
|
|||
$this->server->schedule(50, [$this, "measureLag"], [], true);
|
||||
|
||||
$pk = new SetTimePacket;
|
||||
$pk->time = (int) $this->level->getTime();
|
||||
$pk->time = $this->level->getTime();
|
||||
$pk->started = !$this->level->isTimeStopped();
|
||||
$this->dataPacket($pk);
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ require_once(FILE_PATH . "/src/functions.php");
|
|||
/***REM_END***/
|
||||
define("DATA_PATH", realpath(arg("data-path", FILE_PATH)) . "/");
|
||||
|
||||
if(arg("enable-ansi", !(strpos(strtoupper(php_uname("s")), "WIN") === 0)) === true and arg("disable-ansi", false) !== true){
|
||||
if(arg("enable-ansi", !(str_starts_with(strtoupper(php_uname("s")), "WIN"))) === true and arg("disable-ansi", false) !== true){
|
||||
define("ENABLE_ANSI", true);
|
||||
}else{
|
||||
define("ENABLE_ANSI", false);
|
||||
|
|
|
|||
|
|
@ -39,11 +39,8 @@ class GrassBlock extends SolidBlock{
|
|||
$chance = lcg_value() * 100;
|
||||
if($chance <= 1){
|
||||
ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y+1, $this->z+0.5, $this->level), BlockAPI::getItem(BEETROOT_SEEDS,0,1), 10);
|
||||
return;
|
||||
}
|
||||
elseif($chance > 1 and $chance <= 16){
|
||||
}elseif($chance > 1 and $chance <= 16){
|
||||
ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y+1, $this->z+0.5, $this->level), BlockAPI::getItem(SEEDS,0,1), 10);
|
||||
return;
|
||||
}
|
||||
}
|
||||
public static function onRandomTick(Level $level, $x, $y, $z){
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ class AsyncMultipleQueue extends Thread{
|
|||
++$offset;
|
||||
}
|
||||
}
|
||||
$this->input = (string) substr($this->input, $offset);
|
||||
$this->input = substr($this->input, $offset);
|
||||
return $str;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -109,7 +109,6 @@ class Config{
|
|||
default:
|
||||
$this->correct = false;
|
||||
return false;
|
||||
break;
|
||||
}
|
||||
if(!is_array($this->config)){
|
||||
$this->config = $default;
|
||||
|
|
@ -247,7 +246,7 @@ class Config{
|
|||
unset($this->correct);
|
||||
unset($this->type);
|
||||
$this->load($this->file);
|
||||
$correct = $this->check();
|
||||
$this->check();
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -67,7 +67,6 @@ class NBT{
|
|||
default:
|
||||
echo bin2hex(substr($this->binary, $this->offset - 1)) . PHP_EOL . PHP_EOL;
|
||||
die("Invalid NBT Tag $tag");
|
||||
break;
|
||||
}
|
||||
$node[$name] = $value;
|
||||
}
|
||||
|
|
@ -155,7 +154,6 @@ class NBT{
|
|||
default:
|
||||
echo bin2hex(substr($this->binary, $this->offset - 1)) . PHP_EOL . PHP_EOL;
|
||||
die("Invalid NBT Tag $tag");
|
||||
break;
|
||||
}
|
||||
$node[] = $value;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -34,7 +34,6 @@ class Random{
|
|||
$this->haveNextNextGaussian = false;
|
||||
return $this->nextNextGaussian;
|
||||
}else{
|
||||
$v1 = $v2 = $s = null;
|
||||
do{
|
||||
$v1 = 2 * $this->nextFloat() - 1; // between -1.0 and 1.0
|
||||
$v2 = 2 * $this->nextFloat() - 1; // between -1.0 and 1.0
|
||||
|
|
|
|||
|
|
@ -549,7 +549,7 @@ class Level{
|
|||
$curChunkZ = (int)$e->z >> 4;
|
||||
$index = "$curChunkX $curChunkZ";
|
||||
|
||||
if(isset($this->entityListPositioned[$index]) && isset($this->entityListPositioned[$index][$k])){
|
||||
if(isset($this->entityListPositioned[$index][$k])){
|
||||
unset($this->entityListPositioned[$index][$k]);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,10 +7,6 @@ class PocketChunkParser{
|
|||
var $map; //21 * $sectorLength
|
||||
private $location, $raw = b"", $file;
|
||||
|
||||
function __construct(){
|
||||
$map = [];
|
||||
}
|
||||
|
||||
public function loadFile($file){
|
||||
if(file_exists($file . ".gz")){
|
||||
$this->raw = gzinflate(file_get_contents($file . ".gz"));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue