forked from CortexPE/TeaSpoon
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Chalapa13
committed
Oct 12, 2019
1 parent
68ca5d5
commit 5741480
Showing
5 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?php | ||
|
||
|
||
namespace CortexPE\block; | ||
|
||
|
||
class Composter | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
<?php | ||
|
||
|
||
namespace CortexPE\block; | ||
|
||
use CortexPE\Main; | ||
use CortexPE\tile\Sponge as SpongeTile; | ||
use CortexPE\tile\Tile; | ||
use CortexPE\utils\DyeUtils; | ||
use pocketmine\block\Block; | ||
use pocketmine\block\BlockToolType; | ||
use pocketmine\block\Transparent; | ||
use pocketmine\item\Armor; | ||
use pocketmine\item\Item; | ||
use pocketmine\item\Potion; | ||
use pocketmine\item\TieredTool; | ||
use pocketmine\math\Vector3; | ||
use pocketmine\nbt\tag\IntTag; | ||
use pocketmine\network\mcpe\protocol\LevelEventPacket; | ||
use pocketmine\Player; | ||
use pocketmine\utils\Color; | ||
|
||
class Sponge extends Transparent | ||
{ | ||
protected $id = self::SPONGE_BLOCK; | ||
protected $itemId = Item::SPONGE; | ||
|
||
private $absorbRange = 7; | ||
private $absorbQuantity = 65; | ||
|
||
public function __construct($meta = 0){ | ||
$this->meta = $meta; | ||
} | ||
|
||
public function getName(): string{ | ||
return "Sponge"; | ||
} | ||
|
||
public function getHardness(): float{ | ||
return 2; | ||
} | ||
|
||
public function getToolType(): int{ | ||
return BlockToolType::TYPE_NONE; | ||
} | ||
|
||
public function getToolHarvestLevel(): int{ | ||
return TieredTool::TIER_WOODEN; | ||
} | ||
|
||
public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = \null): bool{ | ||
Tile::createTile(Tile::SPONGE, $this->getLevel(), SpongeTile::createNBT($this, $face, $item, $player)); | ||
|
||
$player->sendMessage("Placed a TeaSpoon sponge."); | ||
|
||
return parent::place($item, $blockReplace, $blockClicked, $face, $clickVector, $player); | ||
} | ||
|
||
public function isFull(): bool{ | ||
return $this->meta >= $this->absorbQuantity; | ||
} | ||
|
||
public function isEmpty(): bool{ | ||
return $this->meta == 0; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?php | ||
|
||
|
||
namespace CortexPE\tile; | ||
|
||
use pocketmine\nbt\tag\ByteTag; | ||
use pocketmine\nbt\tag\CompoundTag; | ||
use pocketmine\nbt\tag\IntTag; | ||
use pocketmine\nbt\tag\LongTag; | ||
use pocketmine\nbt\tag\ShortTag; | ||
use pocketmine\tile\Spawnable; | ||
use pocketmine\utils\Color; | ||
|
||
class Sponge extends Spawnable | ||
{ | ||
protected function addAdditionalSpawnData(CompoundTag $nbt): void{ | ||
$this->applyBaseNBT($nbt); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5741480
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Chalapa13 @CortexPE @NycuRo
do you maintain teaspoon this great plugin
my server crash with latest build
https://poggit.pmmp.io/r/77751/TeaSpoon_dev-283.phar
https://jenkins.pmmp.io/job/PocketMine-MP/lastSuccessfulBuild/artifact/PocketMine-MP.phar