Closed ShadowMikado closed 6 months ago
I got this same issue, but it would only occur when running on windows. On linux it worked fine. (Same PMMP Version and Customies Version)
Oh, that's strange. Someone told me to remove line 180
in CustomiesBlockFactory (CreativeInventory::getInstance()->add($block->asItem())
). It works, but the custom item is not in creative inventory. I myself found a temporary fix to have the item in the creative inventory:
public function onEnable(): void {
$id = BlockTypeIds::newId();
$creativeInfo = new CreativeInventoryInfo(CreativeInventoryInfo::CATEGORY_NATURE, CreativeInventoryInfo::GROUP_MISC_FOOD);
CustomiesBlockFactory::getInstance()->registerBlock(
static fn () => new MyCustomBlock(new BlockIdentifier($id), "Custom Block", new BlockTypeInfo(new BlockBreakInfo(1))),
"customies:custom_block",
null,
$creativeInfo
);
CreativeInventory::getInstance()->add(CustomiesBlockFactory::getInstance()->get("customies:custom_block")->asItem())
}
Hi I've this error
[AsyncWorker#0 thread/CRITICAL]: ErrorException: "Invalid callback , no array or string given" (EXCEPTION) in "pmsrc/src/inventory/CreativeInventory" at line 122
And this is my code
I've try an another plugin (not by me) and this error is always here