121 public readonly array $coralIdPrefixes;
126 public readonly array $copperIdPrefixes;
132 public readonly array $furnaceIdPrefixes;
138 public readonly array $liquidIdPrefixes;
144 public readonly array $woodIdPrefixes;
150 public readonly array $buttonProperties;
156 public readonly array $campfireProperties;
162 public readonly array $doorProperties;
168 public readonly array $fenceGateProperties;
174 public readonly array $itemFrameProperties;
180 public readonly array $simplePressurePlateProperties;
186 public readonly array $stairProperties;
192 public readonly array $stemProperties;
198 public readonly array $trapdoorProperties;
204 public readonly array $wallProperties;
206 private function __construct(){
207 $vm = ValueMappings::getInstance();
211 $this->horizontalFacingCardinal =
new ValueFromStringProperty(StateNames::MC_CARDINAL_DIRECTION, $vm->cardinalDirection, $hfGet, $hfSet);
214 StateNames::MC_BLOCK_FACE,
221 StateNames::PILLAR_AXIS,
228 StateNames::TORCH_FACING_DIRECTION,
234 $this->horizontalFacingSWNE =
new ValueFromIntProperty(StateNames::DIRECTION, $vm->horizontalFacingSWNE, $hfGet, $hfSet);
235 $this->horizontalFacingSWNEInverted =
new ValueFromIntProperty(StateNames::DIRECTION, $vm->horizontalFacingSWNEInverted, $hfGet, $hfSet);
236 $this->horizontalFacingClassic =
new ValueFromIntProperty(StateNames::FACING_DIRECTION, $vm->horizontalFacingClassic, $hfGet, $hfSet);
239 StateNames::FACING_DIRECTION,
246 StateNames::MULTI_FACE_DIRECTION_BITS,
248 Facing::DOWN => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_DOWN,
249 Facing::UP => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_UP,
250 Facing::NORTH => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_NORTH,
251 Facing::SOUTH => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_SOUTH,
252 Facing::WEST => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_WEST,
253 Facing::EAST => BlockLegacyMetadata::MULTI_FACE_DIRECTION_FLAG_EAST
263 $this->cropAgeMax7 =
new IntProperty(StateNames::GROWTH, 0, 7, fn(
Ageable $b) => $b->getAge(), fn(
Ageable $b,
int $v) => $b->setAge($v));
266 $fallingFlag = BlockLegacyMetadata::LIQUID_FALLING_FLAG;
268 StateNames::LIQUID_DEPTH,
271 fn(
Liquid $b) => $b->getDecay() | ($b->isFalling() ? $fallingFlag : 0),
272 fn(
Liquid $b,
int $v) => $b->setDecay($v & ~$fallingFlag)->setFalling(($v & $fallingFlag) !== 0)
277 $this->dummyCardinalDirection =
new DummyProperty(StateNames::MC_CARDINAL_DIRECTION, BlockStateStringValues::MC_CARDINAL_DIRECTION_SOUTH);
278 $this->dummyPillarAxis =
new DummyProperty(StateNames::PILLAR_AXIS, BlockStateStringValues::PILLAR_AXIS_Y);
287 fn(
Slab $b) => $b->getSlabType() === SlabType::DOUBLE,
293 fn(
Slab $b,
bool $v) => $b->setSlabType($v ? SlabType::DOUBLE : SlabType::BOTTOM)
296 StateNames::MC_VERTICAL_HALF,
297 BlockStateStringValues::MC_VERTICAL_HALF_BOTTOM,
298 BlockStateStringValues::MC_VERTICAL_HALF_TOP,
299 fn(
Slab $b) => $b->getSlabType() === SlabType::TOP,
302 fn(
Slab $b,
bool $v) => $b->getSlabType() !== SlabType::DOUBLE ? $b->setSlabType($v ? SlabType::TOP : SlabType::BOTTOM) :
null
305 $this->coralIdPrefixes = [
309 CoralType::BRAIN =>
"brain",
310 CoralType::BUBBLE =>
"bubble",
311 CoralType::FIRE =>
"fire",
312 CoralType::HORN =>
"horn",
313 CoralType::TUBE =>
"tube"
316 $this->copperIdPrefixes = [
320 CopperOxidation::NONE =>
"",
321 CopperOxidation::EXPOSED =>
"exposed_",
322 CopperOxidation::WEATHERED =>
"weathered_",
323 CopperOxidation::OXIDIZED =>
"oxidized_",
329 $this->liquidIdPrefixes = [
334 $this->woodIdPrefixes = [
339 $this->buttonProperties = [
341 new BoolProperty(StateNames::BUTTON_PRESSED_BIT, fn(
Button $b) => $b->isPressed(), fn(
Button $b,
bool $v) => $b->setPressed($v)),
344 $this->campfireProperties = [
350 $this->doorProperties = [
351 new BoolProperty(StateNames::UPPER_BLOCK_BIT, fn(
Door $b) => $b->isTop(), fn(
Door $b,
bool $v) => $b->setTop($v)),
352 new BoolProperty(StateNames::DOOR_HINGE_BIT, fn(
Door $b) => $b->isHingeRight(), fn(
Door $b,
bool $v) => $b->setHingeRight($v)),
353 new BoolProperty(StateNames::OPEN_BIT, fn(
Door $b) => $b->isOpen(), fn(
Door $b,
bool $v) => $b->setOpen($v)),
355 StateNames::MC_CARDINAL_DIRECTION,
358 Facing::NORTH => BlockStateStringValues::MC_CARDINAL_DIRECTION_EAST,
359 Facing::EAST => BlockStateStringValues::MC_CARDINAL_DIRECTION_SOUTH,
360 Facing::SOUTH => BlockStateStringValues::MC_CARDINAL_DIRECTION_WEST,
361 Facing::WEST => BlockStateStringValues::MC_CARDINAL_DIRECTION_NORTH
368 $this->fenceGateProperties = [
374 $this->itemFrameProperties = [
380 $this->simplePressurePlateProperties = [
384 StateNames::REDSTONE_SIGNAL,
392 $this->stairProperties = [
393 new BoolProperty(StateNames::UPSIDE_DOWN_BIT, fn(
Stair $b) => $b->isUpsideDown(), fn(
Stair $b,
bool $v) => $b->setUpsideDown($v)),
394 new ValueFromIntProperty(StateNames::WEIRDO_DIRECTION, $vm->horizontalFacing5Minus, $hfGet, $hfSet),
397 $this->stemProperties = [
402 $this->trapdoorProperties = [
411 new BoolProperty(StateNames::WALL_POST_BIT, fn(
Wall $b) => $b->isPost(), fn(
Wall $b,
bool $v) => $b->setPost($v)),
414 Facing::NORTH => StateNames::WALL_CONNECTION_TYPE_NORTH,
415 Facing::SOUTH => StateNames::WALL_CONNECTION_TYPE_SOUTH,
416 Facing::WEST => StateNames::WALL_CONNECTION_TYPE_WEST,
417 Facing::EAST => StateNames::WALL_CONNECTION_TYPE_EAST
418 ] as $facing => $stateName){
422 fn(
Wall $b) => WallConnectionTypeShim::serialize($b->getConnection($facing)),
423 fn(
Wall $b, WallConnectionTypeShim $v) => $b->
setConnection($facing, $v->deserialize())
426 $this->wallProperties = $wallProperties;