mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Implement Copper variant of existing blocks (#6839)
This commit is contained in:
committed by
GitHub
parent
32db9f9136
commit
06a75759bb
@@ -43,6 +43,7 @@ use pocketmine\block\ChiseledBookshelf;
|
||||
use pocketmine\block\ChorusFlower;
|
||||
use pocketmine\block\CocoaBlock;
|
||||
use pocketmine\block\Copper;
|
||||
use pocketmine\block\CopperLantern;
|
||||
use pocketmine\block\DaylightSensor;
|
||||
use pocketmine\block\DetectorRail;
|
||||
use pocketmine\block\Dirt;
|
||||
@@ -661,6 +662,25 @@ final class VanillaBlockMappings{
|
||||
])
|
||||
->properties([$commonProperties->slabPositionProperty])
|
||||
);
|
||||
|
||||
$reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_BARS())->idComponents([...$commonProperties->copperIdPrefixes, "copper_bars"]));
|
||||
$reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_CHAIN())
|
||||
->idComponents([...$commonProperties->copperIdPrefixes, "copper_chain"])
|
||||
->properties([$commonProperties->pillarAxis])
|
||||
);
|
||||
$reg->mapFlattenedId(FlattenedIdModel::create(Blocks::COPPER_LANTERN())
|
||||
->idComponents([...$commonProperties->copperIdPrefixes, "copper_lantern"])
|
||||
->properties([
|
||||
new BoolProperty(StateNames::HANGING, fn(CopperLantern $b) => $b->isHanging(), fn(CopperLantern $b, bool $v) => $b->setHanging($v))
|
||||
])
|
||||
);
|
||||
$reg->mapFlattenedId(FlattenedIdModel::create(Blocks::LIGHTNING_ROD())
|
||||
->idComponents([...$commonProperties->copperIdPrefixes, "lightning_rod"])
|
||||
->properties([
|
||||
$commonProperties->anyFacingClassic,
|
||||
new DummyProperty(StateNames::POWERED_BIT, false) //TODO
|
||||
])
|
||||
);
|
||||
}
|
||||
|
||||
private static function registerFlattenedEnumMappings(BlockSerializerDeserializerRegistrar $reg, CommonProperties $commonProperties) : void{
|
||||
@@ -1184,6 +1204,7 @@ final class VanillaBlockMappings{
|
||||
private static function registerTorchMappings(BlockSerializerDeserializerRegistrar $reg, CommonProperties $commonProperties) : void{
|
||||
foreach([
|
||||
[Blocks::BLUE_TORCH(), Ids::COLORED_TORCH_BLUE],
|
||||
[Blocks::COPPER_TORCH(), Ids::COPPER_TORCH],
|
||||
[Blocks::GREEN_TORCH(), Ids::COLORED_TORCH_GREEN],
|
||||
[Blocks::PURPLE_TORCH(), Ids::COLORED_TORCH_PURPLE],
|
||||
[Blocks::RED_TORCH(), Ids::COLORED_TORCH_RED],
|
||||
@@ -1355,10 +1376,6 @@ final class VanillaBlockMappings{
|
||||
new ValueFromStringProperty(StateNames::LEVER_DIRECTION, ValueMappings::getInstance()->leverFacing, fn(Lever $b) => $b->getFacing(), fn(Lever $b, LeverFacing $v) => $b->setFacing($v)),
|
||||
new BoolProperty(StateNames::OPEN_BIT, fn(Lever $b) => $b->isActivated(), fn(Lever $b, bool $v) => $b->setActivated($v)),
|
||||
]));
|
||||
$reg->mapModel(Model::create(Blocks::LIGHTNING_ROD(), Ids::LIGHTNING_ROD)->properties([
|
||||
$commonProperties->anyFacingClassic,
|
||||
new DummyProperty(StateNames::POWERED_BIT, false) //TODO
|
||||
]));
|
||||
$reg->mapModel(Model::create(Blocks::LIT_PUMPKIN(), Ids::LIT_PUMPKIN)->properties([$commonProperties->horizontalFacingCardinal]));
|
||||
$reg->mapModel(Model::create(Blocks::LOOM(), Ids::LOOM)->properties([$commonProperties->horizontalFacingSWNE]));
|
||||
|
||||
|
Reference in New Issue
Block a user