mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49: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{
|
||||
|
||||
public static $INSTANCE;
|
||||
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);
|
||||
EntityRegistry::registerEntities();
|
||||
PlayerNull::$INSTANCE = new PlayerNull();
|
||||
Feature::init();
|
||||
Biome::init();
|
||||
StaticBlock::init();
|
||||
|
|
|
|||
|
|
@ -134,12 +134,17 @@ class LiquidBlockDynamic extends LiquidBlock{
|
|||
|
||||
public static function trySpreadTo(Level $level, $x, $y, $z, $meta){
|
||||
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 == LAVA || $id == STILL_LAVA) && (static::$blockID == LAVA || static::$blockID == STILL_LAVA)); //fizz
|
||||
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