idk what freehij added

Co-authored-by: FreeHij <111121573+FreeHij@users.noreply.github.com>
This commit is contained in:
GameHerobrine 2023-07-22 10:26:02 +03:00
parent 6fbd52c1a5
commit 31fbbd86e7
7 changed files with 49 additions and 6 deletions

View file

@ -62,6 +62,8 @@ class BlockAPI{
[WOODEN_SLAB, 1],
[WOODEN_SLAB, 2],
[WOODEN_SLAB, 3],
[WOODEN_SLAB, 4],
[WOODEN_SLAB, 5],
[SLAB, 3],
[SLAB, 4],
[SLAB, 5],
@ -81,10 +83,30 @@ class BlockAPI{
[BROWN_MUSHROOM_BLOCK, 0],
[RED_MUSHROOM_BLOCK, 0],
[MYCELIUM, 0],
[PODZOL, 0],
[STAINED_CLAY, 0],
[STAINED_CLAY, 1],
[STAINED_CLAY, 2],
[STAINED_CLAY, 3],
[STAINED_CLAY, 4],
[STAINED_CLAY, 5],
[STAINED_CLAY, 6],
[STAINED_CLAY, 7],
[STAINED_CLAY, 8],
[STAINED_CLAY, 9],
[STAINED_CLAY, 10],
[STAINED_CLAY, 11],
[STAINED_CLAY, 12],
[STAINED_CLAY, 13],
[STAINED_CLAY, 14],
[STAINED_CLAY, 15],
[HARDENED_CLAY, 0],
[END_STONE, 0],
//Decoration
[COBBLESTONE_WALL, 0],
[COBBLESTONE_WALL, 1],
[LILY_PAD, 0],
[GOLD_BLOCK, 0],
[IRON_BLOCK, 0],
[DIAMOND_BLOCK, 0],
@ -93,6 +115,7 @@ class BlockAPI{
[SNOW_LAYER, 0],
[GLASS, 0],
[GLOWSTONE_BLOCK, 0],
[VINES, 0],
[NETHER_REACTOR, 0],
[WOOL, 0],
[WOOL, 7],
@ -157,7 +180,7 @@ class BlockAPI{
[LEAVES, 2],
[LEAVES, 3],
[LEAVES2, 0],
[LEAVES2, 0],
[LEAVES2, 1],
[CAKE, 0],
[SIGN, 0],
[CARPET, 0],

View file

@ -143,11 +143,14 @@ abstract class Block extends Position{
LEAVES2 => "Leaves2Block",
END_PORTAL_FRAME => "EndPortalFrameBlock",
COCOA => "CocoaBlock",
RED_MUSHROOM_BLOCK => "RedMushroomSolidBlock",
BROWN_MUSHROOM_BLOCK => "BrownMushroomSolidBlock",
MONSTER_SPAWNER => "MobSpawnerBlock",
RED_MUSHROOM_BLOCK => "RedMushroomBlock",
BROWN_MUSHROOM_BLOCK => "BrownMushroomBlock",
MONSTER_SPAWNER => "MonsterSpawnerBlock",
VINES => "VinesBlock",
MYCELIUM => "MyceliumBlock",
PODZOL => "PodzolBlock",
STAINED_CLAY => "StainedClayBlock",
LILY_PAD => "LilypadBlock",
);
protected $id;
protected $meta;

View file

@ -8,6 +8,8 @@ class WoodSlabBlock extends TransparentBlock{
1 => "Spruce",
2 => "Birch",
3 => "Jungle",
4 => "Acacia",
5 => "Dark Oak"
);
$this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Wooden Slab";
if(($this->meta & 0x08) === 0x08){

View file

@ -0,0 +1,13 @@
<?php
class LilypadBlock extends FlowableBlock{
public function __construct($meta = 0){
parent::__construct(LILY_PAD, 0, "Lily Pad");
$this->isSolid = false;
$this->isFullBlock = false;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){//TODO: directions & only on water placement, im too lazy to make it cuz it's 0:17
$this->level->setBlock($block, $this, true, false, true);
}
}

View file

@ -8,7 +8,7 @@ class VinesBlock extends FlowableBlock{
$this->hardness = 2;
}
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){
public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){//TODO: make replacement
if($face === 0 || $face === 1){
return false; //fix of placing invalid ids without array
}

View file

@ -8,6 +8,8 @@ class DoubleWoodSlabBlock extends SolidBlock{
1 => "Spruce",
2 => "Birch",
3 => "Jungle",
4 => "Acacia",
5 => "Dark Oak",
);
$this->name = "Double " . $names[$this->meta & 0x07] . " Wooden Slab";
$this->hardness = 15;

View file

@ -21,7 +21,7 @@ class Log2Block extends SolidBlock{
5 => 0b0100,
);
$this->meta = ($this->meta & 0x02) | $faces[$face];
$this->meta = ($this->meta & 0x03) | $faces[$face];
$this->level->setBlock($block, $this, true, false, true);
return true;
}