mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 20:49:43 +00:00
Some updates
This commit is contained in:
parent
8d454e5ec9
commit
e6c04861a4
5 changed files with 34 additions and 26 deletions
|
|
@ -34,9 +34,9 @@ It is mainly [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accept
|
||||||
* Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
|
* Long arrays MAY be split across multiple lines, where each subsequent line is indented once.
|
||||||
* Files MUST use only the `<?php` tag.
|
* Files MUST use only the `<?php` tag.
|
||||||
* Files MUST NOT have an ending `?>` tag.
|
* Files MUST NOT have an ending `?>` tag.
|
||||||
* Code MUST NOT use namespaces. _(This restriction will be lifted on the Alpha_1.4 code)_
|
* Code MUST NOT use namespaces. _(This restriction maybe will be lifted)_
|
||||||
* Strings SHOULD use the double quote `"` except when the single quote is required.
|
* Strings SHOULD use the double quote `"` except when the single quote is required.
|
||||||
* Arrays SHOULD be declared using `array()`, not the `[]` shortcut.
|
* Arrays SHOULD be declared using `[]`, not the `array()` shortcut.
|
||||||
* Argument lists MAY NOT be split across multiple lines, except long arrays.
|
* Argument lists MAY NOT be split across multiple lines, except long arrays.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
|
|
@ -52,14 +52,14 @@ class ExampleClass{
|
||||||
//do things
|
//do things
|
||||||
}elseif($firstArgument === "otherValue"){
|
}elseif($firstArgument === "otherValue"){
|
||||||
$secondArgument = function(){
|
$secondArgument = function(){
|
||||||
return array(
|
return [
|
||||||
0 => "value1",
|
0 => "value1",
|
||||||
1 => "value2",
|
1 => "value2",
|
||||||
2 => "value3",
|
2 => "value3",
|
||||||
3 => "value4",
|
3 => "value4",
|
||||||
4 => "value5",
|
4 => "value5",
|
||||||
5 => "value6",
|
5 => "value6"
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
29
README.md
29
README.md
|
|
@ -1,14 +1,14 @@
|
||||||

|

|
||||||
|
|
||||||
# NostalgiaCore
|
# NostalgiaCore
|
||||||
|
|
||||||
NostalgiaCore is a fork of Legacy PocketMine-MP 1.3.12, which fixes bugs of Legacy PocketMine-MP, and adds new content
|
NostalgiaCore is a fork of Legacy PocketMine-MP 1.3.12, which fixes bugs of Legacy PocketMine-MP, and adds new content
|
||||||
|
|
||||||
Supported version: 0.8.1
|
Supported MCPE versions: 0.8.0, 0.8.1 (maybe 0.8.2)
|
||||||
|
|
||||||
(Special thx to GullCraft Network and DartMiner43)
|
(Special thx to GullCraft Network and DartMiner43)
|
||||||
|
|
||||||
# Why should you use NostalgiaCore to run a Minecraft Pocket Edition 0.8.1 server?
|
<h2> Why should you use NostalgiaCore to run a Minecraft Pocket Edition 0.8.1 server?</h2>
|
||||||
|
|
||||||
• Items are dropping normally.
|
• Items are dropping normally.
|
||||||
|
|
||||||
|
|
@ -16,35 +16,38 @@ Supported version: 0.8.1
|
||||||
|
|
||||||
• Player hotbar is saved.
|
• Player hotbar is saved.
|
||||||
|
|
||||||
• Extra options (Only on NostalgiaCore!)
|
• Extra options (like in-game messages to discord)
|
||||||
|
|
||||||
• Server is starting faster (~0.7 sec).
|
|
||||||
|
|
||||||
• Vector2 is fixed.
|
• Vector2 is fixed.
|
||||||
|
|
||||||
• Players can't join as "RCON" or "CONSOLE".
|
|
||||||
|
|
||||||
• Working Nether Reactor.
|
• Working Nether Reactor.
|
||||||
|
|
||||||
|
• Mob AI
|
||||||
|
|
||||||
|
• PHAR plugins support
|
||||||
|
|
||||||
...and etc.
|
...and etc.
|
||||||
|
|
||||||
# Download Stable NostalgiaCore
|
<h3> Download Stable NostalgiaCore</h3>
|
||||||
|
|
||||||
https://github.com/kotyaralih/NostalgiaCore/releases/
|
https://github.com/kotyaralih/NostalgiaCore/releases/
|
||||||
|
|
||||||
|
<h3> PHP binaries download</h3>
|
||||||
|
|
||||||
# How to use auto-restart?
|
https://sourceforge.net/projects/pocketmine/files/builds/
|
||||||
|
|
||||||
|
<h3> How to use auto-restart?</h3>
|
||||||
|
|
||||||
Simply start your server using ./start.sh -l
|
Simply start your server using ./start.sh -l
|
||||||
|
|
||||||
# Our discord server
|
<h3> Our discord server</h3>
|
||||||
|
|
||||||
https://discord.gg/uSHEWe6NC3
|
https://discord.gg/uSHEWe6NC3
|
||||||
|
|
||||||
## Want to contribute?
|
<h4> Want to contribute?</h4>
|
||||||
* Check the [Contributing Guidelines](CONTRIBUTING.md)
|
* Check the [Contributing Guidelines](CONTRIBUTING.md)
|
||||||
|
|
||||||
## Third-party Libraries/Protocols Used
|
<h4> Third-party Libraries/Protocols Used</h4>
|
||||||
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
|
* __[PHP Sockets](http://php.net/manual/en/book.sockets.php)__
|
||||||
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
|
* __[PHP SQLite3](http://php.net/manual/en/book.sqlite3.php)__
|
||||||
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
|
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__
|
||||||
|
|
|
||||||
BIN
bin.7z
BIN
bin.7z
Binary file not shown.
|
|
@ -134,6 +134,7 @@ class PluginAPI extends stdClass{
|
||||||
}
|
}
|
||||||
|
|
||||||
private function loadAll(){
|
private function loadAll(){
|
||||||
|
$pharCnt = 0;
|
||||||
$dir = dir($this->pluginsPath());
|
$dir = dir($this->pluginsPath());
|
||||||
while(false !== ($file = $dir->read())){
|
while(false !== ($file = $dir->read())){
|
||||||
if($file[0] !== "."){
|
if($file[0] !== "."){
|
||||||
|
|
@ -143,6 +144,7 @@ class PluginAPI extends stdClass{
|
||||||
$this->load($dir->path . $file);
|
$this->load($dir->path . $file);
|
||||||
}
|
}
|
||||||
if($ext2 === "phar"){
|
if($ext2 === "phar"){
|
||||||
|
++$pharCnt;
|
||||||
$pluginInfo = []; //TODO: A PluginInfo class?
|
$pluginInfo = []; //TODO: A PluginInfo class?
|
||||||
$filePath = $this->pluginsPath().$file;
|
$filePath = $this->pluginsPath().$file;
|
||||||
$p = new Phar($this->pluginsPath().$file, 0);
|
$p = new Phar($this->pluginsPath().$file, 0);
|
||||||
|
|
@ -154,8 +156,7 @@ class PluginAPI extends stdClass{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
console("[INFO] Loading {$pluginInfo["name"]} by {$pluginInfo["author"]}...");
|
console("[INFO] Loading PHAR plugin \"".FORMAT_GREEN.$pluginInfo["name"].FORMAT_RESET."\" ".FORMAT_AQUA.$pluginInfo["version"].FORMAT_RESET." by ".FORMAT_AQUA.$pluginInfo["author"].FORMAT_RESET);
|
||||||
console("[WARNING] PHAR Plugin format is experemental and might cause bugs.");
|
|
||||||
|
|
||||||
$aver = CURRENT_API_VERSION;
|
$aver = CURRENT_API_VERSION;
|
||||||
if($pluginInfo["api"] != $aver){
|
if($pluginInfo["api"] != $aver){
|
||||||
|
|
@ -182,6 +183,9 @@ class PluginAPI extends stdClass{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if($pharCnt > 0){
|
||||||
|
console("[WARNING] PHAR Plugin format is experemental and might cause bugs.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function load($file){
|
public function load($file){
|
||||||
|
|
|
||||||
|
|
@ -30,23 +30,24 @@ abstract class Structure{
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function placeBlock($level, $sym, &$tv){
|
protected function placeBlock($level, $sym, &$tv){
|
||||||
console("@@@");
|
//console("@@@");
|
||||||
if($level instanceof Level){
|
if($level instanceof Level){
|
||||||
$idm = $this->getMappingFor($sym);
|
$idm = $this->getMappingFor($sym);
|
||||||
var_dump($idm);
|
if(!isset($idm[1])) $idm[1] = 0;
|
||||||
|
//var_dump($idm);
|
||||||
if($idm === Structure::MAP_NO_KEY){
|
if($idm === Structure::MAP_NO_KEY){
|
||||||
console("Failed to receive id");
|
//console("Failed to receive id");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$block = $this->api->block->get($idm[0], $idm[1], $tv); //TODO: meta
|
$block = $this->api->block->get($idm[0], $idm[1], $tv); //TODO: meta
|
||||||
console($block);
|
//console($block);
|
||||||
$level->setBlock($tv, $block, true, false, true);
|
$level->setBlock($tv, $block, true, false, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function build($level, $centerX, $centerY, $centerZ){
|
public function build($level, $centerX, $centerY, $centerZ){
|
||||||
console("b");
|
//console("b");
|
||||||
$tempVector = new Vector3(0,0,0);
|
$tempVector = new Vector3(0,0,0);
|
||||||
$x = $centerX - $this->radius;
|
$x = $centerX - $this->radius;
|
||||||
$z = $centerZ - $this->radius;
|
$z = $centerZ - $this->radius;
|
||||||
|
|
@ -54,7 +55,7 @@ abstract class Structure{
|
||||||
foreach($blocksXZ as $blocks){
|
foreach($blocksXZ as $blocks){
|
||||||
foreach(str_split($blocks) as $block){
|
foreach(str_split($blocks) as $block){
|
||||||
$tempVector->setXYZ($x, $centerY + $offsetY, $z);
|
$tempVector->setXYZ($x, $centerY + $offsetY, $z);
|
||||||
console("6#&_+7$:373-");
|
//console("6#&_+7$:373-");
|
||||||
$this->placeBlock($level, $block, $tempVector);
|
$this->placeBlock($level, $block, $tempVector);
|
||||||
++$x;
|
++$x;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue