From 31fbbd86e73ed2dcfbfd8daacb1856fbde661643 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sat, 22 Jul 2023 10:26:02 +0300 Subject: [PATCH] idk what freehij added Co-authored-by: FreeHij <111121573+FreeHij@users.noreply.github.com> --- src/API/BlockAPI.php | 25 ++++++++++++++++++- src/material/Block.php | 9 ++++--- src/material/block/nonfull/WoodSlabBlock.php | 2 ++ src/material/block/plant/LilypadBlock.php | 13 ++++++++++ src/material/block/plant/VinesBlock.php | 2 +- .../block/solid/DoubleWoodSlabBlock.php | 2 ++ src/material/block/solid/Log2Block.php | 2 +- 7 files changed, 49 insertions(+), 6 deletions(-) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 01a4835b..d15fda93 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -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], diff --git a/src/material/Block.php b/src/material/Block.php index 441550aa..eb93ac8c 100755 --- a/src/material/Block.php +++ b/src/material/Block.php @@ -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; diff --git a/src/material/block/nonfull/WoodSlabBlock.php b/src/material/block/nonfull/WoodSlabBlock.php index 53ebed4e..3bd9f6dc 100644 --- a/src/material/block/nonfull/WoodSlabBlock.php +++ b/src/material/block/nonfull/WoodSlabBlock.php @@ -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){ diff --git a/src/material/block/plant/LilypadBlock.php b/src/material/block/plant/LilypadBlock.php index e69de29b..403bce34 100644 --- a/src/material/block/plant/LilypadBlock.php +++ b/src/material/block/plant/LilypadBlock.php @@ -0,0 +1,13 @@ +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); + } +} \ No newline at end of file diff --git a/src/material/block/plant/VinesBlock.php b/src/material/block/plant/VinesBlock.php index 1177962b..748b8b88 100644 --- a/src/material/block/plant/VinesBlock.php +++ b/src/material/block/plant/VinesBlock.php @@ -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 } diff --git a/src/material/block/solid/DoubleWoodSlabBlock.php b/src/material/block/solid/DoubleWoodSlabBlock.php index dbe09fdf..8c9af844 100644 --- a/src/material/block/solid/DoubleWoodSlabBlock.php +++ b/src/material/block/solid/DoubleWoodSlabBlock.php @@ -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; diff --git a/src/material/block/solid/Log2Block.php b/src/material/block/solid/Log2Block.php index 253eb600..bcc66c12 100644 --- a/src/material/block/solid/Log2Block.php +++ b/src/material/block/solid/Log2Block.php @@ -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; }