some fixes

This commit is contained in:
ArkQuark 2023-02-21 15:14:26 +03:00
parent 6cbc3824f3
commit b6934024da
4 changed files with 11 additions and 4 deletions

View file

@ -24,6 +24,7 @@ class BlockAPI{
[SANDSTONE, 1],
[SANDSTONE, 2],
[SAND, 0],
[SAND, 1],
[GRAVEL, 0],
[TRUNK, 0],
[TRUNK, 1],

View file

@ -1484,7 +1484,7 @@ class Player{
$this->server->api->player->spawnToAllPlayers($this);
$this->server->api->entity->spawnAll($this);
$this->server->api->entity->spawnToAll($this->entity);
$this->server->api->chat->broadcast($this->username." joined the game.");
$this->server->api->chat->broadcast($this->username." joined the game");
$this->server->schedule(5, [$this->entity, "update"], [], true);
$this->server->schedule(2, [$this->entity, "updateMovement"], [], true);
@ -1497,7 +1497,7 @@ class Player{
/*$this->sendInventory();
$this->sendSettings();*/
$this->orderChunks();
//$this->getNextChunk($this->level);
//$this->getNextChunk($this->level);
$this->loadAllChunks();
$this->blocked = false;

View file

@ -18,6 +18,7 @@ define("STILL_WATER", 9);
define("LAVA", 10);
define("STILL_LAVA", 11);
define("SAND", 12);
define("RED_SAND", "12:1");
define("GRAVEL", 13);
define("GOLD_ORE", 14);
define("IRON_ORE", 15);

View file

@ -1,8 +1,13 @@
<?php
class SandBlock extends FallableBlock{
public function __construct(){
parent::__construct(SAND, 0, "Sand");
public function __construct($meta = 0){
parent::__construct(SAND, $meta, "Sand");
$names = [
0 => "Sand",
1 => "Red Sand"
];
$this->name = $names[$this->meta];
$this->hardness = 2.5;
}