mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-17 04:06:54 +00:00
Implemented Jukebox & Records (#3742)
Co-authored-by: Dylan K. Taylor <odigiman@gmail.com>
This commit is contained in:
@@ -26,6 +26,7 @@ namespace pocketmine\item;
|
||||
use pocketmine\block\BlockFactory;
|
||||
use pocketmine\block\BlockLegacyIds;
|
||||
use pocketmine\block\utils\DyeColor;
|
||||
use pocketmine\block\utils\RecordType;
|
||||
use pocketmine\block\utils\SkullType;
|
||||
use pocketmine\block\utils\TreeType;
|
||||
use pocketmine\block\VanillaBlocks;
|
||||
@@ -215,6 +216,18 @@ class ItemFactory{
|
||||
$this->register(new RawPorkchop(new ItemIdentifier(ItemIds::RAW_PORKCHOP, 0), "Raw Porkchop"));
|
||||
$this->register(new RawRabbit(new ItemIdentifier(ItemIds::RAW_RABBIT, 0), "Raw Rabbit"));
|
||||
$this->register(new RawSalmon(new ItemIdentifier(ItemIds::RAW_SALMON, 0), "Raw Salmon"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_13, 0), RecordType::DISK_13(), "Record 13"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_CAT, 0), RecordType::DISK_CAT(), "Record Cat"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_BLOCKS, 0), RecordType::DISK_BLOCKS(), "Record Blocks"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_CHIRP, 0), RecordType::DISK_CHIRP(), "Record Chirp"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_FAR, 0), RecordType::DISK_FAR(), "Record Far"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_MALL, 0), RecordType::DISK_MALL(), "Record Mall"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_MELLOHI, 0), RecordType::DISK_MELLOHI(), "Record Mellohi"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_STAL, 0), RecordType::DISK_STAL(), "Record Stal"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_STRAD, 0), RecordType::DISK_STRAD(), "Record Strad"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_WARD, 0), RecordType::DISK_WARD(), "Record Ward"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_11, 0), RecordType::DISK_11(), "Record 11"));
|
||||
$this->register(new Record(new ItemIdentifier(ItemIds::RECORD_WAIT, 0), RecordType::DISK_WAIT(), "Record Wait"));
|
||||
$this->register(new Redstone(new ItemIdentifier(ItemIds::REDSTONE, 0), "Redstone"));
|
||||
$this->register(new RottenFlesh(new ItemIdentifier(ItemIds::ROTTEN_FLESH, 0), "Rotten Flesh"));
|
||||
$this->register(new Shears(new ItemIdentifier(ItemIds::SHEARS, 0), "Shears"));
|
||||
@@ -294,18 +307,7 @@ class ItemFactory{
|
||||
//TODO: minecraft:name_tag
|
||||
//TODO: minecraft:phantom_membrane
|
||||
//TODO: minecraft:rapid_fertilizer
|
||||
//TODO: minecraft:record_11
|
||||
//TODO: minecraft:record_13
|
||||
//TODO: minecraft:record_blocks
|
||||
//TODO: minecraft:record_cat
|
||||
//TODO: minecraft:record_chirp
|
||||
//TODO: minecraft:record_far
|
||||
//TODO: minecraft:record_mall
|
||||
//TODO: minecraft:record_mellohi
|
||||
//TODO: minecraft:record_stal
|
||||
//TODO: minecraft:record_strad
|
||||
//TODO: minecraft:record_wait
|
||||
//TODO: minecraft:record_ward
|
||||
//TODO: minecraft:record_pigstep
|
||||
//TODO: minecraft:saddle
|
||||
//TODO: minecraft:shield
|
||||
//TODO: minecraft:sparkler
|
||||
|
44
src/item/Record.php
Normal file
44
src/item/Record.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?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\item;
|
||||
|
||||
use pocketmine\block\utils\RecordType;
|
||||
|
||||
class Record extends Item{
|
||||
/** @var RecordType */
|
||||
private $recordType;
|
||||
|
||||
public function __construct(ItemIdentifier $identifier, RecordType $recordType, string $name){
|
||||
$this->recordType = $recordType;
|
||||
parent::__construct($identifier, $name);
|
||||
}
|
||||
|
||||
public function getRecordType() : RecordType{
|
||||
return $this->recordType;
|
||||
}
|
||||
|
||||
public function getMaxStackSize() : int{
|
||||
return 1;
|
||||
}
|
||||
}
|
@@ -247,6 +247,18 @@ use function assert;
|
||||
* @method static RawPorkchop RAW_PORKCHOP()
|
||||
* @method static RawRabbit RAW_RABBIT()
|
||||
* @method static RawSalmon RAW_SALMON()
|
||||
* @method static Record RECORD_11()
|
||||
* @method static Record RECORD_13()
|
||||
* @method static Record RECORD_BLOCKS()
|
||||
* @method static Record RECORD_CAT()
|
||||
* @method static Record RECORD_CHIRP()
|
||||
* @method static Record RECORD_FAR()
|
||||
* @method static Record RECORD_MALL()
|
||||
* @method static Record RECORD_MELLOHI()
|
||||
* @method static Record RECORD_STAL()
|
||||
* @method static Record RECORD_STRAD()
|
||||
* @method static Record RECORD_WAIT()
|
||||
* @method static Record RECORD_WARD()
|
||||
* @method static Banner RED_BANNER()
|
||||
* @method static Bed RED_BED()
|
||||
* @method static Dye RED_DYE()
|
||||
@@ -535,6 +547,18 @@ final class VanillaItems{
|
||||
self::register("raw_porkchop", $factory->get(319));
|
||||
self::register("raw_rabbit", $factory->get(411));
|
||||
self::register("raw_salmon", $factory->get(460));
|
||||
self::register("record_11", $factory->get(510));
|
||||
self::register("record_13", $factory->get(500));
|
||||
self::register("record_blocks", $factory->get(502));
|
||||
self::register("record_cat", $factory->get(501));
|
||||
self::register("record_chirp", $factory->get(503));
|
||||
self::register("record_far", $factory->get(504));
|
||||
self::register("record_mall", $factory->get(505));
|
||||
self::register("record_mellohi", $factory->get(506));
|
||||
self::register("record_stal", $factory->get(507));
|
||||
self::register("record_strad", $factory->get(508));
|
||||
self::register("record_wait", $factory->get(511));
|
||||
self::register("record_ward", $factory->get(509));
|
||||
self::register("red_banner", $factory->get(446, 1));
|
||||
self::register("red_bed", $factory->get(355, 14));
|
||||
self::register("red_dye", $factory->get(351, 1));
|
||||
|
Reference in New Issue
Block a user