Some updates

This commit is contained in:
ArkQuark 2022-10-20 20:23:05 +03:00
parent 8d454e5ec9
commit e6c04861a4
5 changed files with 34 additions and 26 deletions

View file

@ -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.
* Files MUST use only the `<?php` 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.
* 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.
```php
@ -52,14 +52,14 @@ class ExampleClass{
//do things
}elseif($firstArgument === "otherValue"){
$secondArgument = function(){
return array(
return [
0 => "value1",
1 => "value2",
2 => "value3",
3 => "value4",
4 => "value5",
5 => "value6",
);
5 => "value6"
];
}
}
}

View file

@ -1,14 +1,14 @@
![](http://185.117.153.152/nc_favicon.png)
![](http://owouwu.ru/favicon.png)
# NostalgiaCore
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)
# 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.
@ -16,35 +16,38 @@ Supported version: 0.8.1
• Player hotbar is saved.
• Extra options (Only on NostalgiaCore!)
• Server is starting faster (~0.7 sec).
• Extra options (like in-game messages to discord)
• Vector2 is fixed.
• Players can't join as "RCON" or "CONSOLE".
• Working Nether Reactor.
• Mob AI
• PHAR plugins support
...and etc.
# Download Stable NostalgiaCore
<h3> Download Stable NostalgiaCore</h3>
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
# Our discord server
<h3> Our discord server</h3>
https://discord.gg/uSHEWe6NC3
## Want to contribute?
<h4> Want to contribute?</h4>
​* 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 SQLite3](http://php.net/manual/en/book.sqlite3.php)__
* __[PHP BCMath](http://php.net/manual/en/book.bc.php)__

BIN
bin.7z

Binary file not shown.

View file

@ -134,6 +134,7 @@ class PluginAPI extends stdClass{
}
private function loadAll(){
$pharCnt = 0;
$dir = dir($this->pluginsPath());
while(false !== ($file = $dir->read())){
if($file[0] !== "."){
@ -143,6 +144,7 @@ class PluginAPI extends stdClass{
$this->load($dir->path . $file);
}
if($ext2 === "phar"){
++$pharCnt;
$pluginInfo = []; //TODO: A PluginInfo class?
$filePath = $this->pluginsPath().$file;
$p = new Phar($this->pluginsPath().$file, 0);
@ -154,8 +156,7 @@ class PluginAPI extends stdClass{
break;
}
}
console("[INFO] Loading {$pluginInfo["name"]} by {$pluginInfo["author"]}...");
console("[WARNING] PHAR Plugin format is experemental and might cause bugs.");
console("[INFO] Loading PHAR plugin \"".FORMAT_GREEN.$pluginInfo["name"].FORMAT_RESET."\" ".FORMAT_AQUA.$pluginInfo["version"].FORMAT_RESET." by ".FORMAT_AQUA.$pluginInfo["author"].FORMAT_RESET);
$aver = CURRENT_API_VERSION;
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){

View file

@ -30,23 +30,24 @@ abstract class Structure{
}
protected function placeBlock($level, $sym, &$tv){
console("@@@");
//console("@@@");
if($level instanceof Level){
$idm = $this->getMappingFor($sym);
var_dump($idm);
if(!isset($idm[1])) $idm[1] = 0;
//var_dump($idm);
if($idm === Structure::MAP_NO_KEY){
console("Failed to receive id");
//console("Failed to receive id");
return false;
}
$block = $this->api->block->get($idm[0], $idm[1], $tv); //TODO: meta
console($block);
//console($block);
$level->setBlock($tv, $block, true, false, true);
}
}
public function build($level, $centerX, $centerY, $centerZ){
console("b");
//console("b");
$tempVector = new Vector3(0,0,0);
$x = $centerX - $this->radius;
$z = $centerZ - $this->radius;
@ -54,7 +55,7 @@ abstract class Structure{
foreach($blocksXZ as $blocks){
foreach(str_split($blocks) as $block){
$tempVector->setXYZ($x, $centerY + $offsetY, $z);
console("6#&_+7$:373-");
//console("6#&_+7$:373-");
$this->placeBlock($level, $block, $tempVector);
++$x;
}