Skeleton for copper blocks, stairs and slabs

This commit is contained in:
Dylan K. Taylor
2022-07-10 00:18:35 +01:00
parent a44c089f98
commit 260e54e4b1
15 changed files with 369 additions and 2 deletions

View File

@ -25,6 +25,7 @@ namespace pocketmine\item;
use pocketmine\block\Block;
use pocketmine\block\Light;
use pocketmine\block\utils\CopperOxidation;
use pocketmine\block\utils\CoralType;
use pocketmine\block\utils\DyeColor;
use pocketmine\block\utils\SkullType;
@ -77,6 +78,18 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("light_block_$i", fn() => Blocks::LIGHT()->setLightLevel($i));
}
foreach(CopperOxidation::getAll() as $oxidation){
$oxPrefix = $oxidation->equals(CopperOxidation::NONE()) ? "" : $oxidation->name() . "_";
foreach(["" => false, "waxed_" => true] as $waxedPrefix => $waxed){
$prefix = $waxedPrefix . $oxPrefix;
$result->registerBlock($prefix . "copper_block", fn() => Blocks::COPPER()->setOxidation($oxidation)->setWaxed($waxed));
$result->registerBlock($prefix . "cut_copper_block", fn() => Blocks::CUT_COPPER()->setOxidation($oxidation)->setWaxed($waxed));
$result->registerBlock($prefix . "cut_copper_stairs", fn() => Blocks::CUT_COPPER_STAIRS()->setOxidation($oxidation)->setWaxed($waxed));
$result->registerBlock($prefix . "cut_copper_slab", fn() => Blocks::CUT_COPPER_SLAB()->setOxidation($oxidation)->setWaxed($waxed));
}
}
$result->registerBlock("acacia_button", fn() => Blocks::ACACIA_BUTTON());
$result->registerBlock("acacia_door", fn() => Blocks::ACACIA_DOOR());
$result->registerBlock("acacia_door_block", fn() => Blocks::ACACIA_DOOR());