mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 00:07:30 +00:00
Implemented slime blocks
This commit is contained in:
parent
8e2486b96a
commit
df3b112877
@ -323,7 +323,7 @@ class BlockFactory{
|
||||
$this->register(new SeaLantern(new BID(Ids::SEALANTERN, 0), "Sea Lantern", new BlockBreakInfo(0.3)));
|
||||
$this->register(new SeaPickle(new BID(Ids::SEA_PICKLE, 0), "Sea Pickle", BlockBreakInfo::instant()));
|
||||
$this->register(new Skull(new BID(Ids::MOB_HEAD_BLOCK, 0, ItemIds::SKULL, TileSkull::class), "Mob Head", new BlockBreakInfo(1.0)));
|
||||
|
||||
$this->register(new Slime(new BID(Ids::SLIME, 0), "Slime Block", BlockBreakInfo::instant()));
|
||||
$this->register(new Snow(new BID(Ids::SNOW, 0), "Snow Block", new BlockBreakInfo(0.2, BlockToolType::SHOVEL, ToolTier::WOOD()->getHarvestLevel())));
|
||||
$this->register(new SnowLayer(new BID(Ids::SNOW_LAYER, 0), "Snow Layer", new BlockBreakInfo(0.1, BlockToolType::SHOVEL, ToolTier::WOOD()->getHarvestLevel())));
|
||||
$this->register(new SoulSand(new BID(Ids::SOUL_SAND, 0), "Soul Sand", new BlockBreakInfo(0.5, BlockToolType::SHOVEL)));
|
||||
@ -580,7 +580,6 @@ class BlockFactory{
|
||||
//TODO: minecraft:repeating_command_block
|
||||
//TODO: minecraft:scaffolding
|
||||
//TODO: minecraft:seagrass
|
||||
//TODO: minecraft:slime
|
||||
//TODO: minecraft:smithing_table
|
||||
//TODO: minecraft:sticky_piston
|
||||
//TODO: minecraft:stonecutter_block
|
||||
|
44
src/block/Slime.php
Normal file
44
src/block/Slime.php
Normal file
@ -0,0 +1,44 @@
|
||||
<?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\entity\Entity;
|
||||
use pocketmine\entity\Living;
|
||||
|
||||
final class Slime extends Transparent{
|
||||
|
||||
public function getFrictionFactor() : float{
|
||||
return 0.8; //???
|
||||
}
|
||||
|
||||
public function onEntityLand(Entity $entity) : ?float{
|
||||
if($entity instanceof Living && $entity->isSneaking()){
|
||||
return null;
|
||||
}
|
||||
$entity->resetFallDistance();
|
||||
return -$entity->getMotion()->y;
|
||||
}
|
||||
|
||||
//TODO: slime blocks should slow entities walking on them to about 0.4x original speed
|
||||
}
|
@ -489,6 +489,7 @@ use function assert;
|
||||
* @method static SeaLantern SEA_LANTERN()
|
||||
* @method static SeaPickle SEA_PICKLE()
|
||||
* @method static ShulkerBox SHULKER_BOX()
|
||||
* @method static Slime SLIME()
|
||||
* @method static Furnace SMOKER()
|
||||
* @method static Opaque SMOOTH_QUARTZ()
|
||||
* @method static Slab SMOOTH_QUARTZ_SLAB()
|
||||
@ -1054,6 +1055,7 @@ final class VanillaBlocks{
|
||||
self::register("sea_lantern", $factory->get(169, 0));
|
||||
self::register("sea_pickle", $factory->get(411, 0));
|
||||
self::register("shulker_box", $factory->get(205, 0));
|
||||
self::register("slime", $factory->get(165, 0));
|
||||
self::register("smoker", $factory->get(453, 2));
|
||||
self::register("smooth_quartz", $factory->get(155, 3));
|
||||
self::register("smooth_quartz_slab", $factory->get(421, 1));
|
||||
|
File diff suppressed because one or more lines are too long
Loading…
x
Reference in New Issue
Block a user