convert more constant interfaces to final classes, close #2885

This commit is contained in:
Dylan K. Taylor 2019-08-24 15:39:23 +01:00
parent ef8eba43d7
commit 75a2d79671
9 changed files with 45 additions and 9 deletions

View File

@ -23,7 +23,11 @@ declare(strict_types=1);
namespace pocketmine\block; namespace pocketmine\block;
interface BlockLegacyIds{ final class BlockLegacyIds{
private function __construct(){
//NOOP
}
public const AIR = 0; public const AIR = 0;
public const STONE = 1; public const STONE = 1;

View File

@ -26,7 +26,11 @@ namespace pocketmine\block;
/** /**
* Constants for legacy metadata for various blocks. * Constants for legacy metadata for various blocks.
*/ */
interface BlockLegacyMetadata{ final class BlockLegacyMetadata{
private function __construct(){
//NOOP
}
public const ANVIL_NORMAL = 0; public const ANVIL_NORMAL = 0;
public const ANVIL_SLIGHTLY_DAMAGED = 4; public const ANVIL_SLIGHTLY_DAMAGED = 4;

View File

@ -27,7 +27,11 @@ namespace pocketmine\block;
* Types of tools that can be used to break blocks * Types of tools that can be used to break blocks
* Blocks may allow multiple tool types by combining these bitflags * Blocks may allow multiple tool types by combining these bitflags
*/ */
interface BlockToolType{ final class BlockToolType{
private function __construct(){
//NOOP
}
public const NONE = 0; public const NONE = 0;
public const SWORD = 1 << 0; public const SWORD = 1 << 0;

View File

@ -23,7 +23,11 @@ declare(strict_types=1);
namespace pocketmine\item; namespace pocketmine\item;
interface ItemIds{ final class ItemIds{
private function __construct(){
//NOOP
}
public const LIT_BLAST_FURNACE = -214; public const LIT_BLAST_FURNACE = -214;
public const COMPOSTER = -213; public const COMPOSTER = -213;

View File

@ -26,7 +26,11 @@ namespace pocketmine\network\mcpe\protocol;
/** /**
* Version numbers and packet IDs for the current Minecraft PE protocol * Version numbers and packet IDs for the current Minecraft PE protocol
*/ */
interface ProtocolInfo{ final class ProtocolInfo{
private function __construct(){
//NOOP
}
/** /**
* NOTE TO DEVELOPERS * NOTE TO DEVELOPERS

View File

@ -23,7 +23,11 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types; namespace pocketmine\network\mcpe\protocol\types;
interface DimensionIds{ final class DimensionIds{
private function __construct(){
//NOOP
}
public const OVERWORLD = 0; public const OVERWORLD = 0;
public const NETHER = 1; public const NETHER = 1;

View File

@ -23,7 +23,11 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types; namespace pocketmine\network\mcpe\protocol\types;
interface PlayerPermissions{ final class PlayerPermissions{
private function __construct(){
//NOOP
}
public const CUSTOM = 3; public const CUSTOM = 3;
public const OPERATOR = 2; public const OPERATOR = 2;

View File

@ -23,7 +23,11 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types\inventory; namespace pocketmine\network\mcpe\protocol\types\inventory;
interface ContainerIds{ final class ContainerIds{
private function __construct(){
//NOOP
}
public const NONE = -1; public const NONE = -1;
public const INVENTORY = 0; public const INVENTORY = 0;

View File

@ -25,7 +25,11 @@ declare(strict_types=1);
namespace pocketmine\network\mcpe\protocol\types\inventory; namespace pocketmine\network\mcpe\protocol\types\inventory;
interface WindowTypes{ final class WindowTypes{
private function __construct(){
//NOOP
}
public const NONE = -9; public const NONE = -9;