mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
flowing water will drop blocks that it destroyed
This commit is contained in:
parent
2ad06e202f
commit
995ece3571
3 changed files with 9 additions and 3 deletions
|
|
@ -2683,7 +2683,7 @@ class Player{
|
||||||
}
|
}
|
||||||
|
|
||||||
class PlayerNull extends Player{
|
class PlayerNull extends Player{
|
||||||
|
public static $INSTANCE;
|
||||||
public function __construct(){
|
public function __construct(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@ class PocketMinecraftServer{
|
||||||
}*/
|
}*/
|
||||||
console("[INFO] Starting Minecraft PE server on " . ($this->serverip === "0.0.0.0" ? "*" : $this->serverip) . ":" . $this->port);
|
console("[INFO] Starting Minecraft PE server on " . ($this->serverip === "0.0.0.0" ? "*" : $this->serverip) . ":" . $this->port);
|
||||||
EntityRegistry::registerEntities();
|
EntityRegistry::registerEntities();
|
||||||
|
PlayerNull::$INSTANCE = new PlayerNull();
|
||||||
Feature::init();
|
Feature::init();
|
||||||
Biome::init();
|
Biome::init();
|
||||||
StaticBlock::init();
|
StaticBlock::init();
|
||||||
|
|
|
||||||
|
|
@ -134,12 +134,17 @@ class LiquidBlockDynamic extends LiquidBlock{
|
||||||
|
|
||||||
public static function trySpreadTo(Level $level, $x, $y, $z, $meta){
|
public static function trySpreadTo(Level $level, $x, $y, $z, $meta){
|
||||||
if(static::canSpreadTo($level, $x, $y, $z)){
|
if(static::canSpreadTo($level, $x, $y, $z)){
|
||||||
$id = $level->level->getBlockID($x, $y, $z);
|
[$id, $meta2] = $level->level->getBlock($x, $y, $z);
|
||||||
|
|
||||||
if($id > 0){
|
if($id > 0){
|
||||||
if(($id == LAVA || $id == STILL_LAVA) && (static::$blockID == LAVA || static::$blockID == STILL_LAVA)); //fizz
|
if(($id == LAVA || $id == STILL_LAVA) && (static::$blockID == LAVA || static::$blockID == STILL_LAVA)); //fizz
|
||||||
else{
|
else{
|
||||||
//TODO spawnResources
|
//TODO better way to spawn resources
|
||||||
|
$drop = BlockAPI::get($id, $meta2, 1)->getDrops(BlockAPI::getItem(0, 0, 0), PlayerNull::$INSTANCE);
|
||||||
|
$pos = new Position($x, $y, $z, $level);
|
||||||
|
foreach($drop as $item){
|
||||||
|
ServerAPI::request()->api->entity->drop($pos, BlockAPI::getItem($item[0], $item[1], $item[2]));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue