mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
Merge branch 'master'
# Conflicts: # src/API/AchievementAPI.php # src/API/BanAPI.php # src/API/BlockAPI.php # src/API/EntityAPI.php # src/API/PlayerAPI.php # src/Player.php # src/PocketMinecraftServer.php # src/config.php # src/entity/Animal.php # src/entity/Breedable.php # src/entity/Creature.php # src/entity/Entity.php # src/entity/animal/Sheep.php # src/entity/monster/Creeper.php # src/entity/monster/Zombie.php # src/entity/object/Arrow.php # src/entity/object/FallingSand.php # src/entity/object/ItemEntity.php # src/entity/object/Minecart.php # src/entity/object/Painting.php # src/entity/object/PrimedTNT.php # src/material/Block.php # src/material/Item.php # src/material/Material.php # src/material/StaticBlock.php # src/material/block/DoorBlock.php # src/material/block/GenericBlock.php # src/material/block/attachable/WallSignBlock.php # src/material/block/liquid/LiquidBlockDynamic.php # src/material/block/misc/AirBlock.php # src/material/block/misc/BedBlock.php # src/material/block/misc/TNTBlock.php # src/material/block/nonfull/CarpetBlock.php # src/material/block/nonfull/FenceBlock.php # src/material/block/nonfull/PoweredRailBlock.php # src/material/block/nonfull/RailBlock.php # src/material/block/nonfull/SnowLayerBlock.php # src/material/block/nonfull/WoodSlabBlock.php # src/material/block/plant/BrownMushroomBlock.php # src/material/block/plant/DandelionBlock.php # src/material/block/plant/MelonStemBlock.php # src/material/block/plant/PumpkinStemBlock.php # src/material/block/plant/RedMushroomBlock.php # src/material/block/plant/SugarcaneBlock.php # src/material/block/solid/GrassBlock.php # src/material/block/solid/IceBlock.php # src/material/block/solid/LeavesBlock.php # src/material/block/solid/ObsidianBlock.php # src/material/block/solid/PumpkinBlock.php # src/material/block/solid/WoolBlock.php # src/material/item/base/ItemHoe.php # src/material/item/base/ItemTool.php # src/material/item/generic/DyeItem.php # src/material/item/generic/SpawnEggItem.php # src/material/item/tool/FlintSteelItem.php # src/material/item/tool/ShearsItem.php # src/math/AxisAlignedBB.php # src/network/MinecraftInterface.php # src/network/UDPSocket.php # src/network/protocol/packet/AddItemEntityPacket.php # src/network/protocol/packet/ContainerSetContentPacket.php # src/network/raknet/RakNetDataPacket.php # src/network/raknet/RakNetParser.php # src/pmf/PMFLevel.php # src/utils/Utils.php # src/world/Explosion.php # src/world/Level.php # src/world/MobSpawner.php
This commit is contained in:
commit
3fbab46e60
245 changed files with 6118 additions and 3408 deletions
|
|
@ -18,6 +18,7 @@ class LevelAPI{
|
|||
$this->server->api->console->register("save-on", "", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("save-off", "", [$this, "commandHandler"]);
|
||||
$this->server->api->console->register("setwspawn", "Set the spawn position for your current world. ", [$this, "commandHandler"]);
|
||||
|
||||
$this->default = $this->server->api->getProperty("level-name");
|
||||
if($this->loadLevel($this->default) === false){
|
||||
$this->generateLevel($this->default, $this->server->seed);
|
||||
|
|
@ -108,8 +109,9 @@ class LevelAPI{
|
|||
return true;
|
||||
}
|
||||
/**
|
||||
* Gets a level by name. Returns false if no level with such name exists.
|
||||
* @param string $name
|
||||
* @return Level|boolean
|
||||
* @return Level|false
|
||||
*/
|
||||
public function get($name){
|
||||
if(isset($this->levels[$name])){
|
||||
|
|
@ -224,19 +226,6 @@ class LevelAPI{
|
|||
return false;
|
||||
}
|
||||
console("[INFO] Unloading level \"" . $name . "\"");
|
||||
$level->nextSave = PHP_INT_MAX;
|
||||
$level->save();
|
||||
foreach($this->server->api->player->getAll($level) as $player){
|
||||
$player->teleport($this->server->spawn);
|
||||
}
|
||||
foreach($this->server->api->entity->getAll($level) as $entity){
|
||||
if($entity->class !== ENTITY_PLAYER){
|
||||
$entity->close();
|
||||
}
|
||||
}
|
||||
foreach($this->server->api->tile->getAll($level) as $tile){
|
||||
$tile->close();
|
||||
}
|
||||
$level->close();
|
||||
unset($this->levels[$name]);
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue