Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3d8bb7d
Support 0.7.6
Mar 13, 2025
08d04e4
Support MCPE && MCPI 0.6.1 test && Fix MessagePacket in MCPE 0.7.4
Mar 15, 2025
ad42a6a
MCPE 0.5.0 Protocol List
yefengeeeeeeeeeee Mar 15, 2025
61ffae5
MCPE 0.5.0 Protocol List && Stupid PC
yefengeeeeeeeeeee Mar 16, 2025
7f70c87
MovePlayerPacket fixed
yefengeeeeeeeeeee Mar 16, 2025
8a14186
Merge branch 'kotyaralih:master' into master
yefengeeeeeeeeeee Mar 17, 2025
50cc72b
MovePlayerPacket fixed
yefengeeeeeeeeeee Mar 19, 2025
8988b22
Fixed logs
yefengeeeeeeeeeee Mar 19, 2025
6cfc8f1
Blame this changes xdd
yefengeeeeeeeeeee Mar 19, 2025
e428f39
Support MCPE 0.3.2 - 0.6.0
yefengeeeeeeeeeee Mar 22, 2025
b5f11e5
Merge branch 'master' into masteruwu
yefengeeeeeeeeeee Mar 22, 2025
a05848c
Fuck Merge Conflict
yefengeeeeeeeeeee Mar 23, 2025
e4538e1
Make Merge More Easy
yefengeeeeeeeeeee Mar 25, 2025
763585d
Merge branch 'kotyaralih:master' into master
yefengeeeeeeeeeee Apr 3, 2025
a8fb9e8
Merge branch 'kotyaralih:master' into master
yefengeeeeeeeeeee Apr 7, 2025
490516f
Thanks to @ArkQuark
yefengeeeeeeeeeee Apr 8, 2025
da824ca
Merge remote-tracking branch 'origin/master'
yefengeeeeeeeeeee Apr 8, 2025
fee80da
Merge branch 'master' into master
yefengeeeeeeeeeee Apr 12, 2025
7c8f32d
Thanks to @Sunch233
yefengeeeeeeeeeee Apr 12, 2025
2712adc
Fix auto respawn bug in MCPE 0.3.2 - 0.5.0
yefengeeeeeeeeeee Apr 12, 2025
c15eeef
feat: PacketPool
Sunch233 Apr 12, 2025
ce61a10
Fuck yefeng typo && Thanks to @Sunch233
yefengeeeeeeeeeee Apr 12, 2025
23de633
Merge branch 'yefengeeeeeeeeeee:master' into master
Sunch233 Apr 12, 2025
a5e19bb
fixed packets pid mess
Sunch233 Apr 12, 2025
2803ecf
MutiVersion: clean RakNetParser
Sunch233 Apr 12, 2025
492f441
Merge pull request #1 from ScaxeTeam/master
yefengeeeeeeeeeee Apr 12, 2025
f2e82b7
Merge branch 'kotyaralih:master' into master
yefengeeeeeeeeeee Apr 13, 2025
3e438cf
Merge branch 'master' into multiversion
yefengeeeeeeeeeee Apr 14, 2025
60b802b
Merge pull request #2 from yefengeeeeeeeeeee/multiversion
yefengeeeeeeeeeee Apr 14, 2025
755c12a
Fix @Sunch233 typo
yefengeeeeeeeeeee Apr 15, 2025
eccf3e7
Seems Fix TypeError
yefengeeeeeeeeeee Apr 17, 2025
edefb7f
PlaceBlockPacket impelement
yefengeeeeeeeeeee Apr 22, 2025
6b7563d
Seem Fix Type Error
yefengeeeeeeeeeee Apr 23, 2025
fd23ba0
Conver High ItemID to Old ItemId
yefengeeeeeeeeeee Apr 25, 2025
c8fc413
Thanks to @GameHeroBrine
yefengeeeeeeeeeee Apr 26, 2025
aad0031
Fix PlaceBlock Packet handle
yefengeeeeeeeeeee Apr 27, 2025
f6ca62f
typo
Sunch233 Apr 27, 2025
fc5c562
Use PHP-CS-fixer to standardize the code style
Sunch233 Apr 27, 2025
5e8e933
code style fix
Sunch233 Apr 27, 2025
27554d2
CodeStyle: use Github CI
Sunch233 Apr 27, 2025
0049ac9
better logic
Sunch233 Apr 27, 2025
1eceb70
Merge pull request #3 from ScaxeTeam/master
yefengeeeeeeeeeee Apr 27, 2025
a992bb6
ContainerAckPacket implement
yefengeeeeeeeeeee Apr 28, 2025
2b90f64
more canonical codestyle
Sunch233 Apr 28, 2025
682de0f
Merge pull request #60 from Sunch233/master
GameHerobrine Apr 28, 2025
c3a8eca
Merge branch 'master' into pr
yefengeeeeeeeeeee Apr 29, 2025
26cafca
Merge pull request #4 from yefengeeeeeeeeeee/pr
yefengeeeeeeeeeee Apr 29, 2025
1e85a65
cs fix
Sunch233 Apr 29, 2025
179baa4
Blame yefengeee moment
yefengeeeeeeeeeee Apr 29, 2025
93df0e3
Avoid Crash if server sending the packet which didnt exist in older v…
yefengeeeeeeeeeee Apr 30, 2025
9903b8b
Fixed Wrong ProtocolVersion && Some Packet Fixed
yefengeeeeeeeeeee May 3, 2025
a365acc
Thanks to @Gameherobrine
yefengeeeeeeeeeee May 3, 2025
e3f0ed0
Thanks to @ArkQuark
yefengeeeeeeeeeee May 3, 2025
de98590
SignUpdatePacket implement
yefengeeeeeeeeeee May 3, 2025
b003448
Merge branch 'master' into pr
yefengeeeeeeeeeee May 10, 2025
e847151
Merge pull request #6 from yefengeeeeeeeeeee/pr
yefengeeeeeeeeeee May 10, 2025
3fbab46
Merge branch 'master'
yefengeeeeeeeeeee Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: CI

on:
push:
pull_request:
workflow_dispatch:

jobs:
codestyle:
name: Code Style checks
runs-on: ubuntu-latest
strategy:
fail-fast: false

steps:
- uses: actions/checkout@v4

- name: Setup PHP and tools
uses: shivammathur/setup-php@2.31.1
with:
php-version: 8.0
tools: php-cs-fixer:3.60
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Run PHP-CS-Fixer
run: php-cs-fixer fix --dry-run --diff --ansi
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ server.lock
*.txt
*.properties

# php-cs-fixer
/.php_cs.cache
/.php-cs-fixer.cache

############
## Windows
Expand Down
36 changes: 36 additions & 0 deletions .php-cs-fixer.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

$finder = PhpCsFixer\Finder::create()
->in(__DIR__ . '/src');

return (new PhpCsFixer\Config)
->setRules([
'array_indentation' => true,
'array_syntax' => [
'syntax' => 'short'
],
'binary_operator_spaces' => [
'default' => 'single_space'
],
'blank_line_after_namespace' => true,
'blank_line_after_opening_tag' => true,
'cast_spaces' => [
'space' => 'single'
],
'elseif' => true,
'indentation_type' => true,
'no_closing_tag' => true,
'no_empty_phpdoc' => true,
'no_extra_blank_lines' => true,
'no_superfluous_phpdoc_tags' => [
'allow_mixed' => true,
],
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'no_whitespace_in_blank_line' => true,
'unary_operator_spaces' => true
])
->setFinder($finder)
->setIndent("\t")
->setLineEnding("\n")
->setParallelConfig(PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect());
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

NostalgiaCore is a fork of Legacy PocketMine-MP 1.3.12, which fixes bugs of Legacy PocketMine-MP, and adds new content

Supported MCPE versions: 0.8.0, 0.8.1 (maybe 0.8.2)
Supported MCPE versions: 0.3.0 ~ 0.8.1 (maybe 0.8.2)

(Special thx to GullCraft Network and DartMiner43)

Expand Down
2 changes: 0 additions & 2 deletions src/API/ChatAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ public function broadcast($message){
/**
* @param mixed $owner Can be either Player object or string username. Boolean false for broadcast.
* @param string $text
* @param $whitelist
* @param $blacklist
*/
public function send($owner, $text, $whitelist = false, $blacklist = false){
$message = [
Expand Down
6 changes: 3 additions & 3 deletions src/API/ConsoleAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,20 +24,20 @@ public function init(){
$this->register("defaultgamemode", "<mode>", [$this, "defaultCommands"]);

$this->server->api->console->alias("tps", "status");

$this->cmdWhitelist("help");
$this->cmdWhitelist("status");
$this->cmdWhitelist("?");
}

/**
* Whitelists a CMD so everyone can issue it - Even non OPs.
* @param string $cmd Command to Whitelist
*/
public function cmdWhitelist($cmd){
$this->server->api->ban->cmdWhitelist[strtolower(trim($cmd))] = true;
}

public function register($cmd, $help, $callback){
if(!is_callable($callback)){
return false;
Expand Down
11 changes: 5 additions & 6 deletions src/API/LevelAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,15 @@ public function loadLevel($name){
console("[ERROR] Could not load level \"" . $name . "\"");
return false;
}

if(PocketMinecraftServer::$KEEP_CHUNKS_LOADED){
for($X = 0; $X < 16; ++$X){
for($Z = 0; $Z < 16; ++$Z){
$level->loadChunk($X, $Z);
}
}
}



$entities = new Config($path . "entities.yml", CONFIG_YAML);
if(file_exists($path . "tileEntities.yml")){
@rename($path . "tileEntities.yml", $path . "tiles.yml");
Expand All @@ -62,13 +61,13 @@ public function loadLevel($name){
if(!isset($entity["id"])){
break;
}

$entity["x"] = $entity["Pos"][0];
$entity["y"] = $entity["Pos"][1];
$entity["z"] = $entity["Pos"][2];
$entity["yaw"] = $entity["Rotation"][0];
$entity["pitch"] = $entity["Rotation"][1];

if($entity["id"] === 64){ //Item Drop
$e = $this->server->api->entity->add($this->levels[$name], ENTITY_ITEM, ENTITY_ITEM_TYPE, [
"meta" => $entity["Item"]["Damage"],
Expand Down Expand Up @@ -106,7 +105,7 @@ public function loadLevel($name){
foreach($blockUpdates->getAll() as $bupdate){
if($bupdate["type"] !== BLOCK_UPDATE_RANDOM) $this->server->api->block->scheduleBlockUpdate(new Position((int) $bupdate["x"], (int) $bupdate["y"], (int) $bupdate["z"], $this->levels[$name]), (float) $bupdate["delay"], (int) $bupdate["type"]);
}

return true;
}
/**
Expand Down
11 changes: 5 additions & 6 deletions src/API/PluginAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,20 +154,20 @@ private function loadAll(){
continue;
}
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(!in_array((string) CURRENT_API_VERSION, $pluginInfo["api"])){
if(!in_array((string) CURRENT_API_VERSION, $pluginInfo["api"])){
if(is_array($pluginInfo)) $s = implode(",",$pluginInfo["api"]);
else $s = $pluginInfo["api"];
console("[WARNING] API is not the same as Core, might cause bugs({$s} != {$aver})");
}

$phr = "phar://$filePath/";
include($phr."/src/".$pluginInfo["classLoader"]);
$class = $pluginInfo["CLClass"];
$loader = new $class();
$loader->loadAll($phr);

$pluginName = PharUtils::getNameSpaceClass($pluginInfo["mainFile"]);
include($phr."/src/".$pluginInfo["mainFile"]);
$plugin = new $pluginName($this->server->api, false);
Expand Down Expand Up @@ -272,7 +272,7 @@ public function initAll(){
$names[] = $p[1]["name"];
$versions[] = $p[1]["version"];
}

foreach($this->plugins as $p){
if($p[0] instanceof OtherPluginRequirement){
foreach($p[0]->getRequiredPlugins() as $required){
Expand Down Expand Up @@ -316,4 +316,3 @@ public function __construct($name, $version = false){
}
}


4 changes: 2 additions & 2 deletions src/API/ServerAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class ServerAPI{

private static $serverRequest = false;
public $restart = false;

/**
* @var QueryAPI
*/
Expand Down Expand Up @@ -59,7 +59,7 @@ class ServerAPI{
* @var QueryHandler
*/
public $query;

private $asyncCalls = [];
private $server;
private $config;
Expand Down
6 changes: 3 additions & 3 deletions src/API/TileAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public function getXYZ(Level $level, $x, $y, $z){
}
return false;
}

public function invalidateAll(Level $level, $x, $y, $z){
$x = (int) $x;
$y = (int) $y;
Expand All @@ -31,14 +31,14 @@ public function invalidateAll(Level $level, $x, $y, $z){
++$invcnt;
$tl->close();
}

if($invcnt > 1){
ConsoleAPI::warn("{$level->getName()}: ($x $y $z) has more than 1 tile entity! Invalidated ID {$t["ID"]} (Total invaliated: $invcnt)");
}
}
}
}

public function get(Position $pos){
$tile = $this->server->query("SELECT * FROM tiles WHERE level = '" . $pos->level->getName() . "' AND x = {$pos->x} AND y = {$pos->y} AND z = {$pos->z};", true);
if($tile !== false and $tile !== true and ($tile = $this->getByID($tile["ID"])) !== false){
Expand Down
1 change: 0 additions & 1 deletion src/API/TimeAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -175,5 +175,4 @@ public function sunset(){
return $this->set("sunset");
}


}
1 change: 0 additions & 1 deletion src/Deprecation.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php


class Deprecation{

public static $events = [
Expand Down
Loading
Loading