diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index a23a032b7..8cc05227f 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -330,7 +330,7 @@ class BlockAPI{ $hand = $item->getBlock(); $hand->position($block); }elseif($block->getID() === FIRE){ - $player->level->setBlock($block, new AirBlock()); + $player->level->setBlock($block, new AirBlock(), true, false, true); return false; }else{ return $this->cancelAction($block, $player, false); diff --git a/src/material/block/DoorBlock.php b/src/material/block/DoorBlock.php index 2f5764a04..091a64e7f 100644 --- a/src/material/block/DoorBlock.php +++ b/src/material/block/DoorBlock.php @@ -45,10 +45,10 @@ class DoorBlock extends TransparentBlock{ if($next->getID() === $this->id or ($next2->isTransparent === false and $next->isTransparent === true)){ //Door hinge $metaUp |= 0x01; } - $this->level->setBlock($blockUp, BlockAPI::get($this->id, $metaUp)); //Top + $this->level->setBlock($blockUp, BlockAPI::get($this->id, $metaUp), true, false, true); //Top $this->meta = $direction & 0x03; - $this->level->setBlock($block, $this); //Bottom + $this->level->setBlock($block, $this, true, false, true); //Bottom return true; } return false; @@ -58,15 +58,15 @@ class DoorBlock extends TransparentBlock{ if(($this->meta & 0x08) === 0x08){ $down = $this->getSide(0); if($down->getID() === $this->id){ - $this->level->setBlock($down, new AirBlock()); + $this->level->setBlock($down, new AirBlock(), true, false, true); } }else{ $up = $this->getSide(1); if($up->getID() === $this->id){ - $this->level->setBlock($up, new AirBlock()); + $this->level->setBlock($up, new AirBlock(), true, false, true); } } - $this->level->setBlock($this, new AirBlock()); + $this->level->setBlock($this, new AirBlock(), true, false, true); return true; } @@ -75,13 +75,13 @@ class DoorBlock extends TransparentBlock{ $down = $this->getSide(0); if($down->getID() === $this->id){ $meta = $down->getMetadata() ^ 0x04; - $this->level->setBlock($down, BlockAPI::get($this->id, $meta)); + $this->level->setBlock($down, BlockAPI::get($this->id, $meta), true, false, true); return true; } return false; }else{ $this->meta ^= 0x04; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); } return true; } diff --git a/src/material/block/StairBlock.php b/src/material/block/StairBlock.php index 0bbed6d87..a72324225 100644 --- a/src/material/block/StairBlock.php +++ b/src/material/block/StairBlock.php @@ -40,7 +40,7 @@ class StairBlock extends TransparentBlock{ if(($fy > 0.5 and $face !== 1) or $face === 0){ $this->meta |= 0x04; //Upside-down stairs } - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } diff --git a/src/material/block/attachable/Ladder.php b/src/material/block/attachable/Ladder.php index bf1e16e41..c730737a1 100644 --- a/src/material/block/attachable/Ladder.php +++ b/src/material/block/attachable/Ladder.php @@ -35,7 +35,7 @@ class LadderBlock extends TransparentBlock{ ); if(isset($faces[$face])){ $this->meta = $faces[$face]; - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } } diff --git a/src/material/block/attachable/SignPost.php b/src/material/block/attachable/SignPost.php index ff20b9868..06be976b9 100644 --- a/src/material/block/attachable/SignPost.php +++ b/src/material/block/attachable/SignPost.php @@ -49,7 +49,7 @@ class SignPostBlock extends TransparentBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->getID() === AIR){ //Replace wit common break method + if($this->getSide(0)->getID() === AIR){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SIGN, 0, 1)); $this->level->setBlock($this, new AirBlock(), true, true, true); return BLOCK_UPDATE_NORMAL; diff --git a/src/material/block/attachable/Torch.php b/src/material/block/attachable/Torch.php index 4d963d3ee..c1696dd74 100644 --- a/src/material/block/attachable/Torch.php +++ b/src/material/block/attachable/Torch.php @@ -37,9 +37,9 @@ class TorchBlock extends FlowableBlock{ 0 => 0, ); - if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === FENCE)){ //Replace wit common break method + if($this->getSide($faces[$side])->isTransparent === true and !($side === 0 and $this->getSide(0)->getID() === FENCE)){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id, 0, 1)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), true, false, true); return BLOCK_UPDATE_NORMAL; } } @@ -56,11 +56,11 @@ class TorchBlock extends FlowableBlock{ 5 => 1, ); $this->meta = $faces[$face]; - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; }elseif($this->getSide(0)->isTransparent === false or $this->getSide(0)->getID() === FENCE){ $this->meta = 0; - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } return false; diff --git a/src/material/block/attachable/Trapdoor.php b/src/material/block/attachable/Trapdoor.php index 31d23e939..906875d4c 100644 --- a/src/material/block/attachable/Trapdoor.php +++ b/src/material/block/attachable/Trapdoor.php @@ -41,7 +41,7 @@ class TrapdoorBlock extends TransparentBlock{ if($fy > 0.5){ $this->meta |= 0x08; } - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } } @@ -52,7 +52,7 @@ class TrapdoorBlock extends TransparentBlock{ } public function onActivate(Item $item, Player $player){ $this->meta ^= 0x04; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); return true; } } \ No newline at end of file diff --git a/src/material/block/misc/Bed.php b/src/material/block/misc/Bed.php index 5814c9a50..47fd2ff0a 100644 --- a/src/material/block/misc/Bed.php +++ b/src/material/block/misc/Bed.php @@ -55,8 +55,8 @@ class BedBlock extends TransparentBlock{ $downNext = $this->getSide(0); if($next->isReplaceable === true and $downNext->isTransparent === false){ $meta = (($d + 3) % 4) & 0x03; - $this->level->setBlock($block, BlockAPI::get($this->id, $meta)); - $this->level->setBlock($next, BlockAPI::get($this->id, $meta | 0x08)); + $this->level->setBlock($block, BlockAPI::get($this->id, $meta), true, false, true); + $this->level->setBlock($next, BlockAPI::get($this->id, $meta | 0x08), true, false, true); return true; } } diff --git a/src/material/block/misc/Fire.php b/src/material/block/misc/Fire.php index 12e20ee41..fb0969cbf 100644 --- a/src/material/block/misc/Fire.php +++ b/src/material/block/misc/Fire.php @@ -39,11 +39,11 @@ class FireBlock extends FlowableBlock{ return false; } } - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), true, false, true); return BLOCK_UPDATE_NORMAL; }elseif($type === BLOCK_UPDATE_RANDOM){ if($this->getSide(0)->getID() !== NETHERRACK){ - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), true, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/nonfull/Cake.php b/src/material/block/nonfull/Cake.php index 495c6e4e2..87d8cf40d 100644 --- a/src/material/block/nonfull/Cake.php +++ b/src/material/block/nonfull/Cake.php @@ -29,8 +29,8 @@ class CakeBlock extends TransparentBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->getID() === AIR){ //Replace wit common break method - $this->level->setBlock($this, new AirBlock(), false); + if($this->getSide(0)->getID() === AIR){ //Replace with common break method + $this->level->setBlock($this, new AirBlock(), true, false, true); return BLOCK_UPDATE_NORMAL; } } @@ -46,9 +46,9 @@ class CakeBlock extends TransparentBlock{ ++$this->meta; $player->entity->heal(3, "cake"); if($this->meta >= 0x06){ - $this->level->setBlock($this, new AirBlock()); + $this->level->setBlock($this, new AirBlock(), true, false, true); }else{ - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); } return true; } diff --git a/src/material/block/nonfull/FenceGate.php b/src/material/block/nonfull/FenceGate.php index 86b8557dd..fefc59e32 100644 --- a/src/material/block/nonfull/FenceGate.php +++ b/src/material/block/nonfull/FenceGate.php @@ -37,7 +37,7 @@ class FenceGateBlock extends TransparentBlock{ 3 => 2, ); $this->meta = $faces[$player->entity->getDirection()] & 0x03; - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } public function getDrops(Item $item, Player $player){ @@ -53,7 +53,12 @@ class FenceGateBlock extends TransparentBlock{ 3 => 2, ); $this->meta = ($faces[$player->entity->getDirection()] & 0x03) | ((~$this->meta) & 0x04); - $this->level->setBlock($this, $this); + if(($this->meta & 0x04) === 0x04){ + $this->isFullBlock = true; + }else{ + $this->isFullBlock = false; + } + $this->level->setBlock($this, $this, true, false, true); return true; } } \ No newline at end of file diff --git a/src/material/block/nonfull/IronDoor.php b/src/material/block/nonfull/IronDoor.php index 35ac19d25..0c89759b6 100644 --- a/src/material/block/nonfull/IronDoor.php +++ b/src/material/block/nonfull/IronDoor.php @@ -27,7 +27,7 @@ class IronDoorBlock extends DoorBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->getID() === AIR){ //Replace wit common break method + if($this->getSide(0)->getID() === AIR){ //Replace with common break method $this->level->setBlock($this, new AirBlock(), false); if($this->getSide(1) instanceof DoorBlock){ $this->level->setBlock($this->getSide(1), new AirBlock(), false); diff --git a/src/material/block/nonfull/Slab.php b/src/material/block/nonfull/Slab.php index e8b6504fd..80f27bd2d 100644 --- a/src/material/block/nonfull/Slab.php +++ b/src/material/block/nonfull/Slab.php @@ -44,20 +44,20 @@ class SlabBlock extends TransparentBlock{ $this->meta &= 0x07; if($face === 0){ if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0x08 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){ - $this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta)); + $this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true); return true; }else{ $this->meta |= 0x08; } }elseif($face === 1){ if($target->getID() === SLAB and ($target->getMetadata() & 0x08) === 0 and ($target->getMetadata() & 0x07) === ($this->meta & 0x07)){ - $this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta)); + $this->level->setBlock($target, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true); return true; } }elseif(!$player->entity->inBlock($block)){ if($block->getID() === SLAB){ if(($block->getMetadata() & 0x07) === ($this->meta & 0x07)){ - $this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta)); + $this->level->setBlock($block, BlockAPI::get(DOUBLE_SLAB, $this->meta), true, false, true); return true; } return false; @@ -72,7 +72,7 @@ class SlabBlock extends TransparentBlock{ if($block->getID() === SLAB and ($target->getMetadata() & 0x07) !== ($this->meta & 0x07)){ return false; } - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } diff --git a/src/material/block/nonfull/SnowLayer.php b/src/material/block/nonfull/SnowLayer.php index 05ebc832a..7eccab533 100644 --- a/src/material/block/nonfull/SnowLayer.php +++ b/src/material/block/nonfull/SnowLayer.php @@ -29,8 +29,8 @@ class SnowLayerBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->getID() === AIR){ //Replace wit common break method - $this->level->setBlock($this, new AirBlock(), false); + if($this->getSide(0)->getID() === AIR){ //Replace with common break method + $this->level->setBlock($this, new AirBlock(), true, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/ore/GlowingRedstoneOre.php b/src/material/block/ore/GlowingRedstoneOre.php index 8cf417655..eced08216 100644 --- a/src/material/block/ore/GlowingRedstoneOre.php +++ b/src/material/block/ore/GlowingRedstoneOre.php @@ -26,7 +26,7 @@ class GlowingRedstoneOreBlock extends SolidBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_SCHEDULED or $type === BLOCK_UPDATE_RANDOM){ - $this->level->setBlock($this, BlockAPI::get(REDSTONE_ORE, $this->meta), false); + $this->level->setBlock($this, BlockAPI::get(REDSTONE_ORE, $this->meta), false, false, true); return BLOCK_UPDATE_WEAK; }else{ $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); diff --git a/src/material/block/ore/RedstoneOre.php b/src/material/block/ore/RedstoneOre.php index 87e6323c1..573972ecc 100644 --- a/src/material/block/ore/RedstoneOre.php +++ b/src/material/block/ore/RedstoneOre.php @@ -26,7 +26,7 @@ class RedstoneOreBlock extends SolidBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL or $type === BLOCK_UPDATE_TOUCH){ - $this->level->setBlock($this, BlockAPI::get(GLOWING_REDSTONE_ORE, $this->meta), false); + $this->level->setBlock($this, BlockAPI::get(GLOWING_REDSTONE_ORE, $this->meta), false, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return BLOCK_UPDATE_WEAK; } diff --git a/src/material/block/plant/BrownMushroom.php b/src/material/block/plant/BrownMushroom.php index 024ab2956..c8a627244 100644 --- a/src/material/block/plant/BrownMushroom.php +++ b/src/material/block/plant/BrownMushroom.php @@ -26,9 +26,9 @@ class BrownMushroomBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } } @@ -38,7 +38,7 @@ class BrownMushroomBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->isTransparent === false){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } return false; diff --git a/src/material/block/plant/Cactus.php b/src/material/block/plant/Cactus.php index fbe0e6b1a..bb3128164 100644 --- a/src/material/block/plant/Cactus.php +++ b/src/material/block/plant/Cactus.php @@ -28,7 +28,7 @@ class CactusBlock extends TransparentBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ $down = $this->getSide(0); - if($down->getID() !== SAND and $down->getID() !== CACTUS){ //Replace wit common break method + if($down->getID() !== SAND and $down->getID() !== CACTUS){ //Replace with common break method $this->level->setBlock($this, new AirBlock(), false); ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); return BLOCK_UPDATE_NORMAL; @@ -39,15 +39,15 @@ class CactusBlock extends TransparentBlock{ for($y = 1; $y < 3; ++$y){ $b = $this->level->getBlock(new Vector3($this->x, $this->y + $y, $this->z)); if($b->getID() === AIR){ - $this->level->setBlock($b, new CactusBlock()); + $this->level->setBlock($b, new CactusBlock(), true, false, true); break; } } $this->meta = 0; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, false); }else{ ++$this->meta; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, false); } return BLOCK_UPDATE_RANDOM; } @@ -63,7 +63,7 @@ class CactusBlock extends TransparentBlock{ $block2 = $this->getSide(4); $block3 = $this->getSide(5); if($block0->isTransparent === true and $block1->isTransparent === true and $block2->isTransparent === true and $block3->isTransparent === true){ - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return true; } diff --git a/src/material/block/plant/CyanFlower.php b/src/material/block/plant/CyanFlower.php index ce8dfdcfb..4ddb08aed 100644 --- a/src/material/block/plant/CyanFlower.php +++ b/src/material/block/plant/CyanFlower.php @@ -27,7 +27,7 @@ class CyanFlowerBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } return false; @@ -35,9 +35,9 @@ class CyanFlowerBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/plant/Dandelion.php b/src/material/block/plant/Dandelion.php index 5b8f0e60d..7c9e5aa85 100644 --- a/src/material/block/plant/Dandelion.php +++ b/src/material/block/plant/Dandelion.php @@ -27,7 +27,7 @@ class DandelionBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === 2 or $down->getID() === 3 or $down->getID() === 60){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } return false; @@ -35,9 +35,9 @@ class DandelionBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/plant/DeadBush.php b/src/material/block/plant/DeadBush.php index 00b9a5be9..2537ab720 100644 --- a/src/material/block/plant/DeadBush.php +++ b/src/material/block/plant/DeadBush.php @@ -27,8 +27,8 @@ class DeadBushBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method - $this->level->setBlock($this, new AirBlock(), false); + if($this->getSide(0)->isTransparent === true){ //Replace with common break method + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/plant/MelonStem.php b/src/material/block/plant/MelonStem.php index 9fe50c6fe..c240889aa 100644 --- a/src/material/block/plant/MelonStem.php +++ b/src/material/block/plant/MelonStem.php @@ -27,7 +27,7 @@ class MelonStemBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === FARMLAND){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return true; } @@ -36,16 +36,16 @@ class MelonStemBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with 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); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } }elseif($type === BLOCK_UPDATE_RANDOM){ if(mt_rand(0, 2) == 1){ if($this->meta < 0x07){ ++$this->meta; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); return BLOCK_UPDATE_RANDOM; }else{ for($side = 2; $side <= 5; ++$side){ @@ -57,7 +57,7 @@ class MelonStemBlock extends FlowableBlock{ $side = $this->getSide(mt_rand(2,5)); $d = $side->getSide(0); if($side->getID() === AIR and ($d->getID() === FARMLAND or $d->getID() === GRASS or $d->getID() === DIRT)){ - $this->level->setBlock($side, new MelonBlock()); + $this->level->setBlock($side, new MelonBlock(), true, false, true); } } } @@ -69,7 +69,7 @@ class MelonStemBlock extends FlowableBlock{ public function onActivate(Item $item, Player $player){ if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ $item->count--; } diff --git a/src/material/block/plant/RedMushroom.php b/src/material/block/plant/RedMushroom.php index ee755025e..e96123228 100644 --- a/src/material/block/plant/RedMushroom.php +++ b/src/material/block/plant/RedMushroom.php @@ -26,7 +26,7 @@ class RedMushroomBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); $this->level->setBlock($this, new AirBlock(), false); return BLOCK_UPDATE_NORMAL; @@ -38,7 +38,7 @@ class RedMushroomBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->isTransparent === false){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } return false; diff --git a/src/material/block/plant/Sapling.php b/src/material/block/plant/Sapling.php index 373d7b839..0b5674f8a 100644 --- a/src/material/block/plant/Sapling.php +++ b/src/material/block/plant/Sapling.php @@ -39,7 +39,7 @@ class SaplingBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === GRASS or $down->getID() === DIRT or $down->getID() === FARMLAND){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return true; } @@ -58,9 +58,9 @@ class SaplingBlock extends FlowableBlock{ } public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem($this->id)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } }elseif($type === BLOCK_UPDATE_RANDOM){ //Growth @@ -69,7 +69,7 @@ class SaplingBlock extends FlowableBlock{ TreeObject::growTree($this->level, $this, new Random(), $this->meta & 0x03); }else{ $this->meta |= 0x08; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); return BLOCK_UPDATE_RANDOM; } }else{ diff --git a/src/material/block/plant/Sugarcane.php b/src/material/block/plant/Sugarcane.php index 536e99559..233370413 100644 --- a/src/material/block/plant/Sugarcane.php +++ b/src/material/block/plant/Sugarcane.php @@ -33,9 +33,9 @@ class SugarcaneBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ $down = $this->getSide(0); - if($down->isTransparent === true and $down->getID() !== SUGARCANE_BLOCK){ //Replace wit common break method + if($down->isTransparent === true and $down->getID() !== SUGARCANE_BLOCK){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SUGARCANE)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } }elseif($type === BLOCK_UPDATE_RANDOM){ @@ -44,15 +44,15 @@ class SugarcaneBlock extends FlowableBlock{ for($y = 1; $y < 3; ++$y){ $b = $this->level->getBlock(new Vector3($this->x, $this->y + $y, $this->z)); if($b->getID() === AIR){ - $this->level->setBlock($b, new SugarcaneBlock()); + $this->level->setBlock($b, new SugarcaneBlock(), true, false, true); break; } } $this->meta = 0; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); }else{ ++$this->meta; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); } return BLOCK_UPDATE_RANDOM; } @@ -63,7 +63,7 @@ class SugarcaneBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === SUGARCANE_BLOCK){ - $this->level->setBlock($block, new SugarcaneBlock()); + $this->level->setBlock($block, new SugarcaneBlock(), true, false, true); return true; }elseif($down->getID() === GRASS or $down->getID() === DIRT or $down->getID() === SAND){ $block0 = $down->getSide(2); @@ -71,7 +71,7 @@ class SugarcaneBlock extends FlowableBlock{ $block2 = $down->getSide(4); $block3 = $down->getSide(5); if(($block0 instanceof WaterBlock) or ($block1 instanceof WaterBlock) or ($block2 instanceof WaterBlock) or ($block3 instanceof WaterBlock)){ - $this->level->setBlock($block, new SugarcaneBlock()); + $this->level->setBlock($block, new SugarcaneBlock(), true, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return true; } diff --git a/src/material/block/plant/TallGrass.php b/src/material/block/plant/TallGrass.php index 1df9e890e..bd7c1ae91 100644 --- a/src/material/block/plant/TallGrass.php +++ b/src/material/block/plant/TallGrass.php @@ -33,8 +33,8 @@ class TallGrassBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method - $this->level->setBlock($this, new AirBlock(), false); + if($this->getSide(0)->isTransparent === true){ //Replace with common break method + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } } diff --git a/src/material/block/plant/Wheat.php b/src/material/block/plant/Wheat.php index 0ba944210..70a704642 100644 --- a/src/material/block/plant/Wheat.php +++ b/src/material/block/plant/Wheat.php @@ -28,7 +28,7 @@ class WheatBlock extends FlowableBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $down = $this->getSide(0); if($down->getID() === FARMLAND){ - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); $this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM); return true; } @@ -38,7 +38,7 @@ class WheatBlock extends FlowableBlock{ public function onActivate(Item $item, Player $player){ if($item->getID() === DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ $item->count--; } @@ -49,16 +49,16 @@ class WheatBlock extends FlowableBlock{ public function onUpdate($type){ if($type === BLOCK_UPDATE_NORMAL){ - if($this->getSide(0)->isTransparent === true){ //Replace wit common break method + if($this->getSide(0)->isTransparent === true){ //Replace with common break method ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(WHEAT_SEEDS, 0, 1)); - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); return BLOCK_UPDATE_NORMAL; } }elseif($type === BLOCK_UPDATE_RANDOM){ if(mt_rand(0, 2) == 1){ if($this->meta < 0x07){ ++$this->meta; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); return BLOCK_UPDATE_RANDOM; } }else{ diff --git a/src/material/block/solid/BurningFurnace.php b/src/material/block/solid/BurningFurnace.php index 4cad1ad4e..50a40c480 100644 --- a/src/material/block/solid/BurningFurnace.php +++ b/src/material/block/solid/BurningFurnace.php @@ -33,12 +33,12 @@ class BurningFurnaceBlock extends SolidBlock{ 3 => 3, ); $this->meta = $faces[$player->entity->getDirection()]; - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); return true; } public function onBreak(Item $item, Player $player){ - $this->level->setBlock($this, new AirBlock(), true, true); + $this->level->setBlock($this, new AirBlock(), true, true, true); return true; } diff --git a/src/material/block/solid/Chest.php b/src/material/block/solid/Chest.php index b76168ccf..32f015ba2 100644 --- a/src/material/block/solid/Chest.php +++ b/src/material/block/solid/Chest.php @@ -51,7 +51,7 @@ class ChestBlock extends TransparentBlock{ } } - $this->level->setBlock($block, $this); + $this->level->setBlock($block, $this, true, false, true); $tile = $server->api->tile->add($this->level, TILE_CHEST, $this->x, $this->y, $this->z, array( "Items" => array(), "id" => TILE_CHEST, @@ -72,7 +72,7 @@ class ChestBlock extends TransparentBlock{ if($t !== false){ $t->unpair(); } - $this->level->setBlock($this, new AirBlock(), true, true); + $this->level->setBlock($this, new AirBlock(), true, true, true); return true; } diff --git a/src/material/block/solid/Dirt.php b/src/material/block/solid/Dirt.php index 0d3abc1e3..22f54df56 100644 --- a/src/material/block/solid/Dirt.php +++ b/src/material/block/solid/Dirt.php @@ -30,7 +30,7 @@ class DirtBlock extends SolidBlock{ if(($player->gamemode & 0x01) === 0){ $item->useOn($this); } - $this->level->setBlock($this, BlockAPI::get(FARMLAND, 0)); + $this->level->setBlock($this, BlockAPI::get(FARMLAND, 0), true, false, true); return true; } return false; diff --git a/src/material/block/solid/Leaves.php b/src/material/block/solid/Leaves.php index 2e882403e..9fd470ba4 100644 --- a/src/material/block/solid/Leaves.php +++ b/src/material/block/solid/Leaves.php @@ -103,7 +103,7 @@ class LeavesBlock extends TransparentBlock{ if($type === BLOCK_UPDATE_NORMAL){ if(($this->meta & 0b00001100) === 0){ $this->meta |= 0x08; - $this->level->setBlock($this, $this, false); + $this->level->setBlock($this, $this, false, false, true); return BLOCK_UPDATE_RANDOM; } }elseif($type === BLOCK_UPDATE_RANDOM){ @@ -112,9 +112,9 @@ class LeavesBlock extends TransparentBlock{ $visited = array(); $check = 0; if($this->findLog($this, $visited, 0, $check) === true){ - $this->level->setBlock($this, $this, false); + $this->level->setBlock($this, $this, false, false, true); }else{ - $this->level->setBlock($this, new AirBlock(), false); + $this->level->setBlock($this, new AirBlock(), false, false, true); if(mt_rand(1,20) === 1){ //Saplings ServerAPI::request()->api->entity->drop($this, BlockAPI::getItem(SAPLING, $this->meta & 0x03, 1)); } @@ -130,7 +130,7 @@ class LeavesBlock extends TransparentBlock{ public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ $this->meta |= 0x04; - $this->level->setBlock($this, $this); + $this->level->setBlock($this, $this, true, false, true); } public function getDrops(Item $item, Player $player){ diff --git a/src/material/item/generic/Bucket.php b/src/material/item/generic/Bucket.php index 4b6eac06a..40fc11e87 100644 --- a/src/material/item/generic/Bucket.php +++ b/src/material/item/generic/Bucket.php @@ -29,7 +29,7 @@ class BucketItem extends Item{ public function onActivate(Level $level, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ if($this->meta === AIR){ if($target instanceof LiquidBlock){ - $level->setBlock($target, new AirBlock()); + $level->setBlock($target, new AirBlock(), true, false, true); if(($player->gamemode & 0x01) === 0){ $this->meta = ($target instanceof WaterBlock) ? WATER:LAVA; } @@ -37,7 +37,7 @@ class BucketItem extends Item{ } }elseif($this->meta === WATER){ if($block->getID() === AIR){ - $level->setBlock($block, new StillWaterBLock()); + $level->setBlock($block, new StillWaterBlock(), true, false, true); if(($player->gamemode & 0x01) === 0){ $this->meta = 0; } @@ -45,7 +45,7 @@ class BucketItem extends Item{ } }elseif($this->meta === LAVA){ if($block->getID() === AIR){ - $level->setBlock($block, new StillLavaBlock()); + $level->setBlock($block, new StillLavaBlock(), true, false, true); if(($player->gamemode & 0x01) === 0){ $this->meta = 0; } diff --git a/src/world/Tile.php b/src/world/Tile.php index 40b100984..a59b63a95 100644 --- a/src/world/Tile.php +++ b/src/world/Tile.php @@ -246,7 +246,7 @@ class Tile extends Position{ $this->setSlot(1, $fuel, false); $current = $this->level->getBlock($this); if($current->getID() === FURNACE){ - $this->level->setBlock($this, BlockAPI::get(BURNING_FURNACE, $current->getMetadata())); + $this->level->setBlock($this, BlockAPI::get(BURNING_FURNACE, $current->getMetadata()), true, false, true); } } if($this->data["BurnTime"] > 0){ @@ -278,7 +278,7 @@ class Tile extends Position{ }else{ $current = $this->level->getBlock($this); if($current->getID() === BURNING_FURNACE){ - $this->level->setBlock($this, BlockAPI::get(FURNACE, $current->getMetadata())); + $this->level->setBlock($this, BlockAPI::get(FURNACE, $current->getMetadata()), true, false, true); } $this->data["CookTime"] = 0; $this->data["BurnTime"] = 0;