Skip to content

Adding custom blocks without CreativeInventoryInfo corrupts chunk data(?) #165

@unickorn

Description

@unickorn

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions