mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-11 14:05:35 +00:00
Drop invalid entities / tile entities on chunk loading
This commit is contained in:
parent
7abf52e615
commit
ecbbcc2e8e
@ -119,6 +119,10 @@ abstract class BaseFullChunk implements FullChunk{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($nbt["Pos"][0] >> 4) !== $this->x or ($nbt["Pos"][2] >> 4) !== $this->z){
|
||||||
|
continue; //Fixes entities allocated in wrong chunks.
|
||||||
|
}
|
||||||
|
|
||||||
//TODO: add all entities
|
//TODO: add all entities
|
||||||
switch($nbt["id"]){
|
switch($nbt["id"]){
|
||||||
case DroppedItem::NETWORK_ID:
|
case DroppedItem::NETWORK_ID:
|
||||||
@ -144,6 +148,11 @@ abstract class BaseFullChunk implements FullChunk{
|
|||||||
if(!isset($nbt->id)){
|
if(!isset($nbt->id)){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(($nbt["x"] >> 4) !== $this->x or ($nbt["z"] >> 4) !== $this->z){
|
||||||
|
continue; //Fixes tiles allocated in wrong chunks.
|
||||||
|
}
|
||||||
|
|
||||||
switch($nbt["id"]){
|
switch($nbt["id"]){
|
||||||
case Tile::CHEST:
|
case Tile::CHEST:
|
||||||
new Chest($this, $nbt);
|
new Chest($this, $nbt);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user