Implemented crimson and warped roots

This commit is contained in:
Dylan K. Taylor 2023-09-27 13:07:46 +01:00
parent ee6d551729
commit 6ec340359b
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D
7 changed files with 55 additions and 2 deletions

View File

@ -737,8 +737,10 @@ final class BlockTypeIds{
public const BIG_DRIPLEAF_HEAD = 10707;
public const BIG_DRIPLEAF_STEM = 10708;
public const PINK_PETALS = 10709;
public const CRIMSON_ROOTS = 10710;
public const WARPED_ROOTS = 10711;
public const FIRST_UNUSED_BLOCK_ID = 10710;
public const FIRST_UNUSED_BLOCK_ID = 10712;
private static int $nextDynamicId = self::FIRST_UNUSED_BLOCK_ID;

39
src/block/NetherRoots.php Normal file
View File

@ -0,0 +1,39 @@
<?php
/*
*
* ____ _ _ __ __ _ __ __ ____
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* @author PocketMine Team
* @link http://www.pocketmine.net/
*
*
*/
declare(strict_types=1);
namespace pocketmine\block;
use pocketmine\block\utils\StaticSupportTrait;
use pocketmine\math\Facing;
final class NetherRoots extends Flowable{
use StaticSupportTrait;
private function canBeSupportedAt(Block $block) : bool{
//TODO: nylium, moss
$supportBlock = $block->getSide(Facing::DOWN);
return
$supportBlock->hasTypeTag(BlockTypeTags::DIRT) ||
$supportBlock->hasTypeTag(BlockTypeTags::MUD);
}
}

View File

@ -222,6 +222,7 @@ use function strtolower;
* @method static Wood CRIMSON_HYPHAE()
* @method static Planks CRIMSON_PLANKS()
* @method static WoodenPressurePlate CRIMSON_PRESSURE_PLATE()
* @method static NetherRoots CRIMSON_ROOTS()
* @method static FloorSign CRIMSON_SIGN()
* @method static WoodenSlab CRIMSON_SLAB()
* @method static WoodenStairs CRIMSON_STAIRS()
@ -740,6 +741,7 @@ use function strtolower;
* @method static Wood WARPED_HYPHAE()
* @method static Planks WARPED_PLANKS()
* @method static WoodenPressurePlate WARPED_PRESSURE_PLATE()
* @method static NetherRoots WARPED_ROOTS()
* @method static FloorSign WARPED_SIGN()
* @method static WoodenSlab WARPED_SLAB()
* @method static WoodenStairs WARPED_STAIRS()
@ -1535,6 +1537,10 @@ final class VanillaBlocks{
self::register("twisting_vines", new NetherVines(new BID(Ids::TWISTING_VINES), "Twisting Vines", new Info(BreakInfo::instant()), Facing::UP));
self::register("weeping_vines", new NetherVines(new BID(Ids::WEEPING_VINES), "Weeping Vines", new Info(BreakInfo::instant()), Facing::DOWN));
$netherRootsInfo = new Info(BreakInfo::instant(), [Tags::POTTABLE_PLANTS]);
self::register("crimson_roots", new NetherRoots(new BID(Ids::CRIMSON_ROOTS), "Crimson Roots", $netherRootsInfo));
self::register("warped_roots", new NetherRoots(new BID(Ids::WARPED_ROOTS), "Warped Roots", $netherRootsInfo));
self::register("chain", new Chain(new BID(Ids::CHAIN), "Chain", new Info(BreakInfo::pickaxe(5.0, ToolTier::WOOD))));
}

View File

@ -737,6 +737,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
$this->mapSimple(Blocks::CRACKED_NETHER_BRICKS(), Ids::CRACKED_NETHER_BRICKS);
$this->mapSimple(Blocks::CRACKED_POLISHED_BLACKSTONE_BRICKS(), Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS);
$this->mapSimple(Blocks::CRAFTING_TABLE(), Ids::CRAFTING_TABLE);
$this->mapSimple(Blocks::CRIMSON_ROOTS(), Ids::CRIMSON_ROOTS);
$this->mapSimple(Blocks::CRYING_OBSIDIAN(), Ids::CRYING_OBSIDIAN);
$this->mapSimple(Blocks::DANDELION(), Ids::YELLOW_FLOWER);
$this->mapSimple(Blocks::DEAD_BUSH(), Ids::DEADBUSH);
@ -953,6 +954,7 @@ final class BlockObjectToStateSerializer implements BlockStateSerializer{
$this->mapSimple(Blocks::TINTED_GLASS(), Ids::TINTED_GLASS);
$this->mapSimple(Blocks::TUFF(), Ids::TUFF);
$this->mapSimple(Blocks::WARPED_WART_BLOCK(), Ids::WARPED_WART_BLOCK);
$this->mapSimple(Blocks::WARPED_ROOTS(), Ids::WARPED_ROOTS);
$this->mapSimple(Blocks::WITHER_ROSE(), Ids::WITHER_ROSE);
}

View File

@ -629,6 +629,7 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
$this->mapSimple(Ids::CRACKED_NETHER_BRICKS, fn() => Blocks::CRACKED_NETHER_BRICKS());
$this->mapSimple(Ids::CRACKED_POLISHED_BLACKSTONE_BRICKS, fn() => Blocks::CRACKED_POLISHED_BLACKSTONE_BRICKS());
$this->mapSimple(Ids::CRAFTING_TABLE, fn() => Blocks::CRAFTING_TABLE());
$this->mapSimple(Ids::CRIMSON_ROOTS, fn() => Blocks::CRIMSON_ROOTS());
$this->mapSimple(Ids::CRYING_OBSIDIAN, fn() => Blocks::CRYING_OBSIDIAN());
$this->mapSimple(Ids::DEADBUSH, fn() => Blocks::DEAD_BUSH());
$this->mapSimple(Ids::DEEPSLATE_BRICKS, fn() => Blocks::DEEPSLATE_BRICKS());
@ -843,6 +844,7 @@ final class BlockStateToObjectDeserializer implements BlockStateDeserializer{
$this->mapSimple(Ids::TUFF, fn() => Blocks::TUFF());
$this->mapSimple(Ids::UNDYED_SHULKER_BOX, fn() => Blocks::SHULKER_BOX());
$this->mapSimple(Ids::WARPED_WART_BLOCK, fn() => Blocks::WARPED_WART_BLOCK());
$this->mapSimple(Ids::WARPED_ROOTS, fn() => Blocks::WARPED_ROOTS());
$this->mapSimple(Ids::WATERLILY, fn() => Blocks::LILY_PAD());
$this->mapSimple(Ids::WEB, fn() => Blocks::COBWEB());
$this->mapSimple(Ids::WITHER_ROSE, fn() => Blocks::WITHER_ROSE());

View File

@ -287,6 +287,7 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("crimson_hyphae", fn() => Blocks::CRIMSON_HYPHAE()->setStripped(false));
$result->registerBlock("crimson_planks", fn() => Blocks::CRIMSON_PLANKS());
$result->registerBlock("crimson_pressure_plate", fn() => Blocks::CRIMSON_PRESSURE_PLATE());
$result->registerBlock("crimson_roots", fn() => Blocks::CRIMSON_ROOTS());
$result->registerBlock("crimson_sign", fn() => Blocks::CRIMSON_SIGN());
$result->registerBlock("crimson_slab", fn() => Blocks::CRIMSON_SLAB());
$result->registerBlock("crimson_stairs", fn() => Blocks::CRIMSON_STAIRS());
@ -1104,6 +1105,7 @@ final class StringToItemParser extends StringToTParser{
$result->registerBlock("warped_hyphae", fn() => Blocks::WARPED_HYPHAE()->setStripped(false));
$result->registerBlock("warped_planks", fn() => Blocks::WARPED_PLANKS());
$result->registerBlock("warped_pressure_plate", fn() => Blocks::WARPED_PRESSURE_PLATE());
$result->registerBlock("warped_roots", fn() => Blocks::WARPED_ROOTS());
$result->registerBlock("warped_sign", fn() => Blocks::WARPED_SIGN());
$result->registerBlock("warped_slab", fn() => Blocks::WARPED_SLAB());
$result->registerBlock("warped_stairs", fn() => Blocks::WARPED_STAIRS());

File diff suppressed because one or more lines are too long