Block: Get rid of state bitmasks

This story dates back to the days when getVariantBitmask() was introduced. The purpose of this function was to allow the variant info to be extracted from the metadata, for use with item drops. This was later changed to state bitmask for reasons I don't clearly recall.
In the great 4.0 refactor, we now store variant magic numbers separately, so we don't need any generic bitmask to split up variant and state information anymore. Variant is now only ever serialized and never deserialized. The same thing goes for blockIDs. States are read from the world by matching the full stateID against a table of prefilled known blocks, so the variant doesn't need to be deserialized - only the state does, and the state metadata readers already do bit fuckery by themselves and don't need this mask - notice how little actual changes were required to get rid of this?
This commit is contained in:
Dylan K. Taylor
2019-02-24 14:42:53 +00:00
parent 023fecabac
commit b7b05e729e
53 changed files with 10 additions and 247 deletions

View File

@ -45,10 +45,6 @@ class NetherWartPlant extends Flowable{
$this->age = BlockDataValidator::readBoundedInt("age", $stateMeta, 0, 3);
}
public function getStateBitmask() : int{
return 0b11;
}
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, ?Player $player = null) : bool{
$down = $this->getSide(Facing::DOWN);
if($down->getId() === Block::SOUL_SAND){