mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Added mud and packed mud
This commit is contained in:
parent
a7313ed9d9
commit
b13f333b2e
@ -702,5 +702,5 @@ final class BlockTypeIds{
|
||||
public const CHORUS_FLOWER = 10675;
|
||||
public const CHORUS_PLANT = 10676;
|
||||
|
||||
public const FIRST_UNUSED_BLOCK_ID = 10676;
|
||||
public const FIRST_UNUSED_BLOCK_ID = 10677;
|
||||
}
|
||||
|
@ -29,10 +29,14 @@ use pocketmine\data\runtime\RuntimeDataWriter;
|
||||
use pocketmine\item\Fertilizer;
|
||||
use pocketmine\item\Hoe;
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Potion;
|
||||
use pocketmine\item\PotionType;
|
||||
use pocketmine\item\SplashPotion;
|
||||
use pocketmine\math\Facing;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\player\Player;
|
||||
use pocketmine\world\sound\ItemUseOnBlockSound;
|
||||
use pocketmine\world\sound\WaterSplashSound;
|
||||
|
||||
class Dirt extends Opaque{
|
||||
protected DirtType $dirtType;
|
||||
@ -79,6 +83,11 @@ class Dirt extends Opaque{
|
||||
$item->pop();
|
||||
$world->setBlock($down->position, VanillaBlocks::HANGING_ROOTS());
|
||||
//TODO: bonemeal particles, growth sounds
|
||||
}elseif(($item instanceof Potion || $item instanceof SplashPotion) && $item->getType()->equals(PotionType::WATER())){
|
||||
$item->pop();
|
||||
$world->setBlock($this->position, VanillaBlocks::MUD());
|
||||
$world->addSound($this->position, new WaterSplashSound(0.5));
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
|
@ -495,6 +495,7 @@ use function mb_strtolower;
|
||||
* @method static Slab MOSSY_STONE_BRICK_SLAB()
|
||||
* @method static Stair MOSSY_STONE_BRICK_STAIRS()
|
||||
* @method static Wall MOSSY_STONE_BRICK_WALL()
|
||||
* @method static Opaque MUD()
|
||||
* @method static Opaque MUD_BRICKS()
|
||||
* @method static Slab MUD_BRICK_SLAB()
|
||||
* @method static Stair MUD_BRICK_STAIRS()
|
||||
@ -534,6 +535,7 @@ use function mb_strtolower;
|
||||
* @method static Flower ORANGE_TULIP()
|
||||
* @method static Flower OXEYE_DAISY()
|
||||
* @method static PackedIce PACKED_ICE()
|
||||
* @method static Opaque PACKED_MUD()
|
||||
* @method static DoublePlant PEONY()
|
||||
* @method static Flower PINK_TULIP()
|
||||
* @method static Podzol PODZOL()
|
||||
@ -1520,6 +1522,9 @@ final class VanillaBlocks{
|
||||
}
|
||||
|
||||
private static function registerMudBlocks() : void{
|
||||
self::register("mud", new Opaque(new BID(Ids::MUD), "Mud", new BreakInfo(0.5, ToolType::SHOVEL)));
|
||||
self::register("packed_mud", new Opaque(new BID(Ids::PACKED_MUD), "Packed Mud", new BreakInfo(1.0, ToolType::PICKAXE, 0, 15.0)));
|
||||
|
||||
$mudBricksBreakInfo = new BreakInfo(2.0, ToolType::PICKAXE, ToolTier::WOOD()->getHarvestLevel(), 30.0);
|
||||
|
||||
self::register("mud_bricks", new Opaque(new BID(Ids::MUD_BRICKS), "Mud Bricks", $mudBricksBreakInfo));
|
||||
|
@ -510,6 +510,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
$this->mapSimple(Blocks::MELON(), Ids::MELON_BLOCK);
|
||||
$this->mapSimple(Blocks::MONSTER_SPAWNER(), Ids::MOB_SPAWNER);
|
||||
$this->mapSimple(Blocks::MOSSY_COBBLESTONE(), Ids::MOSSY_COBBLESTONE);
|
||||
$this->mapSimple(Blocks::MUD(), Ids::MUD);
|
||||
$this->mapSimple(Blocks::MUD_BRICKS(), Ids::MUD_BRICKS);
|
||||
$this->mapSimple(Blocks::MYCELIUM(), Ids::MYCELIUM);
|
||||
$this->mapSimple(Blocks::NETHERITE(), Ids::NETHERITE_BLOCK);
|
||||
@ -523,6 +524,7 @@ final class BlockObjectToBlockStateSerializer implements BlockStateSerializer{
|
||||
$this->mapSimple(Blocks::NOTE_BLOCK(), Ids::NOTEBLOCK);
|
||||
$this->mapSimple(Blocks::OBSIDIAN(), Ids::OBSIDIAN);
|
||||
$this->mapSimple(Blocks::PACKED_ICE(), Ids::PACKED_ICE);
|
||||
$this->mapSimple(Blocks::PACKED_MUD(), Ids::PACKED_MUD);
|
||||
$this->mapSimple(Blocks::PODZOL(), Ids::PODZOL);
|
||||
$this->mapSimple(Blocks::POLISHED_BLACKSTONE(), Ids::POLISHED_BLACKSTONE);
|
||||
$this->mapSimple(Blocks::POLISHED_BLACKSTONE_BRICKS(), Ids::POLISHED_BLACKSTONE_BRICKS);
|
||||
|
@ -360,6 +360,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
$this->map(Ids::MELON_BLOCK, fn() => Blocks::MELON());
|
||||
$this->map(Ids::MOB_SPAWNER, fn() => Blocks::MONSTER_SPAWNER());
|
||||
$this->map(Ids::MOSSY_COBBLESTONE, fn() => Blocks::MOSSY_COBBLESTONE());
|
||||
$this->map(Ids::MUD, fn() => Blocks::MUD());
|
||||
$this->map(Ids::MUD_BRICKS, fn() => Blocks::MUD_BRICKS());
|
||||
$this->map(Ids::MYCELIUM, fn() => Blocks::MYCELIUM());
|
||||
$this->map(Ids::NETHER_BRICK, fn() => Blocks::NETHER_BRICKS());
|
||||
@ -372,6 +373,7 @@ final class BlockStateToBlockObjectDeserializer implements BlockStateDeserialize
|
||||
$this->map(Ids::NOTEBLOCK, fn() => Blocks::NOTE_BLOCK());
|
||||
$this->map(Ids::OBSIDIAN, fn() => Blocks::OBSIDIAN());
|
||||
$this->map(Ids::PACKED_ICE, fn() => Blocks::PACKED_ICE());
|
||||
$this->map(Ids::PACKED_MUD, fn() => Blocks::PACKED_MUD());
|
||||
$this->map(Ids::PODZOL, fn() => Blocks::PODZOL());
|
||||
$this->map(Ids::POLISHED_BLACKSTONE, fn() => Blocks::POLISHED_BLACKSTONE());
|
||||
$this->map(Ids::POLISHED_BLACKSTONE_BRICKS, fn() => Blocks::POLISHED_BLACKSTONE_BRICKS());
|
||||
|
@ -774,6 +774,7 @@ final class StringToItemParser extends StringToTParser{
|
||||
$result->registerBlock("mossy_stone_brick_stairs", fn() => Blocks::MOSSY_STONE_BRICK_STAIRS());
|
||||
$result->registerBlock("mossy_stone_brick_wall", fn() => Blocks::MOSSY_STONE_BRICK_WALL());
|
||||
$result->registerBlock("mossy_stone_bricks", fn() => Blocks::MOSSY_STONE_BRICKS());
|
||||
$result->registerBlock("mud", fn() => Blocks::MUD());
|
||||
$result->registerBlock("mud_bricks", fn() => Blocks::MUD_BRICKS());
|
||||
$result->registerBlock("mud_brick_slab", fn() => Blocks::MUD_BRICK_SLAB());
|
||||
$result->registerBlock("mud_brick_stairs", fn() => Blocks::MUD_BRICK_STAIRS());
|
||||
@ -824,6 +825,7 @@ final class StringToItemParser extends StringToTParser{
|
||||
$result->registerBlock("orange_tulip", fn() => Blocks::ORANGE_TULIP());
|
||||
$result->registerBlock("oxeye_daisy", fn() => Blocks::OXEYE_DAISY());
|
||||
$result->registerBlock("packed_ice", fn() => Blocks::PACKED_ICE());
|
||||
$result->registerBlock("packed_mud", fn() => Blocks::PACKED_MUD());
|
||||
$result->registerBlock("peony", fn() => Blocks::PEONY());
|
||||
$result->registerBlock("pink_tulip", fn() => Blocks::PINK_TULIP());
|
||||
$result->registerBlock("plank", fn() => Blocks::OAK_PLANKS());
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user