mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Added different Fences, new Fence crafting recipes
This commit is contained in:
parent
582ba100b0
commit
570cab9c66
@ -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,
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
}
|
30
src/pocketmine/block/FenceBirch.php
Normal file
30
src/pocketmine/block/FenceBirch.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
class FenceBirch extends Fence{
|
||||
public function __construct(){
|
||||
Transparent::__construct(self::FENCE_BIRCH, 0, "Birch Fence");
|
||||
$this->isFullBlock = false;
|
||||
$this->hardness = 15;
|
||||
}
|
||||
}
|
30
src/pocketmine/block/FenceDarkOak.php
Normal file
30
src/pocketmine/block/FenceDarkOak.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
class FenceDarkOak extends Fence{
|
||||
public function __construct(){
|
||||
Transparent::__construct(self::FENCE_DARK_OAK, 0, "Dark Oak Fence");
|
||||
$this->isFullBlock = false;
|
||||
$this->hardness = 15;
|
||||
}
|
||||
}
|
30
src/pocketmine/block/FenceJungle.php
Normal file
30
src/pocketmine/block/FenceJungle.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
class FenceJungle extends Fence{
|
||||
public function __construct(){
|
||||
Transparent::__construct(self::FENCE_JUNGLE, 0, "Jungle Fence");
|
||||
$this->isFullBlock = false;
|
||||
$this->hardness = 15;
|
||||
}
|
||||
}
|
30
src/pocketmine/block/FenceSpruce.php
Normal file
30
src/pocketmine/block/FenceSpruce.php
Normal file
@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
*
|
||||
* ____ _ _ __ __ _ __ __ ____
|
||||
* | _ \ ___ ___| | _____| |_| \/ (_)_ __ ___ | \/ | _ \
|
||||
* | |_) / _ \ / __| |/ / _ \ __| |\/| | | '_ \ / _ \_____| |\/| | |_) |
|
||||
* | __/ (_) | (__| < __/ |_| | | | | | | | __/_____| | | | __/
|
||||
* |_| \___/ \___|_|\_\___|\__|_| |_|_|_| |_|\___| |_| |_|_|
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Lesser General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* @author PocketMine Team
|
||||
* @link http://www.pocketmine.net/
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
namespace pocketmine\block;
|
||||
|
||||
class FenceSpruce extends Fence{
|
||||
public function __construct(){
|
||||
Transparent::__construct(self::FENCE_SPRUCE, 0, "Spruce Fence");
|
||||
$this->isFullBlock = false;
|
||||
$this->hardness = 15;
|
||||
}
|
||||
}
|
@ -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)));
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user