mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-22 00:33:59 +00:00
Merge branch 'master' into mcpe-1.0
This commit is contained in:
commit
850afed2c6
@ -221,7 +221,8 @@ class Block extends Position implements BlockIds, Metadatable{
|
||||
self::$list[self::WOOD2] = Wood2::class;
|
||||
self::$list[self::ACACIA_WOOD_STAIRS] = AcaciaWoodStairs::class;
|
||||
self::$list[self::DARK_OAK_WOOD_STAIRS] = DarkOakWoodStairs::class;
|
||||
|
||||
self::$list[self::PRISMARINE] = Prismarine::class;
|
||||
self::$list[self::SEA_LANTERN] = SeaLantern::class;
|
||||
self::$list[self::IRON_TRAPDOOR] = IronTrapdoor::class;
|
||||
self::$list[self::HAY_BALE] = HayBale::class;
|
||||
self::$list[self::CARPET] = Carpet::class;
|
||||
|
@ -161,6 +161,7 @@ interface BlockIds{
|
||||
const BIRCH_WOOD_STAIRS = 135, BIRCH_WOODEN_STAIRS = 135;
|
||||
const JUNGLE_WOOD_STAIRS = 136, JUNGLE_WOODEN_STAIRS = 136;
|
||||
|
||||
const BEACON = 138;
|
||||
const COBBLESTONE_WALL = 139, COBBLE_WALL = 139, STONE_WALL = 139;
|
||||
const FLOWER_POT_BLOCK = 140;
|
||||
const CARROT_BLOCK = 141;
|
||||
@ -190,7 +191,8 @@ interface BlockIds{
|
||||
const SLIME_BLOCK = 165;
|
||||
|
||||
const IRON_TRAPDOOR = 167;
|
||||
|
||||
const PRISMARINE = 168;
|
||||
const SEA_LANTERN = 169;
|
||||
const HAY_BALE = 170;
|
||||
const CARPET = 171;
|
||||
const HARDENED_CLAY = 172;
|
||||
|
65
src/pocketmine/block/Prismarine.php
Normal file
65
src/pocketmine/block/Prismarine.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?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;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Tool;
|
||||
|
||||
class Prismarine extends Solid{
|
||||
|
||||
const NORMAL = 0;
|
||||
const DARK = 1;
|
||||
const BRICKS = 2;
|
||||
|
||||
protected $id = self::PRISMARINE;
|
||||
|
||||
public function __construct($meta = 0){
|
||||
$this->meta = $meta;
|
||||
}
|
||||
|
||||
public function getHardness(){
|
||||
return 1.5;
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
static $names = [
|
||||
self::NORMAL => "Prismarine",
|
||||
self::DARK => "Dark Prismarine",
|
||||
self::BRICKS => "Prismarine Bricks",
|
||||
];
|
||||
return $names[$this->meta & 0x0f];
|
||||
}
|
||||
|
||||
public function getToolType(){
|
||||
return Tool::TYPE_PICKAXE;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
return [
|
||||
[$this->id, $this->meta & 0x0f, 1],
|
||||
];
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
53
src/pocketmine/block/SeaLantern.php
Normal file
53
src/pocketmine/block/SeaLantern.php
Normal file
@ -0,0 +1,53 @@
|
||||
<?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;
|
||||
|
||||
use pocketmine\item\Tool;
|
||||
use pocketmine\item\Item;
|
||||
|
||||
class SeaLantern extends Solid{
|
||||
|
||||
protected $id = self::SEA_LANTERN;
|
||||
|
||||
public function __construct($meta = 0){
|
||||
$this->meta = $meta;
|
||||
}
|
||||
|
||||
public function getName(){
|
||||
return "Sea Lantern";
|
||||
}
|
||||
|
||||
public function getHardness(){
|
||||
return 0.3;
|
||||
}
|
||||
|
||||
public function getLightLevel(){
|
||||
return 15;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item){
|
||||
return [
|
||||
[Item::PRISMARINE_CRYSTALS, 0, 3],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
@ -212,6 +212,9 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
self::$list[self::BEETROOT] = Beetroot::class;
|
||||
self::$list[self::BEETROOT_SEEDS] = BeetrootSeeds::class;
|
||||
self::$list[self::BEETROOT_SOUP] = BeetrootSoup::class;
|
||||
self::$list[self::PRISMARINE_CRYSTALS] = PrismarineCrystals::class;
|
||||
self::$list[self::PRISMARINE_SHARD] = PrismarineShard::class;
|
||||
self::$list[self::NETHER_STAR] = NetherStar::class;
|
||||
|
||||
for($i = 0; $i < 256; ++$i){
|
||||
if(Block::$list[$i] !== null){
|
||||
@ -799,7 +802,7 @@ class Item implements ItemIds, \JsonSerializable{
|
||||
$tag->tag = clone $this->getNamedTag();
|
||||
$tag->tag->setName("tag");
|
||||
}
|
||||
|
||||
|
||||
if($slot !== -1){
|
||||
$tag->Slot = new ByteTag("Slot", $slot);
|
||||
}
|
||||
|
@ -167,7 +167,7 @@ interface ItemIds extends BlockIds{
|
||||
const GOLDEN_CARROT = 396;
|
||||
const MOB_HEAD = 397, SKULL = 397;
|
||||
const CARROT_ON_A_STICK = 398;
|
||||
|
||||
const NETHER_STAR = 399;
|
||||
const PUMPKIN_PIE = 400;
|
||||
|
||||
const ENCHANTED_BOOK = 403;
|
||||
@ -176,7 +176,9 @@ interface ItemIds extends BlockIds{
|
||||
const QUARTZ = 406;
|
||||
const NETHER_QUARTZ = 406;
|
||||
const MINECART_WITH_TNT = 407;
|
||||
const MINECART_WITH_HOPPER = 408, HOPPER = 410;
|
||||
const MINECART_WITH_HOPPER = 408;
|
||||
const PRISMARINE_SHARD = 409;
|
||||
const HOPPER = 410;
|
||||
const RAW_RABBIT = 411;
|
||||
const COOKED_RABBIT = 412;
|
||||
const RABBIT_STEW = 413;
|
||||
@ -188,7 +190,7 @@ interface ItemIds extends BlockIds{
|
||||
const DIAMOND_HORSE_ARMOR = 419;
|
||||
const LEAD = 420, LEASH = 420;
|
||||
const NAMETAG = 421;
|
||||
|
||||
const PRISMARINE_CRYSTALS = 422;
|
||||
const RAW_MUTTON = 423;
|
||||
const COOKED_MUTTON = 424;
|
||||
|
||||
|
29
src/pocketmine/item/NetherStar.php
Normal file
29
src/pocketmine/item/NetherStar.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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\item;
|
||||
|
||||
|
||||
class NetherStar extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::NETHER_STAR, $meta, $count, "Nether Star");
|
||||
}
|
||||
}
|
29
src/pocketmine/item/PrismarineCrystals.php
Normal file
29
src/pocketmine/item/PrismarineCrystals.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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\item;
|
||||
|
||||
|
||||
class PrismarineCrystals extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::PRISMARINE_CRYSTALS, $meta, $count, "Prismarine Crystals");
|
||||
}
|
||||
}
|
29
src/pocketmine/item/PrismarineShard.php
Normal file
29
src/pocketmine/item/PrismarineShard.php
Normal file
@ -0,0 +1,29 @@
|
||||
<?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\item;
|
||||
|
||||
|
||||
class PrismarineShard extends Item{
|
||||
public function __construct($meta = 0, $count = 1){
|
||||
parent::__construct(self::PRISMARINE_SHARD, $meta, $count, "Prismarine Shard");
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user