Tested on a clean server:
class StoneBlock extends Block implements BlockComponents
{
use BlockComponentsTrait;
public function __construct(BlockIdentifier $idInfo, string $name, BlockTypeInfo $typeInfo) {
parent::__construct($idInfo, $name, $typeInfo);
$this->addComponent(new MaterialInstancesComponent([
new Material(
Material::TARGET_ALL,
"stone",
Material::RENDER_METHOD_OPAQUE
),
]));
}
}
CustomiesBlockFactory::getInstance()->registerBlock(static function () {
return new StoneBlock(new BID(BlockTypeIds::newId()),
"Stone Block", new BlockTypeInfo(new BlockBreakInfo(3.0)));
}, "custom:block");
Breaks something with the type IDs, that result in about any block placed showing up as a bunch of random other blocks around the place target to the client.
Registering with CreativeInventoryInfo passed as the last argument to registerBlock works as expected.
Tested on a clean server:
Breaks something with the type IDs, that result in about any block placed showing up as a bunch of random other blocks around the place target to the client.
Registering with CreativeInventoryInfo passed as the last argument to registerBlock works as expected.