Closed diamond-gold closed 1 year ago
The creative inventory is riddled with bugs that don't make any sense. The item is implemented and you can obtain it using /give
.
It is missing from server-side creative inventory, not a client issue
foreach (CreativeInventory::getInstance()->getAll() as $item) {
$block = $item->getBlock();
if($block instanceof DyedCandle) {
var_dump($block->getColor()->getDisplayName());
}
}
string(5) "White"
string(6) "Orange"
string(7) "Magenta"
string(10) "Light Blue"
string(6) "Yellow"
string(4) "Lime"
string(4) "Pink"
string(4) "Gray"
string(10) "Light Gray"
string(4) "Cyan"
string(6) "Purple"
string(5) "Brown"
string(5) "Green"
string(3) "Red"
string(5) "Black"
If it is added like this it appears in the creative inventory correctly
CreativeInventory::getInstance()->add(VanillaBlocks::DYED_CANDLE()->setColor(DyeColor::BLUE())->asItem());
That is strange indeed. It does appear in creativeitems.json here:
https://github.com/pmmp/BedrockData/blob/master/creativeitems.json#L4288
However, the blockstate data appears to be missing, which is likely why the item is missing - most likely an exception was thrown because of the missing properties, which would have been caught here: https://github.com/pmmp/PocketMine-MP/blob/stable/src/crafting/CraftingManagerFromDataHelper.php#L145
Bear in mind that creativeitems.json was generated from BDS using a MITM tool though - there's a possibility that the data sent by BDS itself is bogus. In any case, I'll look into it.
It looks like blue_candle
is the first block to appear in the palette, so its first state has a runtimeID of 0.
That results in this check thinking there is no interesting data: https://github.com/pmmp/PocketMine-MP/blob/stable/tools/generate-bedrock-data-from-packets.php#L149
Since 0 is a valid blockstate ID, but 0 is also used to signify "no blockstate", this is problematic to fix.
Issue description
Blue Candle is missing from Creative Inventory
Steps to reproduce the issue
OS and versions
Plugins
None