diff --git a/src/material/Item.php b/src/material/Item.php index d695adf4..25e03311 100755 --- a/src/material/Item.php +++ b/src/material/Item.php @@ -95,6 +95,7 @@ class Item{ QUARTZ => "QuartzItem", CAMERA => "CameraItem", BEETROOT_SEEDS => "BeetrootSeedsItem", + EMERALD => "EmeraldItem", //tool IRON_SHOVEL => "IronShovelItem", diff --git a/src/material/block/nonfull/stairs/AcaciaWoodStairsBlock.php b/src/material/block/nonfull/stairs/AcaciaWoodStairsBlock.php new file mode 100644 index 00000000..97ab5d1e --- /dev/null +++ b/src/material/block/nonfull/stairs/AcaciaWoodStairsBlock.php @@ -0,0 +1,33 @@ +gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isAxe()){ + case 5: + return 0.4; + case 4: + return 0.5; + case 3: + return 0.75; + case 2: + return 0.25; + case 1: + return 1.5; + default: + return 3; + } + } + + public function getDrops(Item $item, Player $player){ + return array( + array($this->id, 0, 1), + ); + } +} \ No newline at end of file diff --git a/src/material/block/nonfull/stairs/BirchWoodStairsBlock.php b/src/material/block/nonfull/stairs/BirchWoodStairsBlock.php index f3f973df..c15f361d 100644 --- a/src/material/block/nonfull/stairs/BirchWoodStairsBlock.php +++ b/src/material/block/nonfull/stairs/BirchWoodStairsBlock.php @@ -5,6 +5,26 @@ class BirchWoodStairsBlock extends StairBlock{ parent::__construct(BIRCH_WOOD_STAIRS, $meta, "Birch Wood Stairs"); } + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isAxe()){ + case 5: + return 0.4; + case 4: + return 0.5; + case 3: + return 0.75; + case 2: + return 0.25; + case 1: + return 1.5; + default: + return 3; + } + } + public function getDrops(Item $item, Player $player){ return array( array($this->id, 0, 1), diff --git a/src/material/block/nonfull/stairs/DarkOakWoodStairsBlock.php b/src/material/block/nonfull/stairs/DarkOakWoodStairsBlock.php new file mode 100644 index 00000000..199f0250 --- /dev/null +++ b/src/material/block/nonfull/stairs/DarkOakWoodStairsBlock.php @@ -0,0 +1,33 @@ +gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isAxe()){ + case 5: + return 0.4; + case 4: + return 0.5; + case 3: + return 0.75; + case 2: + return 0.25; + case 1: + return 1.5; + default: + return 3; + } + } + + public function getDrops(Item $item, Player $player){ + return array( + array($this->id, 0, 1), + ); + } +} \ No newline at end of file diff --git a/src/material/block/nonfull/stairs/JungleWoodStairsBlock.php b/src/material/block/nonfull/stairs/JungleWoodStairsBlock.php index b73ec46b..fd52b4ae 100644 --- a/src/material/block/nonfull/stairs/JungleWoodStairsBlock.php +++ b/src/material/block/nonfull/stairs/JungleWoodStairsBlock.php @@ -5,6 +5,26 @@ class JungleWoodStairsBlock extends StairBlock{ parent::__construct(JUNGLE_WOOD_STAIRS, $meta, "Jungle Wood Stairs"); } + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isAxe()){ + case 5: + return 0.4; + case 4: + return 0.5; + case 3: + return 0.75; + case 2: + return 0.25; + case 1: + return 1.5; + default: + return 3; + } + } + public function getDrops(Item $item, Player $player){ return array( array($this->id, 0, 1), diff --git a/src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php b/src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php index 244f2f7d..14585bf6 100644 --- a/src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php +++ b/src/material/block/nonfull/stairs/SpruceWoodStairsBlock.php @@ -5,6 +5,26 @@ class SpruceWoodStairsBlock extends StairBlock{ parent::__construct(SPRUCE_WOOD_STAIRS, $meta, "Spruce Wood Stairs"); } + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isAxe()){ + case 5: + return 0.4; + case 4: + return 0.5; + case 3: + return 0.75; + case 2: + return 0.25; + case 1: + return 1.5; + default: + return 3; + } + } + public function getDrops(Item $item, Player $player){ return array( array($this->id, 0, 1), diff --git a/src/material/block/ore/EmeraldOreBlock.php b/src/material/block/ore/EmeraldOreBlock.php new file mode 100644 index 00000000..0a0e8dde --- /dev/null +++ b/src/material/block/ore/EmeraldOreBlock.php @@ -0,0 +1,32 @@ +hardness = 15; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->getPickaxeLevel()){ + case 5: + return 0.6; + case 4: + return 0.75; + default: + return 15; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 4){ + return array( + array(EMERALD, 0, 1), + ); + }else{ + return array(); + } + } +} \ No newline at end of file diff --git a/src/material/block/plant/CyanFlowerBlock.php b/src/material/block/plant/CyanFlowerBlock.php index b0308bbc..ba490144 100644 --- a/src/material/block/plant/CyanFlowerBlock.php +++ b/src/material/block/plant/CyanFlowerBlock.php @@ -1,9 +1,30 @@ hardness = 0; + $names = array( + 0 => "Poppy", + 1 => "Blue Orchid", + 2 => "Allium", + 3 => "Azure Bluet", + 4 => "Red Tulip", + 5 => "Orange Tulip", + 6 => "White Tulip", + 7 => "Pink Tulip", + 8 => "Oxeye Daisy", + ); } public function place(Item $item, Player $player, Block $block, Block $target, $face, $fx, $fy, $fz){ diff --git a/src/material/block/plant/SaplingBlock.php b/src/material/block/plant/SaplingBlock.php index f969837b..f909f842 100644 --- a/src/material/block/plant/SaplingBlock.php +++ b/src/material/block/plant/SaplingBlock.php @@ -5,6 +5,8 @@ class SaplingBlock extends FlowableBlock{ const SPRUCE = 1; const BIRCH = 2; const JUNGLE = 3; + const ACACIA = 4; + const DARK_OAK = 5; const BURN_TIME = 5; public function __construct($meta = SaplingBlock::OAK){ @@ -15,6 +17,8 @@ class SaplingBlock extends FlowableBlock{ 1 => "Spruce Sapling", 2 => "Birch Sapling", 3 => "Jungle Sapling", + 4 => "Acacia Sapling", + 5 => "Dark Oak Sapling", ); $this->name = $names[$this->meta & 0x03]; $this->hardness = 0; diff --git a/src/material/block/solid/EmeraldBlock.php b/src/material/block/solid/EmeraldBlock.php new file mode 100644 index 00000000..44a3beb9 --- /dev/null +++ b/src/material/block/solid/EmeraldBlock.php @@ -0,0 +1,32 @@ +hardness = 30; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->getPickaxeLevel()){ + case 5: + return 0.95; + case 4: + return 1.25; + default: + return 25; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 4){ + return array( + array(EMERALD_BLOCK, 0, 1), + ); + }else{ + return array(); + } + } +} \ No newline at end of file diff --git a/src/material/block/solid/EndStoneBlock.php b/src/material/block/solid/EndStoneBlock.php new file mode 100644 index 00000000..1f45d43f --- /dev/null +++ b/src/material/block/solid/EndStoneBlock.php @@ -0,0 +1,38 @@ +hardness = 45; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->getPickaxeLevel()){ //from pm 1.4 + case 5: + return 0.6; + case 4: + return 0.75; + case 3: + return 1.15; + case 2: + return 0.4; + case 1: + return 2.25; + default: + return 15; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 1){ + return array( + array(END_STONE, 0, 1), + ); + }else{ + return array(); + } + } +} \ No newline at end of file diff --git a/src/material/block/solid/GrassBlock.php b/src/material/block/solid/GrassBlock.php index e0847fa7..5c6a7746 100644 --- a/src/material/block/solid/GrassBlock.php +++ b/src/material/block/solid/GrassBlock.php @@ -34,7 +34,7 @@ class GrassBlock extends SolidBlock{ return false; } - public function seedsDrop(){ + /*public function seedsDrop(){ $chance = Utils::randomFloat() * 100; if($chance <= 1){ ServerAPI::request()->api->entity->drop(new Position($this->x+0.5, $this->y+1, $this->z+0.5, $this->level), BlockAPI::getItem(458,0,1)); @@ -45,7 +45,7 @@ class GrassBlock extends SolidBlock{ return; } return; - } + }*/ public function onUpdate($type){ if($type === BLOCK_UPDATE_RANDOM && !$this->getSide(1)->isTransparent && mt_rand(0, 2) == 1){ @@ -53,5 +53,4 @@ class GrassBlock extends SolidBlock{ } return BLOCK_UPDATE_RANDOM; } - } \ No newline at end of file diff --git a/src/material/block/solid/HardenedClayBlock.php b/src/material/block/solid/HardenedClayBlock.php new file mode 100644 index 00000000..94078b80 --- /dev/null +++ b/src/material/block/solid/HardenedClayBlock.php @@ -0,0 +1,39 @@ +hardness = 30; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->getPickaxeLevel()){ + case 5: + return 0.25; + case 4: + return 0.35; + case 3: + return 0.5; + case 2: + return 0.2; + case 1: + return 0.95; + default: + return 6.25; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 1){ + return array( + array(HARDENED_CLAY, 0, 1), + ); + }else{ + return array(); + } + } + +} \ No newline at end of file diff --git a/src/material/block/solid/MyceliumBlock.php b/src/material/block/solid/MyceliumBlock.php new file mode 100644 index 00000000..3e714e89 --- /dev/null +++ b/src/material/block/solid/MyceliumBlock.php @@ -0,0 +1,22 @@ +isActivable = true; + $this->hardness = 3; + } + + public function getDrops(Item $item, Player $player){ + return array( + array(DIRT, 0, 1), + ); + } + + public function onUpdate($type){ + if($type === BLOCK_UPDATE_RANDOM && !$this->getSide(1)->isTransparent && mt_rand(0, 2) == 1){ + $this->level->setBlock($this, BlockAPI::get(DIRT, 0), true, false, true); + } + return BLOCK_UPDATE_RANDOM; + } +} \ No newline at end of file diff --git a/src/material/block/solid/PlanksBlock.php b/src/material/block/solid/PlanksBlock.php index 7b5f135e..1d2948ca 100644 --- a/src/material/block/solid/PlanksBlock.php +++ b/src/material/block/solid/PlanksBlock.php @@ -8,6 +8,8 @@ class PlanksBlock extends SolidBlock{ WoodBlock::SPRUCE => "Spruce Wooden Planks", WoodBlock::BIRCH => "Birch Wooden Planks", WoodBlock::JUNGLE => "Jungle Wooden Planks", + WoodBlock::ACACIA => "Acacia Wooden Planks", + WoodBlock::DARK_OAK => "Dark Oak Wooden Planks", ); $this->name = $names[$this->meta & 0x03]; $this->hardness = 15; diff --git a/src/material/block/solid/StainedClayBlock.php b/src/material/block/solid/StainedClayBlock.php new file mode 100644 index 00000000..0b3ab0a5 --- /dev/null +++ b/src/material/block/solid/StainedClayBlock.php @@ -0,0 +1,58 @@ + "White Stained Clay", + 1 => "Orange Stained Clay", + 2 => "Magenta Stained Clay", + 3 => "Light Blue Stained Clay", + 4 => "Yellow Stained Clay", + 5 => "Lime Stained Clay", + 6 => "Pink Stained Clay", + 7 => "Gray Stained Clay", + 8 => "Light Gray Stained Clay", + 9 => "Cyan Stained Clay", + 10 => "Purple Stained Clay", + 11 => "Blue Stained Clay", + 12 => "Brown Stained Clay", + 13 => "Green Stained Clay", + 14 => "Red Stained Clay", + 15 => "Black Stained Clay", + ); + $this->name = $names[$this->meta & 0x03]; + $this->hardness = 30; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->getPickaxeLevel()){ + case 5: + return 0.25; + case 4: + return 0.35; + case 3: + return 0.5; + case 2: + return 0.2; + case 1: + return 0.95; + default: + return 6.25; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->getPickaxeLevel() >= 1){ + return array( + array(STAINED_CLAY, $this->meta & 0x03, 1), + ); + }else{ + return array(); + } + } + +} \ No newline at end of file diff --git a/src/material/block/solid/WoodBlock.php b/src/material/block/solid/WoodBlock.php index 2ee7cd0c..cfbb6a84 100644 --- a/src/material/block/solid/WoodBlock.php +++ b/src/material/block/solid/WoodBlock.php @@ -5,14 +5,18 @@ class WoodBlock extends SolidBlock{ const SPRUCE = 1; const BIRCH = 2; const JUNGLE = 3; + const ACACIA = 4; + const DARK_OAK = 5; public function __construct($meta = 0){ - parent::__construct(WOOD, $meta, "Wood"); + parent::__construct(WOOD, $meta, "Log"); $names = array( - WoodBlock::OAK => "Oak Wood", - WoodBlock::SPRUCE => "Spruce Wood", - WoodBlock::BIRCH => "Birch Wood", - WoodBlock::JUNGLE => "Jungle Wood", + WoodBlock::OAK => "Oak Log", + WoodBlock::SPRUCE => "Spruce Log", + WoodBlock::BIRCH => "Birch Log", + WoodBlock::JUNGLE => "Jungle Log", + WoodBlock::ACACIA => "Acacia Log", + WoodBlock::DARK_OAK => "Dark Oak Log" ); $this->name = $names[$this->meta & 0x03]; $this->hardness = 10; diff --git a/src/material/item/generic/EmeraldItem.php b/src/material/item/generic/EmeraldItem.php new file mode 100644 index 00000000..4bea0157 --- /dev/null +++ b/src/material/item/generic/EmeraldItem.php @@ -0,0 +1,8 @@ +