mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 02:08:21 +00:00
ItemBlock: reference blocks directly (take 2)
This was first attempted in f64dc01bd1
, but reverted, since I hadn't considered how to handle stripping state data from blocks.
This removes the abusable API RuntimeBlockStateRegistry::fromTypeId() and related methods. These were only used to allow ItemBlocks to magically start referencing other blocks if the blocks were overridden by a plugin, but this was never a well-supported use-case anyway.
Instead of relying on RuntimeBlockStateRegistry, we remember the state that the block had during its constructor, and use that to normalize the non-item properties for asItem().
closes #5609
This commit is contained in:
@ -38,7 +38,7 @@ class UnknownBlock extends Transparent{
|
||||
$this->stateData = $stateData;
|
||||
}
|
||||
|
||||
protected function describeType(RuntimeDataDescriber $w) : void{
|
||||
public function describeType(RuntimeDataDescriber $w) : void{
|
||||
//use type instead of state, so we don't lose any information like colour
|
||||
//this might be an improperly registered plugin block
|
||||
$w->int(Block::INTERNAL_STATE_DATA_BITS, $this->stateData);
|
||||
|
Reference in New Issue
Block a user