From 72dc07458c0d6ad5f87ed3538ecafe5f5a82bee3 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 14 Aug 2026 16:45:59 +0800 Subject: [PATCH] carried_grass & carried_leaves --- src/API/BlockAPI.php | 6 ++++++ src/constants/BlockIDs.php | 4 ++++ src/material/block/CarriedGrassBlock.php | 8 ++++++++ src/material/block/CarriedLeavesBlock.php | 8 ++++++++ 4 files changed, 26 insertions(+) create mode 100644 src/material/block/CarriedGrassBlock.php create mode 100644 src/material/block/CarriedLeavesBlock.php diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 74280a33..f5bde21c 100755 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -860,6 +860,12 @@ class BlockAPI{ public static function convertHighItemIdsToOldItemIds(int $protocolId, int $itemId, int $metaData = 0) : int{ //TODO Id metadata if ($protocolId >= ProtocolInfo12::CURRENT_PROTOCOL_11) { + if($itemId === LEAVES_CARRIED || $itemId === GRASS_CARRIED){ + return match ($itemId){ + LEAVES_CARRIED => LEAVES, + GRASS_CARRIED => GRASS, + }; + } return $itemId; } diff --git a/src/constants/BlockIDs.php b/src/constants/BlockIDs.php index 7db0855f..d061084a 100755 --- a/src/constants/BlockIDs.php +++ b/src/constants/BlockIDs.php @@ -175,4 +175,8 @@ define("NETHER_REACTOR", 247); define("INFO_UPDATE", 248); define("INFO_UPDATE2", 249); +//0.2 - 0.7: 253 & 254 +define("GRASS_CARRIED", 253); +define("LEAVES_CARRIED", 254); + define("RESERVED6", 255); \ No newline at end of file diff --git a/src/material/block/CarriedGrassBlock.php b/src/material/block/CarriedGrassBlock.php new file mode 100644 index 00000000..93638a4a --- /dev/null +++ b/src/material/block/CarriedGrassBlock.php @@ -0,0 +1,8 @@ +