diff --git a/src/constants/BlockIDs.php b/src/constants/BlockIDs.php index 24fac5209..321084154 100644 --- a/src/constants/BlockIDs.php +++ b/src/constants/BlockIDs.php @@ -171,6 +171,8 @@ define("QUARTZ_STAIRS", 156); define("HAY_BALE", 170); +define("COAL_BLOCK", 170); + define("STONECUTTER", 245); define("GLOWING_OBSIDIAN", 246); define("NETHER_REACTOR", 247); diff --git a/src/material/Block.php b/src/material/Block.php index e14676310..957ab3eb5 100644 --- a/src/material/Block.php +++ b/src/material/Block.php @@ -132,6 +132,8 @@ abstract class Block extends Position{ QUARTZ_STAIRS => "QuartzStairsBlock", HAY_BALE => "HayBaleBlock", + + COAL_BLOCK => "CoalBlock", STONECUTTER => "StonecutterBlock", GLOWING_OBSIDIAN => "GlowingObsidianBlock", diff --git a/src/material/block/solid/Coal.php b/src/material/block/solid/Coal.php new file mode 100644 index 000000000..249d8b593 --- /dev/null +++ b/src/material/block/solid/Coal.php @@ -0,0 +1,57 @@ +hardness = 30; + } + + public function getBreakTime(Item $item, Player $player){ + if(($player->gamemode & 0x01) === 0x01){ + return 0.20; + } + switch($item->isPickaxe()){ + case 5: + return 0.95; + case 4: + return 1.25; + case 3: + return 1.9; + case 2: + return 0.65; + case 1: + return 3.75; + default: + return 25; + } + } + + public function getDrops(Item $item, Player $player){ + if($item->isPickaxe() >= 1){ + return array( + array(COAL_BLOCK, 0, 1), + ); + }else{ + return array(); + } + } +} \ No newline at end of file diff --git a/src/recipes/CraftingRecipes.php b/src/recipes/CraftingRecipes.php index a0de438e1..362af2a1c 100644 --- a/src/recipes/CraftingRecipes.php +++ b/src/recipes/CraftingRecipes.php @@ -176,6 +176,8 @@ class CraftingRecipes{ "SUGARCANE:?x3=>PAPER:0x1", "WOODEN_PLANKS:?x6,STICK:?x1=>SIGN:0x1", "IRON_INGOT:?x6=>IRON_BARS:0x16", + "COAL:0x9=>COAL_BLOCK:0x1", + "COAL_BLOCK:?x1=>COAL:0x9", ); private static $stone = array( diff --git a/src/recipes/FuelData.php b/src/recipes/FuelData.php index eaba877c2..c7778d24b 100644 --- a/src/recipes/FuelData.php +++ b/src/recipes/FuelData.php @@ -23,6 +23,7 @@ class FuelData{ public static $duration = array( COAL => 80, + COAL_BLOCK => 800, TRUNK => 15, WOODEN_PLANKS => 15, SAPLING => 5,