mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Added block break tool type, fixed falling sand, fixed duplicated jungle leaves
This commit is contained in:
parent
866fde5351
commit
0380e9009a
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\nbt\NBT;
|
use pocketmine\nbt\NBT;
|
||||||
use pocketmine\nbt\tag\Compound;
|
use pocketmine\nbt\tag\Compound;
|
||||||
@ -52,6 +53,10 @@ class Chest extends Transparent{
|
|||||||
return "Chest";
|
return "Chest";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x + 0.0625,
|
$this->x + 0.0625,
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Clay extends Solid{
|
class Clay extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Clay extends Solid{
|
|||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Clay Block";
|
return "Clay Block";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Coal extends Solid{
|
class Coal extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Coal extends Solid{
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Coal Block";
|
return "Coal Block";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class CoalOre extends Solid{
|
class CoalOre extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class CoalOre extends Solid{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Coal Ore";
|
return "Coal Ore";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class CobblestoneStairs extends Stair{
|
class CobblestoneStairs extends Stair{
|
||||||
|
|
||||||
protected $id = self::COBBLESTONE_STAIRS;
|
protected $id = self::COBBLESTONE_STAIRS;
|
||||||
@ -34,6 +36,10 @@ class CobblestoneStairs extends Stair{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Cobblestone Stairs";
|
return "Cobblestone Stairs";
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Cobweb extends Flowable{
|
class Cobweb extends Flowable{
|
||||||
|
|
||||||
@ -44,6 +45,10 @@ class Cobweb extends Flowable{
|
|||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SWORD;
|
||||||
|
}
|
||||||
|
|
||||||
public function onEntityCollide(Entity $entity){
|
public function onEntityCollide(Entity $entity){
|
||||||
$entity->resetFallDistance();
|
$entity->resetFallDistance();
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class DarkOakWoodStairs extends Stair{
|
class DarkOakWoodStairs extends Stair{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class DarkOakWoodStairs extends Stair{
|
|||||||
return "Dark Oak Wood Stairs";
|
return "Dark Oak Wood Stairs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, 0, 1],
|
[$this->id, 0, 1],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Diamond extends Solid{
|
class Diamond extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Diamond extends Solid{
|
|||||||
return "Diamond Block";
|
return "Diamond Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 4){
|
if($item->isPickaxe() >= 4){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class DiamondOre extends Solid{
|
class DiamondOre extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class DiamondOre extends Solid{
|
|||||||
return "Diamond Ore";
|
return "Diamond Ore";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 4){
|
if($item->isPickaxe() >= 4){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class DoubleSlab extends Solid{
|
class DoubleSlab extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class DoubleSlab extends Solid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
0 => "Stone",
|
0 => "Stone",
|
||||||
|
@ -35,6 +35,10 @@ class DoubleWoodSlab extends Solid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
0 => "Oak",
|
0 => "Oak",
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Emerald extends Solid{
|
class Emerald extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Emerald extends Solid{
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Emerald Block";
|
return "Emerald Block";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class EmeraldOre extends Solid{
|
class EmeraldOre extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class EmeraldOre extends Solid{
|
|||||||
return "Emerald Ore";
|
return "Emerald Ore";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class EndStone extends Solid{
|
class EndStone extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class EndStone extends Solid{
|
|||||||
return "End Stone";
|
return "End Stone";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -24,6 +24,7 @@ namespace pocketmine\block;
|
|||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\nbt\tag\Byte;
|
use pocketmine\nbt\tag\Byte;
|
||||||
use pocketmine\nbt\tag\Compound;
|
use pocketmine\nbt\tag\Compound;
|
||||||
use pocketmine\nbt\tag\Double;
|
use pocketmine\nbt\tag\Double;
|
||||||
@ -42,7 +43,7 @@ abstract class Fallable extends Solid{
|
|||||||
|
|
||||||
public function onUpdate($type){
|
public function onUpdate($type){
|
||||||
if($type === Level::BLOCK_UPDATE_NORMAL){
|
if($type === Level::BLOCK_UPDATE_NORMAL){
|
||||||
$down = $this->getSide(0);
|
$down = $this->getSide(Vector3::SIDE_DOWN);
|
||||||
if($down->getId() === self::AIR or ($down instanceof Liquid)){
|
if($down->getId() === self::AIR or ($down instanceof Liquid)){
|
||||||
$fall = Entity::createEntity("FallingSand", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new Compound("", [
|
$fall = Entity::createEntity("FallingSand", $this->getLevel()->getChunk($this->x >> 4, $this->z >> 4), new Compound("", [
|
||||||
"Pos" => new Enum("Pos", [
|
"Pos" => new Enum("Pos", [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
|
||||||
class Farmland extends Solid{
|
class Farmland extends Solid{
|
||||||
@ -40,6 +41,10 @@ class Farmland extends Solid{
|
|||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
|
|
||||||
@ -36,6 +37,10 @@ class Fence extends Transparent{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -45,6 +46,10 @@ class FenceGate extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
|
||||||
class GlowingRedstoneOre extends Solid{
|
class GlowingRedstoneOre extends Solid{
|
||||||
@ -40,6 +41,10 @@ class GlowingRedstoneOre extends Solid{
|
|||||||
return "Glowing Redstone Ore";
|
return "Glowing Redstone Ore";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getLightLevel(){
|
public function getLightLevel(){
|
||||||
return 9;
|
return 9;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Glowstone extends Transparent{
|
class Glowstone extends Transparent{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Glowstone extends Transparent{
|
|||||||
return 0.3;
|
return 0.3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getLightLevel(){
|
public function getLightLevel(){
|
||||||
return 15;
|
return 15;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Gold extends Solid{
|
class Gold extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Gold extends Solid{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 4){
|
if($item->isPickaxe() >= 4){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class GoldOre extends Solid{
|
class GoldOre extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class GoldOre extends Solid{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 4){
|
if($item->isPickaxe() >= 4){
|
||||||
return [
|
return [
|
||||||
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\event\block\BlockSpreadEvent;
|
use pocketmine\event\block\BlockSpreadEvent;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\generator\object\TallGrass as TallGrassObject;
|
use pocketmine\level\generator\object\TallGrass as TallGrassObject;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
@ -43,6 +44,10 @@ class GrassPath extends Transparent{
|
|||||||
return "Grass Path";
|
return "Grass Path";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
$this->x,
|
$this->x,
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Gravel extends Fallable{
|
class Gravel extends Fallable{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Gravel extends Fallable{
|
|||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if(mt_rand(1, 10) === 1){
|
if(mt_rand(1, 10) === 1){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class HardenedClay extends Solid{
|
class HardenedClay extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class HardenedClay extends Solid{
|
|||||||
return "Hardened Clay";
|
return "Hardened Clay";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 1.25;
|
return 1.25;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Ice extends Transparent{
|
class Ice extends Transparent{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Ice extends Transparent{
|
|||||||
return 0.5;
|
return 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function onBreak(Item $item){
|
public function onBreak(Item $item){
|
||||||
$this->getLevel()->setBlock($this, new Water(), true);
|
$this->getLevel()->setBlock($this, new Water(), true);
|
||||||
|
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Iron extends Solid{
|
class Iron extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Iron extends Solid{
|
|||||||
return "Iron Block";
|
return "Iron Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class IronBars extends Thin{
|
class IronBars extends Thin{
|
||||||
|
|
||||||
@ -34,10 +35,15 @@ class IronBars extends Thin{
|
|||||||
public function getName(){
|
public function getName(){
|
||||||
return "Iron Bars";
|
return "Iron Bars";
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class IronDoor extends Door{
|
class IronDoor extends Door{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class IronDoor extends Door{
|
|||||||
return "Iron Door Block";
|
return "Iron Door Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class IronOre extends Solid{
|
class IronOre extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class IronOre extends Solid{
|
|||||||
return "Iron Ore";
|
return "Iron Ore";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class JungleWoodStairs extends Stair{
|
class JungleWoodStairs extends Stair{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class JungleWoodStairs extends Stair{
|
|||||||
return "Jungle Wood Stairs";
|
return "Jungle Wood Stairs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, 0, 1],
|
[$this->id, 0, 1],
|
||||||
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\entity\Entity;
|
use pocketmine\entity\Entity;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
@ -133,6 +134,10 @@ class Ladder extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, 0, 1],
|
[$this->id, 0, 1],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Lapis extends Solid{
|
class Lapis extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Lapis extends Solid{
|
|||||||
return "Lapis Lazuli Block";
|
return "Lapis Lazuli Block";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class LapisOre extends Solid{
|
class LapisOre extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class LapisOre extends Solid{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Lapis Lazuli Ore";
|
return "Lapis Lazuli Ore";
|
||||||
}
|
}
|
||||||
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\event\block\LeavesDecayEvent;
|
use pocketmine\event\block\LeavesDecayEvent;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
use pocketmine\Server;
|
use pocketmine\Server;
|
||||||
@ -45,6 +46,10 @@ class Leaves extends Transparent{
|
|||||||
return 0.2;
|
return 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHEARS;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
self::OAK => "Oak Leaves",
|
self::OAK => "Oak Leaves",
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class LitPumpkin extends Solid{
|
class LitPumpkin extends Solid{
|
||||||
@ -36,6 +37,10 @@ class LitPumpkin extends Solid{
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Jack o'Lantern";
|
return "Jack o'Lantern";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Melon extends Transparent{
|
class Melon extends Transparent{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Melon extends Transparent{
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[Item::MELON_SLICE, 0, mt_rand(3, 7)],
|
[Item::MELON_SLICE, 0, mt_rand(3, 7)],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class MonsterSpawner extends Solid{
|
class MonsterSpawner extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class MonsterSpawner extends Solid{
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Monster Spawner";
|
return "Monster Spawner";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class MossStone extends Solid{
|
class MossStone extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class MossStone extends Solid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return [
|
return [
|
||||||
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||||||
|
|
||||||
use pocketmine\event\block\BlockSpreadEvent;
|
use pocketmine\event\block\BlockSpreadEvent;
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
use pocketmine\Server;
|
use pocketmine\Server;
|
||||||
@ -39,6 +40,10 @@ class Mycelium extends Solid{
|
|||||||
return "Mycelium";
|
return "Mycelium";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 0.6;
|
return 0.6;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class NetherBrick extends Solid{
|
class NetherBrick extends Solid{
|
||||||
|
|
||||||
@ -31,6 +32,10 @@ class NetherBrick extends Solid{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Nether Bricks";
|
return "Nether Bricks";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class NetherBrickStairs extends Stair{
|
class NetherBrickStairs extends Stair{
|
||||||
|
|
||||||
protected $id = self::NETHER_BRICKS_STAIRS;
|
protected $id = self::NETHER_BRICKS_STAIRS;
|
||||||
@ -34,6 +36,10 @@ class NetherBrickStairs extends Stair{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function __construct($meta = 0){
|
public function __construct($meta = 0){
|
||||||
$this->meta = $meta;
|
$this->meta = $meta;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Netherrack extends Solid{
|
class Netherrack extends Solid{
|
||||||
|
|
||||||
@ -39,6 +40,10 @@ class Netherrack extends Solid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Obsidian extends Solid{
|
class Obsidian extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Obsidian extends Solid{
|
|||||||
return "Obsidian";
|
return "Obsidian";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 50;
|
return 50;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Planks extends Solid{
|
class Planks extends Solid{
|
||||||
const OAK = 0;
|
const OAK = 0;
|
||||||
const SPRUCE = 1;
|
const SPRUCE = 1;
|
||||||
@ -40,6 +42,10 @@ class Planks extends Solid{
|
|||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
self::OAK => "Oak Wood Planks",
|
self::OAK => "Oak Wood Planks",
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Podzol extends Solid{
|
class Podzol extends Solid{
|
||||||
|
|
||||||
protected $id = self::PODZOL;
|
protected $id = self::PODZOL;
|
||||||
@ -29,6 +31,10 @@ class Podzol extends Solid{
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Podzol";
|
return "Podzol";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class Pumpkin extends Solid{
|
class Pumpkin extends Solid{
|
||||||
@ -36,6 +37,10 @@ class Pumpkin extends Solid{
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Pumpkin";
|
return "Pumpkin";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Quartz extends Solid{
|
class Quartz extends Solid{
|
||||||
|
|
||||||
@ -45,6 +46,10 @@ class Quartz extends Solid{
|
|||||||
return $names[$this->meta & 0x03];
|
return $names[$this->meta & 0x03];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class QuartzStairs extends Stair{
|
class QuartzStairs extends Stair{
|
||||||
|
|
||||||
protected $id = self::QUARTZ_STAIRS;
|
protected $id = self::QUARTZ_STAIRS;
|
||||||
@ -34,6 +36,10 @@ class QuartzStairs extends Stair{
|
|||||||
return 0.8;
|
return 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Quartz Stairs";
|
return "Quartz Stairs";
|
||||||
}
|
}
|
||||||
|
@ -22,8 +22,9 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Redstone extends Transparent{
|
class Redstone extends Solid{
|
||||||
|
|
||||||
protected $id = self::REDSTONE_BLOCK;
|
protected $id = self::REDSTONE_BLOCK;
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class Redstone extends Transparent{
|
|||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Redstone Block";
|
return "Redstone Block";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
|
|
||||||
class RedstoneOre extends Solid{
|
class RedstoneOre extends Solid{
|
||||||
@ -50,6 +51,12 @@ class RedstoneOre extends Solid{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 2){
|
if($item->isPickaxe() >= 2){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Sand extends Fallable{
|
class Sand extends Fallable{
|
||||||
|
|
||||||
protected $id = self::SAND;
|
protected $id = self::SAND;
|
||||||
@ -34,6 +36,10 @@ class Sand extends Fallable{
|
|||||||
return 0.5;
|
return 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
if($this->meta === 0x01){
|
if($this->meta === 0x01){
|
||||||
return "Red Sand";
|
return "Red Sand";
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Sandstone extends Solid{
|
class Sandstone extends Solid{
|
||||||
|
|
||||||
@ -45,6 +46,10 @@ class Sandstone extends Solid{
|
|||||||
return $names[$this->meta & 0x03];
|
return $names[$this->meta & 0x03];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
if($item->isPickaxe() >= 1){
|
if($item->isPickaxe() >= 1){
|
||||||
return [
|
return [
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class SandstoneStairs extends Stair{
|
class SandstoneStairs extends Stair{
|
||||||
|
|
||||||
protected $id = self::SANDSTONE_STAIRS;
|
protected $id = self::SANDSTONE_STAIRS;
|
||||||
@ -34,6 +36,10 @@ class SandstoneStairs extends Stair{
|
|||||||
return 0.8;
|
return 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Sandstone Stairs";
|
return "Sandstone Stairs";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -97,4 +98,8 @@ class SignPost extends Transparent{
|
|||||||
[Item::SIGN, 0, 1],
|
[Item::SIGN, 0, 1],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -132,4 +133,10 @@ class Slab extends Transparent{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Snow extends Solid{
|
class Snow extends Solid{
|
||||||
|
|
||||||
protected $id = self::SNOW_BLOCK;
|
protected $id = self::SNOW_BLOCK;
|
||||||
@ -34,6 +36,10 @@ class Snow extends Solid{
|
|||||||
return 0.2;
|
return 0.2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
return "Snow Block";
|
return "Snow Block";
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\level\Level;
|
use pocketmine\level\Level;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -45,6 +46,10 @@ class SnowLayer extends Flowable{
|
|||||||
return 0.1;
|
return 0.1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
public function place(Item $item, Block $block, Block $target, $face, $fx, $fy, $fz, Player $player = null){
|
||||||
$down = $this->getSide(0);
|
$down = $this->getSide(0);
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
|
|
||||||
class SoulSand extends Solid{
|
class SoulSand extends Solid{
|
||||||
@ -40,6 +41,10 @@ class SoulSand extends Solid{
|
|||||||
return 0.5;
|
return 0.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHOVEL;
|
||||||
|
}
|
||||||
|
|
||||||
protected function recalculateBoundingBox(){
|
protected function recalculateBoundingBox(){
|
||||||
|
|
||||||
return new AxisAlignedBB(
|
return new AxisAlignedBB(
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class SpruceWoodStairs extends Stair{
|
class SpruceWoodStairs extends Stair{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class SpruceWoodStairs extends Stair{
|
|||||||
return "Spruce Wood Stairs";
|
return "Spruce Wood Stairs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, 0, 1],
|
[$this->id, 0, 1],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class StainedClay extends Solid{
|
class StainedClay extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class StainedClay extends Solid{
|
|||||||
return 1.25;
|
return 1.25;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
0 => "White Stained Clay",
|
0 => "White Stained Clay",
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class StoneBrickStairs extends Stair{
|
class StoneBrickStairs extends Stair{
|
||||||
|
|
||||||
protected $id = self::STONE_BRICK_STAIRS;
|
protected $id = self::STONE_BRICK_STAIRS;
|
||||||
@ -30,6 +32,10 @@ class StoneBrickStairs extends Stair{
|
|||||||
$this->meta = $meta;
|
$this->meta = $meta;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 1.5;
|
return 1.5;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class StoneBricks extends Solid{
|
class StoneBricks extends Solid{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class StoneBricks extends Solid{
|
|||||||
return 1.5;
|
return 1.5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
0 => "Stone Bricks",
|
0 => "Stone Bricks",
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\math\Vector3;
|
use pocketmine\math\Vector3;
|
||||||
|
|
||||||
@ -37,6 +38,10 @@ class StoneWall extends Transparent{
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getHardness(){
|
public function getHardness(){
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
//TODO: check orientation
|
//TODO: check orientation
|
||||||
@ -37,6 +38,10 @@ class Stonecutter extends Solid{
|
|||||||
return "Stonecutter";
|
return "Stonecutter";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_PICKAXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function canBeActivated(){
|
public function canBeActivated(){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -148,4 +149,8 @@ class Trapdoor extends Transparent{
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -163,4 +163,8 @@ class Vine extends Transparent{
|
|||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
class Wood extends Solid{
|
class Wood extends Solid{
|
||||||
@ -73,4 +74,8 @@ class Wood extends Solid{
|
|||||||
[$this->id, $this->meta & 0x03, 1],
|
[$this->id, $this->meta & 0x03, 1],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
}
|
}
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class WoodDoor extends Door{
|
class WoodDoor extends Door{
|
||||||
|
|
||||||
@ -43,6 +44,10 @@ class WoodDoor extends Door{
|
|||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[Item::WOODEN_DOOR, 0, 1],
|
[Item::WOODEN_DOOR, 0, 1],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\math\AxisAlignedBB;
|
use pocketmine\math\AxisAlignedBB;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
@ -122,6 +123,10 @@ class WoodSlab extends Transparent{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, $this->meta & 0x07, 1],
|
[$this->id, $this->meta & 0x07, 1],
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class WoodStairs extends Stair{
|
class WoodStairs extends Stair{
|
||||||
|
|
||||||
@ -35,6 +36,10 @@ class WoodStairs extends Stair{
|
|||||||
return "Wood Stairs";
|
return "Wood Stairs";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function getDrops(Item $item){
|
public function getDrops(Item $item){
|
||||||
return [
|
return [
|
||||||
[$this->id, 0, 1],
|
[$this->id, 0, 1],
|
||||||
|
@ -22,6 +22,8 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
|
||||||
|
use pocketmine\item\Tool;
|
||||||
|
|
||||||
class Wool extends Solid{
|
class Wool extends Solid{
|
||||||
|
|
||||||
protected $id = self::WOOL;
|
protected $id = self::WOOL;
|
||||||
@ -34,6 +36,10 @@ class Wool extends Solid{
|
|||||||
return 0.8;
|
return 0.8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_SHEARS;
|
||||||
|
}
|
||||||
|
|
||||||
public function getName(){
|
public function getName(){
|
||||||
static $names = [
|
static $names = [
|
||||||
0 => "White Wool",
|
0 => "White Wool",
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
use pocketmine\item\Item;
|
use pocketmine\item\Item;
|
||||||
|
use pocketmine\item\Tool;
|
||||||
use pocketmine\Player;
|
use pocketmine\Player;
|
||||||
|
|
||||||
//TODO: check orientation
|
//TODO: check orientation
|
||||||
@ -45,6 +46,10 @@ class Workbench extends Solid{
|
|||||||
return "Crafting Table";
|
return "Crafting Table";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getToolType(){
|
||||||
|
return Tool::TYPE_AXE;
|
||||||
|
}
|
||||||
|
|
||||||
public function onActivate(Item $item, Player $player = null){
|
public function onActivate(Item $item, Player $player = null){
|
||||||
if($player instanceof Player){
|
if($player instanceof Player){
|
||||||
$player->craftingType = 1;
|
$player->craftingType = 1;
|
||||||
|
@ -95,12 +95,13 @@ class FallingSand extends Entity{
|
|||||||
if($tickDiff <= 0 and !$this->justCreated){
|
if($tickDiff <= 0 and !$this->justCreated){
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->lastUpdate = $currentTick;
|
$this->lastUpdate = $currentTick;
|
||||||
|
|
||||||
$hasUpdate = $this->entityBaseTick($tickDiff);
|
$hasUpdate = $this->entityBaseTick($tickDiff);
|
||||||
|
|
||||||
if($this->isAlive()){
|
if($this->isAlive()){
|
||||||
$pos = (new Vector3($this->x - 0.5, $this->y, $this->z - 0.5))->floor();
|
$pos = (new Vector3($this->x - 0.5, $this->y, $this->z - 0.5))->round();
|
||||||
|
|
||||||
if($this->ticksLived === 1){
|
if($this->ticksLived === 1){
|
||||||
$block = $this->level->getBlock($pos);
|
$block = $this->level->getBlock($pos);
|
||||||
|
@ -686,7 +686,6 @@ class Item{
|
|||||||
self::addCreativeItem(Item::get(Item::LEAVES, 1));
|
self::addCreativeItem(Item::get(Item::LEAVES, 1));
|
||||||
self::addCreativeItem(Item::get(Item::LEAVES, 2));
|
self::addCreativeItem(Item::get(Item::LEAVES, 2));
|
||||||
self::addCreativeItem(Item::get(Item::LEAVES, 3));
|
self::addCreativeItem(Item::get(Item::LEAVES, 3));
|
||||||
self::addCreativeItem(Item::get(Item::LEAVES, 3));
|
|
||||||
self::addCreativeItem(Item::get(Item::LEAVES2, 0));
|
self::addCreativeItem(Item::get(Item::LEAVES2, 0));
|
||||||
self::addCreativeItem(Item::get(Item::LEAVES2, 1));
|
self::addCreativeItem(Item::get(Item::LEAVES2, 1));
|
||||||
self::addCreativeItem(Item::get(Item::CAKE, 0));
|
self::addCreativeItem(Item::get(Item::CAKE, 0));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user