Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Doors #1451

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions src/pocketmine/block/AcaciaDoor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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/
*
*
*/

declare(strict_types=1);

namespace pocketmine\block;

use pocketmine\item\Item;
use pocketmine\item\Tool;

/**
* Class AcaciaDoor
* @package pocketmine\block
*/
class AcaciaDoor extends Door {

protected $id = self::ACACIA_DOOR_BLOCK;

/**
* AcaciaDoor constructor.
*
* @param int $meta
*/
public function __construct($meta = 0){
$this->meta = $meta;
}

/**
* @return string
*/
public function getName() : string{
return "Acacia Door";
}

/**
* @return bool
*/
public function canBeActivated() : bool{
return true;
}

/**
* @return float
*/
public function getHardness() : float{
return 3;
}
/**
* @return int
*/
public function getToolType() : int{
return Tool::TYPE_AXE;
}

/**
* @param Item $item
*
* @return array
*/
public function getDrops(Item $item) : array{
return [
[Item::ACACIA_DOOR, 0, 1],
];
}
}
84 changes: 84 additions & 0 deletions src/pocketmine/block/BirchDoor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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/
*
*
*/

declare(strict_types=1);

namespace pocketmine\block;

use pocketmine\item\Item;
use pocketmine\item\Tool;

/**
* Class BirchDoor
* @package pocketmine\block
*/
class BirchDoor extends Door {

/** @var int $id */
protected $id = self::BIRCH_DOOR_BLOCK;

/**
* BirchDoor constructor.
*
* @param int $meta
*/
public function __construct($meta = 0){
$this->meta = $meta;
}

/**
* @return string
*/
public function getName() : string{
return "Birch Door";
}

/**
* @return bool
*/
public function canBeActivated() : bool{
return true;
}

/**
* @return float
*/
public function getHardness() : float{
return 3;
}
/**
* @return int
*/
public function getToolType() : int{
return Tool::TYPE_AXE;
}

/**
* @param Item $item
*
* @return array
*/
public function getDrops(Item $item) : array{
return [
[Item::BIRCH_DOOR, 0, 1],
];
}
}
84 changes: 84 additions & 0 deletions src/pocketmine/block/DarkOakDoor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?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/
*
*
*/

declare(strict_types=1);

namespace pocketmine\block;

use pocketmine\item\Item;
use pocketmine\item\Tool;

/**
* Class DarkOakDoor
* @package pocketmine\block
*/
class DarkOakDoor extends Door {

/** @var int $id */
protected $id = self::DARK_OAK_DOOR_BLOCK;

/**
* DarkOakDoor constructor.
*
* @param int $meta
*/
public function __construct($meta = 0){
$this->meta = $meta;
}

/**
* @return string
*/
public function getName() : string{
return "Dark Oak Door";
}

/**
* @return bool
*/
public function canBeActivated() : bool{
return true;
}

/**
* @return float
*/
public function getHardness() : float{
return 3;
}
/**
* @return int
*/
public function getToolType() : int{
return Tool::TYPE_AXE;
}

/**
* @param Item $item
*
* @return array
*/
public function getDrops(Item $item) : array{
return [
[Item::DARK_OAK_DOOR, 0, 1],
];
}
}
83 changes: 83 additions & 0 deletions src/pocketmine/block/JungleDoor.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
<?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/
*
*
*/

declare(strict_types=1);

namespace pocketmine\block;

use pocketmine\item\Item;
use pocketmine\item\Tool;

/**
* Class JungleDoor
* @package pocketmine\block
*/
class JungleDoor extends Door {

protected $id = self::JUNGLE_DOOR_BLOCK;

/**
* JungleDoor constructor.
*
* @param int $meta
*/
public function __construct($meta = 0){
$this->meta = $meta;
}

/**
* @return string
*/
public function getName() : string{
return "Acacia Door";
}

/**
* @return bool
*/
public function canBeActivated() : bool{
return true;
}

/**
* @return float
*/
public function getHardness() : float{
return 3;
}
/**
* @return int
*/
public function getToolType() : int{
return Tool::TYPE_AXE;
}

/**
* @param Item $item
*
* @return array
*/
public function getDrops(Item $item) : array{
return [
[Item::ACACIA_DOOR, 0, 1],
];
}
}
Loading