diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index ea28c66e3..ad3cc6fea 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -144,6 +144,7 @@ class Block extends Position implements Metadatable{ const SUGARCANE_BLOCK = 83; const FENCE = 85; + const FENCE_OAK = 85; const PUMPKIN = 86; const NETHERRACK = 87; const SOUL_SAND = 88; @@ -228,6 +229,12 @@ class Block extends Position implements Metadatable{ const HARDENED_CLAY = 172; const COAL_BLOCK = 173; + const FENCE_SPRUCE = 188; + const FENCE_BIRCH = 189; + const FENCE_JUNGLE = 190; + const FENCE_DARK_OAK = 191; + const FENCE_ACACIA = 192; + const PODZOL = 243; const BEETROOT_BLOCK = 244; const STONECUTTER = 245; @@ -354,6 +361,10 @@ class Block extends Position implements Metadatable{ [Item::WOODEN_DOOR, 0], [Item::TRAPDOOR, 0], [Item::FENCE, 0], + [Item::FENCE_SPRUCE, 0], + [Item::FENCE_BIRCH, 0], + [Item::FENCE_DARK_OAK, 0], + [Item::FENCE_JUNGLE, 0], [Item::FENCE_GATE, 0], [Item::IRON_BARS, 0], [Item::BED, 0], @@ -663,6 +674,11 @@ class Block extends Position implements Metadatable{ self::HARDENED_CLAY => HardenedClay::class, self::COAL_BLOCK => Coal::class, + self::FENCE_SPRUCE => FenceSpruce::class, + self::FENCE_BIRCH => FenceBirch::class, + self::FENCE_DARK_OAK => FenceDarkOak::class, + self::FENCE_JUNGLE => FenceJungle::class, + self::PODZOL => Podzol::class, self::BEETROOT_BLOCK => Beetroot::class, self::STONECUTTER => Stonecutter::class, diff --git a/src/pocketmine/block/Fence.php b/src/pocketmine/block/Fence.php index 5ff6694b0..2d139cf5a 100644 --- a/src/pocketmine/block/Fence.php +++ b/src/pocketmine/block/Fence.php @@ -21,12 +21,11 @@ namespace pocketmine\block; - use pocketmine\math\AxisAlignedBB; class Fence extends Transparent{ public function __construct(){ - parent::__construct(self::FENCE, 0, "Fence"); + parent::__construct(self::FENCE, 0, "Oak Fence"); $this->isFullBlock = false; $this->hardness = 15; } @@ -57,7 +56,7 @@ class Fence extends Transparent{ } public function canConnect(Block $block){ - return ($block->getID() !== self::FENCE and $block->getID() !== self::FENCE_GATE) ? $block->isSolid : true; + return (!($block instanceof Fence) and !($block instanceof FenceGate)) ? $block->isSolid : true; } } \ No newline at end of file diff --git a/src/pocketmine/block/FenceBirch.php b/src/pocketmine/block/FenceBirch.php new file mode 100644 index 000000000..8b7b3cda4 --- /dev/null +++ b/src/pocketmine/block/FenceBirch.php @@ -0,0 +1,30 @@ +isFullBlock = false; + $this->hardness = 15; + } +} \ No newline at end of file diff --git a/src/pocketmine/block/FenceDarkOak.php b/src/pocketmine/block/FenceDarkOak.php new file mode 100644 index 000000000..a3a7542c9 --- /dev/null +++ b/src/pocketmine/block/FenceDarkOak.php @@ -0,0 +1,30 @@ +isFullBlock = false; + $this->hardness = 15; + } +} \ No newline at end of file diff --git a/src/pocketmine/block/FenceJungle.php b/src/pocketmine/block/FenceJungle.php new file mode 100644 index 000000000..4c44d5810 --- /dev/null +++ b/src/pocketmine/block/FenceJungle.php @@ -0,0 +1,30 @@ +isFullBlock = false; + $this->hardness = 15; + } +} \ No newline at end of file diff --git a/src/pocketmine/block/FenceSpruce.php b/src/pocketmine/block/FenceSpruce.php new file mode 100644 index 000000000..6052f8d4b --- /dev/null +++ b/src/pocketmine/block/FenceSpruce.php @@ -0,0 +1,30 @@ +isFullBlock = false; + $this->hardness = 15; + } +} \ No newline at end of file diff --git a/src/pocketmine/inventory/CraftingManager.php b/src/pocketmine/inventory/CraftingManager.php index 4c5a79fa4..ce2403a1a 100644 --- a/src/pocketmine/inventory/CraftingManager.php +++ b/src/pocketmine/inventory/CraftingManager.php @@ -71,7 +71,12 @@ class CraftingManager{ $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::BED, 0, 1)))->addIngredient(Item::get(Item::WOOL, null, 3))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 3))); $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::CHEST, 0, 1)))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 8))); - $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, 0, 2)))->addIngredient(Item::get(Item::STICK, 0, 6))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 0, 2))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_SPRUCE, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 1, 2))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_BIRCH, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 2, 2))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_JUNGLE, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 3, 2))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_ACACIA, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 4, 2))); + $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_DARK_OAK, 0, 3)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, 5, 2))); $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FENCE_GATE, 0, 1)))->addIngredient(Item::get(Item::STICK, 0, 4))->addIngredient(Item::get(Item::WOODEN_PLANK, null, 2))); $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::FURNACE, 0, 1)))->addIngredient(Item::get(Item::COBBLESTONE, 0, 8))); $this->registerRecipe((new BigShapelessRecipe(Item::get(Item::GLASS_PANE, 0, 16)))->addIngredient(Item::get(Item::GLASS, 0, 6))); diff --git a/src/pocketmine/item/Item.php b/src/pocketmine/item/Item.php index 0018a57ec..694b5855e 100644 --- a/src/pocketmine/item/Item.php +++ b/src/pocketmine/item/Item.php @@ -220,6 +220,12 @@ class Item{ const HARDENED_CLAY = 172; const COAL_BLOCK = 173; + const FENCE_SPRUCE = 188; + const FENCE_BIRCH = 189; + const FENCE_JUNGLE = 190; + const FENCE_DARK_OAK = 191; + const FENCE_ACACIA = 192; + const PODZOL = 243; const BEETROOT_BLOCK = 244; const STONECUTTER = 245;