mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
commit
1d2efd7e78
11 changed files with 9 additions and 12 deletions
|
|
@ -161,7 +161,7 @@ class BanAPI{
|
|||
$player = $this->server->api->player->get($user);
|
||||
if(!($player instanceof Player)){
|
||||
$this->ops->set($user);
|
||||
$this->ops->save($user);
|
||||
$this->ops->save();
|
||||
$output .= $user . " is now op\n";
|
||||
break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -150,7 +150,7 @@ class EntityAPI{
|
|||
"y" => $pos->y,
|
||||
"z" => $pos->z
|
||||
] + $data);
|
||||
$this->spawnToAll($entity, $pos->level);
|
||||
$this->spawnToAll($entity);
|
||||
}
|
||||
|
||||
public function getNextEID(){
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class PlayerAPI{
|
|||
$this->server->addHandler("player.death", [$this, "handle"], 1);
|
||||
$this->registerCmd("list");
|
||||
$this->registerCmd("kill", "<player>");
|
||||
$this->registerCmd("gamemode", "<mode> [player]", [$this, "commandHandler"]);
|
||||
$this->registerCmd("gamemode", "<mode> [player]");
|
||||
$this->registerCmd("tp", "[target player] <destination player|w:world> OR /tp [target player] <x> <y> <z>");
|
||||
$this->registerCmd("spawnpoint", "[player] [x] [y] [z]");
|
||||
$this->registerCmd("spawn");
|
||||
|
|
|
|||
|
|
@ -591,7 +591,6 @@ class PocketMinecraftServer{
|
|||
$this->clients[$CID] = new Player($packet->clientID, $packet->ip, $packet->port, $packet->mtuSize); //New Session!
|
||||
$pk = new RakNetPacket(RakNetInfo::OPEN_CONNECTION_REPLY_2);
|
||||
$pk->serverID = $this->serverID;
|
||||
$pk->port = $this->port;
|
||||
$pk->mtuSize = $packet->mtuSize;
|
||||
$pk->ip = $packet->ip;
|
||||
$pk->port = $packet->port;
|
||||
|
|
|
|||
|
|
@ -99,7 +99,7 @@ abstract class Living extends Entity implements Pathfindable{
|
|||
foreach($this->level->entityListPositioned[$ind] ?? [] as $entid){
|
||||
if(($this->level->entityList[$entid] ?? null) instanceof Entity){
|
||||
if($this->level->entityList[$entid]->isPushable() && $bb->intersectsWith($this->level->entityList[$entid]->boundingBox)){
|
||||
$this->level->entityList[$entid]->applyCollision($this, true);
|
||||
$this->level->entityList[$entid]->applyCollision($this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ class Minecart extends Vehicle{
|
|||
if($e instanceof Entity && $e->eid != $this->eid && $e->eid != $this->linkedEntity){
|
||||
if($e->isPushable() && $e->boundingBox->intersectsWith($bb)){
|
||||
if($e->isPlayer()){
|
||||
$this->applyCollision($e, true);
|
||||
$this->applyCollision($e);
|
||||
}else{
|
||||
$e->applyCollision($this);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -295,7 +295,7 @@ class CraftingRecipes{
|
|||
break;
|
||||
}
|
||||
}
|
||||
if($continue === false or $craftItem[0] !== $recipe[1][0] or $recipe[1][1] !== $recipe[1][1] or $recipe[1][2] !== $recipe[1][2]){
|
||||
if($continue === false or $craftItem[0] !== $recipe[1][0]){
|
||||
$continue = false;
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,6 @@ class SmeltingData{
|
|||
RED_MUSHROOM => [DYE, 1],
|
||||
RAW_BEEF => [STEAK, 0],
|
||||
RAW_CHICKEN => [COOKED_CHICKEN, 0],
|
||||
RED_MUSHROOM => [DYE, 1],
|
||||
POTATO => [BAKED_POTATO, 0],
|
||||
];
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ class RailLogic
|
|||
}
|
||||
|
||||
public function canConnectTo(RailLogic $rail){
|
||||
return $this->connectsTo($rail) || ((count($this->railPositions) == 2 ? false : (empty($this->railPositions) ? true : true)));
|
||||
return $this->connectsTo($rail) || !(count($this->railPositions) == 2);
|
||||
}
|
||||
|
||||
public function hasNeighborRail($x, $y, $z){
|
||||
|
|
|
|||
|
|
@ -395,7 +395,6 @@ class Level{
|
|||
|
||||
if(count($this->changedCount) > 0){
|
||||
arsort($this->changedCount);
|
||||
$resendChunks = [];
|
||||
$reorder = false;
|
||||
foreach($this->changedCount as $index => $count){
|
||||
if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets
|
||||
|
|
|
|||
|
|
@ -41,8 +41,8 @@ class SuperflatGenerator implements LevelGenerator{
|
|||
$preset = explode(";", $preset);
|
||||
$version = (int) $preset[0];
|
||||
$blocks = @$preset[1];
|
||||
$biome = isset($preset[2]) ? $preset[2] : 1;
|
||||
$options = isset($preset[3]) ? $preset[3] : "";
|
||||
$biome = $preset[2] ?? 1;
|
||||
$options = $preset[3] ?? "";
|
||||
preg_match_all('#(([0-9]{0,})x?([0-9]{1,3}:?[0-9]{0,2})),?#', $blocks, $matches);
|
||||
$y = 0;
|
||||
$this->structure = [];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue