diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 6fa0b8952..6134b40f6 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -337,7 +337,7 @@ class BlockAPI{ return $this->cancelAction($block, $player); } - if($hand->isFlowable === false and $player->entity->inBlock($block)){ + if($hand->isSolid === true and $player->entity->inBlock($block)){ return $this->cancelAction($block, $player); //Entity in block } diff --git a/src/material/Block.php b/src/material/Block.php index b0cde019b..0779525b8 100644 --- a/src/material/Block.php +++ b/src/material/Block.php @@ -140,12 +140,14 @@ abstract class Block extends Position{ public $isActivable = false; public $breakable = true; public $isFlowable = false; + public $isSolid = true; public $isTransparent = false; public $isReplaceable = false; public $isPlaceable = true; public $level = false; public $hasPhysics = false; public $isLiquid = false; + public $isFullBlock = true; public $x = 0; public $y = 0; public $z = 0; diff --git a/src/material/block/DoorBlock.php b/src/material/block/DoorBlock.php index 4c86f27c9..7024deb65 100644 --- a/src/material/block/DoorBlock.php +++ b/src/material/block/DoorBlock.php @@ -28,6 +28,8 @@ the Free Software Foundation, either version 3 of the License, or class DoorBlock extends TransparentBlock{ public function __construct($id, $meta = 0, $name = "Unknown"){ parent::__construct($id, $meta, $name); + $this->isSolid = false; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ diff --git a/src/material/block/FlowableBlock.php b/src/material/block/FlowableBlock.php index 8f8524efb..6902b79fa 100644 --- a/src/material/block/FlowableBlock.php +++ b/src/material/block/FlowableBlock.php @@ -29,5 +29,7 @@ class FlowableBlock extends TransparentBlock{ public function __construct($id, $meta = 0, $name = "Unknown"){ parent::__construct($id, $meta, $name); $this->isFlowable = true; + $this->isFullBlock = false; + $this->isSolid = false; } } \ No newline at end of file diff --git a/src/material/block/LiquidBlock.php b/src/material/block/LiquidBlock.php index 67f320fae..183273299 100644 --- a/src/material/block/LiquidBlock.php +++ b/src/material/block/LiquidBlock.php @@ -31,5 +31,7 @@ class LiquidBlock extends TransparentBlock{ $this->isLiquid = true; $this->breakable = false; $this->isReplaceable = true; + $this->isSolid = false; + $this->isFullBlock = true; } } \ No newline at end of file diff --git a/src/material/block/SolidBlock.php b/src/material/block/SolidBlock.php index 0636feb45..7e65ce741 100644 --- a/src/material/block/SolidBlock.php +++ b/src/material/block/SolidBlock.php @@ -28,5 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class SolidBlock extends GenericBlock{ public function __construct($id, $meta = 0, $name = "Unknown"){ parent::__construct($id, $meta, $name); + $this->isSolid = true; + $this->isFullBlock = true; } } \ No newline at end of file diff --git a/src/material/block/StairBlock.php b/src/material/block/StairBlock.php index f1db2e913..451ce5f58 100644 --- a/src/material/block/StairBlock.php +++ b/src/material/block/StairBlock.php @@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class StairBlock extends TransparentBlock{ public function __construct($id, $meta = 0, $name = "Unknown"){ parent::__construct($id, $meta, $name); + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ diff --git a/src/material/block/TransparentBlock.php b/src/material/block/TransparentBlock.php index 1e89de1e2..da965ba98 100644 --- a/src/material/block/TransparentBlock.php +++ b/src/material/block/TransparentBlock.php @@ -33,6 +33,7 @@ class TransparentBlock extends GenericBlock{ $this->isFlowable = false; $this->isTransparent = true; $this->isReplaceable = false; - $this->isPlaceable = true; + $this->isPlaceable = true; + $this->isSolid = true; } } \ No newline at end of file diff --git a/src/material/block/attachable/Ladder.php b/src/material/block/attachable/Ladder.php index e380037c9..3f542f3dc 100644 --- a/src/material/block/attachable/Ladder.php +++ b/src/material/block/attachable/Ladder.php @@ -28,6 +28,8 @@ the Free Software Foundation, either version 3 of the License, or class LadderBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(LADDER, $meta, "Ladder"); + $this->isSolid = false; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if($target->isTransparent === false){ diff --git a/src/material/block/attachable/SignPost.php b/src/material/block/attachable/SignPost.php index 353a5e702..133f94cde 100644 --- a/src/material/block/attachable/SignPost.php +++ b/src/material/block/attachable/SignPost.php @@ -28,6 +28,8 @@ the Free Software Foundation, either version 3 of the License, or class SignPostBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(SIGN_POST, $meta, "Sign Post"); + $this->isSolid = false; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ diff --git a/src/material/block/attachable/Torch.php b/src/material/block/attachable/Torch.php index 55c96971c..bc1cf2edd 100644 --- a/src/material/block/attachable/Torch.php +++ b/src/material/block/attachable/Torch.php @@ -43,7 +43,7 @@ class TorchBlock extends FlowableBlock{ 0 => 0, ); - if($this->getSide($faces[$side])->isFlowable === true){ //Replace wit common break method + if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === FENCE)){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/attachable/Trapdoor.php b/src/material/block/attachable/Trapdoor.php index 71f9ce5ae..37e3caaf2 100644 --- a/src/material/block/attachable/Trapdoor.php +++ b/src/material/block/attachable/Trapdoor.php @@ -29,6 +29,7 @@ class TrapdoorBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(TRAPDOOR, $meta, "Trapdoor"); $this->isActivable = true; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if(($target->isTransparent === false or $target->getID() === SLAB) and $face !== 0 and $face !== 1){ diff --git a/src/material/block/misc/Air.php b/src/material/block/misc/Air.php index fba707b3f..953a6845d 100644 --- a/src/material/block/misc/Air.php +++ b/src/material/block/misc/Air.php @@ -35,6 +35,9 @@ class AirBlock extends TransparentBlock{ $this->isReplaceable = true; $this->isPlaceable = false; $this->hasPhysics = false; + $this->isSolid = false; + $this->isFullBlock = true; + } } \ No newline at end of file diff --git a/src/material/block/misc/Bed.php b/src/material/block/misc/Bed.php index 2c7505ac5..8a0aa4e52 100644 --- a/src/material/block/misc/Bed.php +++ b/src/material/block/misc/Bed.php @@ -29,6 +29,7 @@ class BedBlock extends TransparentBlock{ public function __construct($type = 0){ parent::__construct(BED_BLOCK, $type, "Bed Block"); $this->isActivable = true; + $this->isFullBlock = false; } public function onActivate(Item $item, Player $player){ diff --git a/src/material/block/misc/Fire.php b/src/material/block/misc/Fire.php index 358561186..14f798ea9 100644 --- a/src/material/block/misc/Fire.php +++ b/src/material/block/misc/Fire.php @@ -30,6 +30,8 @@ class FireBlock extends FlowableBlock{ parent::__construct(FIRE, $meta, "Fire"); $this->isReplaceable = true; $this->breakable = false; + $this->isFullBlock = true; + } } \ No newline at end of file diff --git a/src/material/block/plant/BrownMushroom.php b/src/material/block/plant/BrownMushroom.php index 85dd73431..b0348dcd2 100644 --- a/src/material/block/plant/BrownMushroom.php +++ b/src/material/block/plant/BrownMushroom.php @@ -28,12 +28,11 @@ the Free Software Foundation, either version 3 of the License, or class BrownMushroomBlock extends FlowableBlock{ public function __construct(){ parent::__construct(BROWN_MUSHROOM, 0, "Brown Mushroom"); - $this->isFlowable = true; } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/Cactus.php b/src/material/block/plant/Cactus.php index 2d11f3661..0b4cea186 100644 --- a/src/material/block/plant/Cactus.php +++ b/src/material/block/plant/Cactus.php @@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class CactusBlock extends TransparentBlock{ public function __construct(){ parent::__construct(CACTUS, 0, "Cactus"); + $this->isFullBlock = false; } public function onUpdate($type){ @@ -49,7 +50,7 @@ class CactusBlock extends TransparentBlock{ $block1 = $this->getSide(3); $block2 = $this->getSide(4); $block3 = $this->getSide(5); - if($block0->isFlowable === true and $block1->isFlowable === true and $block2->isFlowable === true and $block3->isFlowable === true){ + if($block0->isTransparent === true and $block1->isTransparent === true and $block2->isTransparent === true and $block3->isTransparent === true){ $this->level->setBlock($block, $this); return true; } diff --git a/src/material/block/plant/CyanFlower.php b/src/material/block/plant/CyanFlower.php index 146769543..af45f2f81 100644 --- a/src/material/block/plant/CyanFlower.php +++ b/src/material/block/plant/CyanFlower.php @@ -28,7 +28,6 @@ the Free Software Foundation, either version 3 of the License, or class CyanFlowerBlock extends FlowableBlock{ public function __construct(){ parent::__construct(CYAN_FLOWER, 0, "Cyan Flower"); - $this->isFlowable = true; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ @@ -42,7 +41,7 @@ class CyanFlowerBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/Dandelion.php b/src/material/block/plant/Dandelion.php index 6503b3157..4e3d4a0f7 100644 --- a/src/material/block/plant/Dandelion.php +++ b/src/material/block/plant/Dandelion.php @@ -28,7 +28,6 @@ the Free Software Foundation, either version 3 of the License, or class DandelionBlock extends FlowableBlock{ public function __construct(){ parent::__construct(DANDELION, 0, "Dandelion"); - $this->isFlowable = true; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ @@ -42,7 +41,7 @@ class DandelionBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/DeadBush.php b/src/material/block/plant/DeadBush.php index bd15e9ef9..963ef1e52 100644 --- a/src/material/block/plant/DeadBush.php +++ b/src/material/block/plant/DeadBush.php @@ -28,13 +28,12 @@ the Free Software Foundation, either version 3 of the License, or class DeadBushBlock extends FlowableBlock{ public function __construct(){ parent::__construct(DEAD_BUSH, 0, "Dead Bush"); - $this->isFlowable = true; $this->isReplaceable = true; } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; } diff --git a/src/material/block/plant/MelonStem.php b/src/material/block/plant/MelonStem.php index 05b5c2539..86cbc51c6 100644 --- a/src/material/block/plant/MelonStem.php +++ b/src/material/block/plant/MelonStem.php @@ -25,7 +25,7 @@ the Free Software Foundation, either version 3 of the License, or */ -class MelonStemBlock extends TransparentBlock{ +class MelonStemBlock extends FlowableBlock{ public function __construct($meta = 0){ parent::__construct(MELON_STEM, $meta, "Melon Stem"); $this->isActivable = true; @@ -41,7 +41,7 @@ class MelonStemBlock extends TransparentBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(MELON_SEEDS, 0, mt_rand(0, 2))); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/RedMushroom.php b/src/material/block/plant/RedMushroom.php index 353cbb443..dc16df6df 100644 --- a/src/material/block/plant/RedMushroom.php +++ b/src/material/block/plant/RedMushroom.php @@ -28,12 +28,11 @@ the Free Software Foundation, either version 3 of the License, or class RedMushroomBlock extends FlowableBlock{ public function __construct(){ parent::__construct(RED_MUSHROOM, 0, "Red Mushroom"); - $this->isFlowable = true; } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/Sapling.php b/src/material/block/plant/Sapling.php index 4c093c6bf..143c1bd47 100644 --- a/src/material/block/plant/Sapling.php +++ b/src/material/block/plant/Sapling.php @@ -25,7 +25,7 @@ the Free Software Foundation, either version 3 of the License, or */ -class SaplingBlock extends TransparentBlock{ +class SaplingBlock extends FlowableBlock{ const OAK = 0; const SPRUCE = 1; const BIRCH = 2; @@ -34,7 +34,6 @@ class SaplingBlock extends TransparentBlock{ public function __construct($meta = Sapling::OAK){ parent::__construct(SAPLING, $meta, "Sapling"); $this->isActivable = true; - $this->isFlowable = true; $names = array( 0 => "Oak Sapling", 1 => "Spruce Sapling", @@ -61,7 +60,7 @@ class SaplingBlock extends TransparentBlock{ } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/Sugarcane.php b/src/material/block/plant/Sugarcane.php index b26bc401d..b10edbdc4 100644 --- a/src/material/block/plant/Sugarcane.php +++ b/src/material/block/plant/Sugarcane.php @@ -25,7 +25,7 @@ the Free Software Foundation, either version 3 of the License, or */ -class SugarcaneBlock extends TransparentBlock{ +class SugarcaneBlock extends FlowableBlock{ public function __construct(){ parent::__construct(SUGARCANE_BLOCK, 0, "Sugarcane"); } @@ -38,7 +38,7 @@ class SugarcaneBlock extends TransparentBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SUGARCANE)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/plant/TallGrass.php b/src/material/block/plant/TallGrass.php index c20a96b6e..6ed5ee0fd 100644 --- a/src/material/block/plant/TallGrass.php +++ b/src/material/block/plant/TallGrass.php @@ -28,7 +28,6 @@ the Free Software Foundation, either version 3 of the License, or class TallGrassBlock extends FlowableBlock{ public function __construct($meta = 1){ parent::__construct(TALL_GRASS, $meta, "Tall Grass"); - $this->isFlowable = true; $this->isReplaceable = true; $names = array( 0 => "Dead Shrub", @@ -40,7 +39,7 @@ class TallGrassBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; } diff --git a/src/material/block/plant/Wheat.php b/src/material/block/plant/Wheat.php index a31d15388..33ec972ce 100644 --- a/src/material/block/plant/Wheat.php +++ b/src/material/block/plant/Wheat.php @@ -51,7 +51,7 @@ class WheatBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isFlowable === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace wit common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(WHEAT_SEEDS, 0, 1)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnace.php index 760997e7c..1611c5ec4 100644 --- a/src/material/block/solid/BurningFurnace.php +++ b/src/material/block/solid/BurningFurnace.php @@ -25,7 +25,6 @@ the Free Software Foundation, either version 3 of the License, or */ - class BurningFurnaceBlock extends SolidBlock{ public function __construct($meta = 0){ parent::__construct(BURNING_FURNACE, $meta, "Burning Furnace"); diff --git a/src/material/block/solid/Cake.php b/src/material/block/solid/Cake.php index 38ced332f..7309b31bd 100644 --- a/src/material/block/solid/Cake.php +++ b/src/material/block/solid/Cake.php @@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class CakeBlock extends TransparentBlock{ public function __construct(){ parent::__construct(CAKE_BLOCK, 0, "Cake Block"); + $this->isFullBlock = false; } } \ No newline at end of file diff --git a/src/material/block/solid/Cobweb.php b/src/material/block/solid/Cobweb.php index eeee02147..3433336f0 100644 --- a/src/material/block/solid/Cobweb.php +++ b/src/material/block/solid/Cobweb.php @@ -25,9 +25,11 @@ the Free Software Foundation, either version 3 of the License, or */ -class CobwebBlock extends TransparentBlock{ +class CobwebBlock extends FlowableBlock{ public function __construct(){ - parent::__construct(COBWEB, 0, "Cobweb"); + parent::__construct(COBWEB, 0, "Cobweb"); + $this->isSolid = true; + $this->isFullBlock = false; } public function getDrops(Item $item, Player $player){ return array(); diff --git a/src/material/block/solid/Fence.php b/src/material/block/solid/Fence.php index 1be6f048d..1c9bd0197 100644 --- a/src/material/block/solid/Fence.php +++ b/src/material/block/solid/Fence.php @@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class FenceBlock extends TransparentBlock{ public function __construct(){ parent::__construct(FENCE, 0, "Fence"); + $this->isFullBlock = false; } } \ No newline at end of file diff --git a/src/material/block/solid/FenceGate.php b/src/material/block/solid/FenceGate.php index 55a2709ac..152b885e6 100644 --- a/src/material/block/solid/FenceGate.php +++ b/src/material/block/solid/FenceGate.php @@ -29,6 +29,7 @@ class FenceGateBlock extends TransparentBlock{ public function __construct($meta = 0){ parent::__construct(FENCE_GATE, $meta, "Fence Gate"); $this->isActivable = true; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $faces = array( diff --git a/src/material/block/solid/GlassPane.php b/src/material/block/solid/GlassPane.php index d0a2bb36a..74b4b1fc2 100644 --- a/src/material/block/solid/GlassPane.php +++ b/src/material/block/solid/GlassPane.php @@ -28,6 +28,7 @@ the Free Software Foundation, either version 3 of the License, or class GlassPaneBlock extends TransparentBlock{ public function __construct(){ parent::__construct(GLASS_PANE, 0, "Glass Pane"); + $this->isFullBlock = false; } } \ No newline at end of file diff --git a/src/material/block/solid/Slab.php b/src/material/block/solid/Slab.php index 78520575c..4c708d3a4 100644 --- a/src/material/block/solid/Slab.php +++ b/src/material/block/solid/Slab.php @@ -38,7 +38,8 @@ class SlabBlock extends TransparentBlock{ 6 => "Nether Brick", 7 => "Quartz", ); - $this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab"; + $this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab"; + $this->isFullBlock = false; } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ diff --git a/src/material/block/solid/SnowLayer.php b/src/material/block/solid/SnowLayer.php index 119d5ddc3..e9f77d81e 100644 --- a/src/material/block/solid/SnowLayer.php +++ b/src/material/block/solid/SnowLayer.php @@ -29,6 +29,7 @@ class SnowLayerBlock extends FlowableBlock{ public function __construct($meta = 0){ parent::__construct(SNOW_LAYER, $meta, "Snow Layer"); $this->isReplaceable = true; + $this->isSolid = false; } } \ No newline at end of file diff --git a/src/material/item/generic/Painting.php b/src/material/item/generic/Painting.php index 5bfc1eddf..9bf023670 100644 --- a/src/material/item/generic/Painting.php +++ b/src/material/item/generic/Painting.php @@ -32,7 +32,7 @@ class PaintingItem extends Item{ } public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ - if($target->isTransparent === false and $face > 1 and $block->isFlowable === true){ + if($target->isTransparent === false and $face > 1 and $block->isSolid === false){ $server = ServerAPI::request(); $faces = array( 2 => 1, diff --git a/src/world/Entity.php b/src/world/Entity.php index 717b10fbb..96bd37067 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -352,7 +352,7 @@ class Entity extends Position{ $v = new Vector3($x, $y, $z); if($this->isSupport($v, $this->size)){ $b = $this->level->getBlock($v); - if($b->isFlowable !== true){ + if($b->isSolid === true){ $support = true; break; } @@ -383,7 +383,7 @@ class Entity extends Position{ $z = (int) ($this->z - 0.5); $lim = (int) floor($ny); for($y = (int) ceil($this->y) - 1; $y >= $lim; --$y){ - if($this->level->getBlock(new Vector3($x, $y, $z))->isFlowable !== true){ + if($this->level->getBlock(new Vector3($x, $y, $z))->isSolid === true){ $ny = $y + 1; $this->speedY = 0; $this->support = true; @@ -406,7 +406,8 @@ class Entity extends Position{ } if($this->class === ENTITY_FALLING){ $fall = $this->level->getBlock(new Vector3(intval($this->x - 0.5), intval(ceil($this->y)), intval($this->z - 0.5))); - if($fall->getID() !== AIR and $fall->isFlowable){ + $down = $this->level->getBlock(new Vector3(intval($this->x - 0.5), intval(ceil($this->y)), intval($this->z - 0.5))); + if($fall->isFullBlock === false or $down->isFullBlock === false){ $this->server->api->entity->drop($this, BlockAPI::getItem($this->data["Tile"] & 0xFFFF, 0, 1), true); }else{ $this->level->setBlock($fall, BlockAPI::get($this->data["Tile"]));