diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 2a5a534f37..c0dead837a 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -82,7 +82,6 @@ use pocketmine\scheduler\AsyncPool; use pocketmine\scheduler\SendUsageTask; use pocketmine\snooze\SleeperHandler; use pocketmine\snooze\SleeperNotifier; -use pocketmine\tile\TileFactory; use pocketmine\timings\Timings; use pocketmine\timings\TimingsHandler; use pocketmine\updater\AutoUpdater; @@ -1187,7 +1186,6 @@ class Server{ $this->commandMap = new SimpleCommandMap($this); EntityFactory::init(); - TileFactory::init(); BlockFactory::init(); Enchantment::init(); ItemFactory::init(); diff --git a/src/pocketmine/block/Banner.php b/src/pocketmine/block/Banner.php index cc810f3bf3..b5abb29f21 100644 --- a/src/pocketmine/block/Banner.php +++ b/src/pocketmine/block/Banner.php @@ -24,6 +24,7 @@ declare(strict_types=1); namespace pocketmine\block; use Ds\Deque; +use pocketmine\block\tile\Banner as TileBanner; use pocketmine\block\utils\BannerPattern; use pocketmine\block\utils\BlockDataValidator; use pocketmine\block\utils\DyeColor; @@ -34,7 +35,6 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Banner as TileBanner; use function assert; use function floor; diff --git a/src/pocketmine/block/Bed.php b/src/pocketmine/block/Bed.php index bd7037402f..41fe42895e 100644 --- a/src/pocketmine/block/Bed.php +++ b/src/pocketmine/block/Bed.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Bed as TileBed; use pocketmine\block\utils\BlockDataValidator; use pocketmine\block\utils\DyeColor; use pocketmine\item\Bed as ItemBed; @@ -34,7 +35,6 @@ use pocketmine\math\Bearing; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Bed as TileBed; use pocketmine\utils\TextFormat; use pocketmine\world\World; diff --git a/src/pocketmine/block/Block.php b/src/pocketmine/block/Block.php index a050a12bfb..16b2428399 100644 --- a/src/pocketmine/block/Block.php +++ b/src/pocketmine/block/Block.php @@ -26,6 +26,8 @@ declare(strict_types=1); */ namespace pocketmine\block; +use pocketmine\block\tile\Tile; +use pocketmine\block\tile\TileFactory; use pocketmine\block\utils\InvalidBlockStateException; use pocketmine\entity\Entity; use pocketmine\item\enchantment\Enchantment; @@ -41,8 +43,6 @@ use pocketmine\nbt\tag\CompoundTag; use pocketmine\network\mcpe\protocol\types\RuntimeBlockMapping; use pocketmine\Player; use pocketmine\plugin\Plugin; -use pocketmine\tile\Tile; -use pocketmine\tile\TileFactory; use pocketmine\world\Position; use pocketmine\world\World; use function array_merge; diff --git a/src/pocketmine/block/BlockFactory.php b/src/pocketmine/block/BlockFactory.php index ab7068e6a3..10b4588636 100644 --- a/src/pocketmine/block/BlockFactory.php +++ b/src/pocketmine/block/BlockFactory.php @@ -24,6 +24,18 @@ declare(strict_types=1); namespace pocketmine\block; use pocketmine\block\BlockIdentifier as BID; +use pocketmine\block\tile\Banner as TileBanner; +use pocketmine\block\tile\Bed as TileBed; +use pocketmine\block\tile\Chest as TileChest; +use pocketmine\block\tile\Comparator; +use pocketmine\block\tile\EnchantTable as TileEnchantingTable; +use pocketmine\block\tile\EnderChest as TileEnderChest; +use pocketmine\block\tile\FlowerPot as TileFlowerPot; +use pocketmine\block\tile\Furnace as TileFurnace; +use pocketmine\block\tile\ItemFrame as TileItemFrame; +use pocketmine\block\tile\Sign as TileSign; +use pocketmine\block\tile\Skull as TileSkull; +use pocketmine\block\tile\TileFactory; use pocketmine\block\utils\DyeColor; use pocketmine\block\utils\InvalidBlockStateException; use pocketmine\block\utils\PillarRotationTrait; @@ -32,7 +44,6 @@ use pocketmine\item\Item; use pocketmine\item\ItemFactory; use pocketmine\item\ItemIds; use pocketmine\item\TieredTool; -use pocketmine\tile\Comparator; use pocketmine\world\Position; use function array_fill; use function array_filter; @@ -58,6 +69,8 @@ class BlockFactory{ * this if you need to reset the block factory back to its original defaults for whatever reason. */ public static function init() : void{ + TileFactory::init(); + self::$fullList = new \SplFixedArray(8192); self::$lightFilter = \SplFixedArray::fromArray(array_fill(0, 8192, 1)); @@ -69,9 +82,9 @@ class BlockFactory{ self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, BlockLegacyMetadata::ANVIL_NORMAL), "Anvil")); self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, BlockLegacyMetadata::ANVIL_SLIGHTLY_DAMAGED), "Slightly Damaged Anvil")); self::register(new Anvil(new BID(BlockLegacyIds::ANVIL, BlockLegacyMetadata::ANVIL_VERY_DAMAGED), "Very Damaged Anvil")); - self::register(new Banner(new BlockIdentifierFlattened(BlockLegacyIds::STANDING_BANNER, BlockLegacyIds::WALL_BANNER, 0, ItemIds::BANNER, \pocketmine\tile\Banner::class), "Banner")); + self::register(new Banner(new BlockIdentifierFlattened(BlockLegacyIds::STANDING_BANNER, BlockLegacyIds::WALL_BANNER, 0, ItemIds::BANNER, TileBanner::class), "Banner")); self::register(new Transparent(new BID(BlockLegacyIds::BARRIER), "Barrier", BlockBreakInfo::indestructible())); - self::register(new Bed(new BID(BlockLegacyIds::BED_BLOCK, 0, ItemIds::BED, \pocketmine\tile\Bed::class), "Bed Block")); + self::register(new Bed(new BID(BlockLegacyIds::BED_BLOCK, 0, ItemIds::BED, TileBed::class), "Bed Block")); self::register(new Bedrock(new BID(BlockLegacyIds::BEDROCK), "Bedrock")); self::register(new Beetroot(new BID(BlockLegacyIds::BEETROOT_BLOCK), "Beetroot Block")); self::register(new BlueIce(new BID(BlockLegacyIds::BLUE_ICE), "Blue Ice")); @@ -88,7 +101,7 @@ class BlockFactory{ self::register(new Cactus(new BID(BlockLegacyIds::CACTUS), "Cactus")); self::register(new Cake(new BID(BlockLegacyIds::CAKE_BLOCK, 0, ItemIds::CAKE), "Cake")); self::register(new Carrot(new BID(BlockLegacyIds::CARROTS), "Carrot Block")); - self::register(new Chest(new BID(BlockLegacyIds::CHEST, 0, null, \pocketmine\tile\Chest::class), "Chest")); + self::register(new Chest(new BID(BlockLegacyIds::CHEST, 0, null, TileChest::class), "Chest")); self::register(new Clay(new BID(BlockLegacyIds::CLAY_BLOCK), "Clay Block")); self::register(new Coal(new BID(BlockLegacyIds::COAL_BLOCK), "Coal Block")); self::register(new CoalOre(new BID(BlockLegacyIds::COAL_ORE), "Coal Ore")); @@ -119,7 +132,7 @@ class BlockFactory{ self::register(new DragonEgg(new BID(BlockLegacyIds::DRAGON_EGG), "Dragon Egg")); self::register(new Solid(new BID(BlockLegacyIds::EMERALD_BLOCK), "Emerald Block", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_IRON, 30.0))); self::register(new EmeraldOre(new BID(BlockLegacyIds::EMERALD_ORE), "Emerald Ore")); - self::register(new EnchantingTable(new BID(BlockLegacyIds::ENCHANTING_TABLE, 0, null, \pocketmine\tile\EnchantTable::class), "Enchanting Table")); + self::register(new EnchantingTable(new BID(BlockLegacyIds::ENCHANTING_TABLE, 0, null, TileEnchantingTable::class), "Enchanting Table")); self::register(new EndPortalFrame(new BID(BlockLegacyIds::END_PORTAL_FRAME), "End Portal Frame")); self::register(new EndRod(new BID(BlockLegacyIds::END_ROD), "End Rod")); self::register(new Solid(new BID(BlockLegacyIds::END_STONE), "End Stone", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 45.0))); @@ -128,7 +141,7 @@ class BlockFactory{ self::register(new Solid(new BID(BlockLegacyIds::END_BRICKS), "End Stone Bricks", $endBrickBreakInfo)); self::register(new Stair(new BID(BlockLegacyIds::END_BRICK_STAIRS), "End Stone Brick Stairs", $endBrickBreakInfo)); - self::register(new EnderChest(new BID(BlockLegacyIds::ENDER_CHEST, 0, null, \pocketmine\tile\EnderChest::class), "Ender Chest")); + self::register(new EnderChest(new BID(BlockLegacyIds::ENDER_CHEST, 0, null, TileEnderChest::class), "Ender Chest")); self::register(new Farmland(new BID(BlockLegacyIds::FARMLAND), "Farmland")); self::register(new Fire(new BID(BlockLegacyIds::FIRE), "Fire Block")); self::register(new Flower(new BID(BlockLegacyIds::DANDELION), "Dandelion")); @@ -143,9 +156,9 @@ class BlockFactory{ self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, BlockLegacyMetadata::FLOWER_POPPY), "Poppy")); self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, BlockLegacyMetadata::FLOWER_RED_TULIP), "Red Tulip")); self::register(new Flower(new BID(BlockLegacyIds::RED_FLOWER, BlockLegacyMetadata::FLOWER_WHITE_TULIP), "White Tulip")); - self::register(new FlowerPot(new BID(BlockLegacyIds::FLOWER_POT_BLOCK, 0, ItemIds::FLOWER_POT, \pocketmine\tile\FlowerPot::class), "Flower Pot")); + self::register(new FlowerPot(new BID(BlockLegacyIds::FLOWER_POT_BLOCK, 0, ItemIds::FLOWER_POT, TileFlowerPot::class), "Flower Pot")); self::register(new FrostedIce(new BID(BlockLegacyIds::FROSTED_ICE), "Frosted Ice")); - self::register(new Furnace(new BlockIdentifierFlattened(BlockLegacyIds::FURNACE, BlockLegacyIds::LIT_FURNACE, 0, null, \pocketmine\tile\Furnace::class), "Furnace")); + self::register(new Furnace(new BlockIdentifierFlattened(BlockLegacyIds::FURNACE, BlockLegacyIds::LIT_FURNACE, 0, null, TileFurnace::class), "Furnace")); self::register(new Glass(new BID(BlockLegacyIds::GLASS), "Glass")); self::register(new GlassPane(new BID(BlockLegacyIds::GLASS_PANE), "Glass Pane")); self::register(new GlowingObsidian(new BID(BlockLegacyIds::GLOWINGOBSIDIAN), "Glowing Obsidian")); @@ -200,7 +213,7 @@ class BlockFactory{ self::register(new Door(new BID(BlockLegacyIds::IRON_DOOR_BLOCK, 0, ItemIds::IRON_DOOR), "Iron Door", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 25.0))); self::register(new Solid(new BID(BlockLegacyIds::IRON_ORE), "Iron Ore", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE))); self::register(new Trapdoor(new BID(BlockLegacyIds::IRON_TRAPDOOR), "Iron Trapdoor", new BlockBreakInfo(5.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_WOODEN, 25.0))); - self::register(new ItemFrame(new BID(BlockLegacyIds::FRAME_BLOCK, 0, ItemIds::FRAME, \pocketmine\tile\ItemFrame::class), "Item Frame")); + self::register(new ItemFrame(new BID(BlockLegacyIds::FRAME_BLOCK, 0, ItemIds::FRAME, TileItemFrame::class), "Item Frame")); self::register(new Ladder(new BID(BlockLegacyIds::LADDER), "Ladder")); self::register(new Solid(new BID(BlockLegacyIds::LAPIS_BLOCK), "Lapis Lazuli Block", new BlockBreakInfo(3.0, BlockToolType::TYPE_PICKAXE, TieredTool::TIER_STONE))); self::register(new LapisOre(new BID(BlockLegacyIds::LAPIS_ORE), "Lapis Lazuli Ore")); @@ -277,7 +290,7 @@ class BlockFactory{ self::register(new Sand(new BID(BlockLegacyIds::SAND, 1), "Red Sand")); self::register(new SeaLantern(new BID(BlockLegacyIds::SEALANTERN), "Sea Lantern")); self::register(new SeaPickle(new BID(BlockLegacyIds::SEA_PICKLE), "Sea Pickle")); - self::register(new Skull(new BID(BlockLegacyIds::MOB_HEAD_BLOCK, 0, null, \pocketmine\tile\Skull::class), "Mob Head")); + self::register(new Skull(new BID(BlockLegacyIds::MOB_HEAD_BLOCK, 0, null, TileSkull::class), "Mob Head")); @@ -358,7 +371,7 @@ class BlockFactory{ self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_RG), "Red Torch")); self::register(new Torch(new BID(BlockLegacyIds::COLORED_TORCH_RG, 8), "Green Torch")); self::register(new Torch(new BID(BlockLegacyIds::TORCH), "Torch")); - self::register(new TrappedChest(new BID(BlockLegacyIds::TRAPPED_CHEST, 0, null, \pocketmine\tile\Chest::class), "Trapped Chest")); + self::register(new TrappedChest(new BID(BlockLegacyIds::TRAPPED_CHEST, 0, null, TileChest::class), "Trapped Chest")); self::register(new Tripwire(new BID(BlockLegacyIds::TRIPWIRE, 0, ItemIds::STRING), "Tripwire")); self::register(new TripwireHook(new BID(BlockLegacyIds::TRIPWIRE_HOOK), "Tripwire Hook")); self::register(new UnderwaterTorch(new BID(BlockLegacyIds::UNDERWATER_TORCH), "Underwater Torch")); @@ -427,12 +440,12 @@ class BlockFactory{ /** @var BlockIdentifierFlattened[]|\SplObjectStorage $woodenSignIds */ $woodenSignIds = new \SplObjectStorage(); - $woodenSignIds[TreeType::OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::SIGN_POST, BlockLegacyIds::WALL_SIGN, 0, ItemIds::SIGN, \pocketmine\tile\Sign::class); - $woodenSignIds[TreeType::SPRUCE()] = new BlockIdentifierFlattened(BlockLegacyIds::SPRUCE_STANDING_SIGN, BlockLegacyIds::SPRUCE_WALL_SIGN, 0, ItemIds::SPRUCE_SIGN, \pocketmine\tile\Sign::class); - $woodenSignIds[TreeType::BIRCH()] = new BlockIdentifierFlattened(BlockLegacyIds::BIRCH_STANDING_SIGN, BlockLegacyIds::BIRCH_WALL_SIGN, 0, ItemIds::BIRCH_SIGN, \pocketmine\tile\Sign::class); - $woodenSignIds[TreeType::JUNGLE()] = new BlockIdentifierFlattened(BlockLegacyIds::JUNGLE_STANDING_SIGN, BlockLegacyIds::JUNGLE_WALL_SIGN, 0, ItemIds::JUNGLE_SIGN, \pocketmine\tile\Sign::class); - $woodenSignIds[TreeType::ACACIA()] = new BlockIdentifierFlattened(BlockLegacyIds::ACACIA_STANDING_SIGN, BlockLegacyIds::ACACIA_WALL_SIGN, 0, ItemIds::ACACIA_SIGN, \pocketmine\tile\Sign::class); - $woodenSignIds[TreeType::DARK_OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::DARKOAK_STANDING_SIGN, BlockLegacyIds::DARKOAK_WALL_SIGN, 0, ItemIds::DARKOAK_SIGN, \pocketmine\tile\Sign::class); + $woodenSignIds[TreeType::OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::SIGN_POST, BlockLegacyIds::WALL_SIGN, 0, ItemIds::SIGN, TileSign::class); + $woodenSignIds[TreeType::SPRUCE()] = new BlockIdentifierFlattened(BlockLegacyIds::SPRUCE_STANDING_SIGN, BlockLegacyIds::SPRUCE_WALL_SIGN, 0, ItemIds::SPRUCE_SIGN, TileSign::class); + $woodenSignIds[TreeType::BIRCH()] = new BlockIdentifierFlattened(BlockLegacyIds::BIRCH_STANDING_SIGN, BlockLegacyIds::BIRCH_WALL_SIGN, 0, ItemIds::BIRCH_SIGN, TileSign::class); + $woodenSignIds[TreeType::JUNGLE()] = new BlockIdentifierFlattened(BlockLegacyIds::JUNGLE_STANDING_SIGN, BlockLegacyIds::JUNGLE_WALL_SIGN, 0, ItemIds::JUNGLE_SIGN, TileSign::class); + $woodenSignIds[TreeType::ACACIA()] = new BlockIdentifierFlattened(BlockLegacyIds::ACACIA_STANDING_SIGN, BlockLegacyIds::ACACIA_WALL_SIGN, 0, ItemIds::ACACIA_SIGN, TileSign::class); + $woodenSignIds[TreeType::DARK_OAK()] = new BlockIdentifierFlattened(BlockLegacyIds::DARKOAK_STANDING_SIGN, BlockLegacyIds::DARKOAK_WALL_SIGN, 0, ItemIds::DARKOAK_SIGN, TileSign::class); //endregion foreach(TreeType::getAll() as $treeType){ diff --git a/src/pocketmine/block/Chest.php b/src/pocketmine/block/Chest.php index f2b41e89cb..6c72e61344 100644 --- a/src/pocketmine/block/Chest.php +++ b/src/pocketmine/block/Chest.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Chest as TileChest; use pocketmine\block\utils\BlockDataValidator; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Chest as TileChest; class Chest extends Transparent{ diff --git a/src/pocketmine/block/EnderChest.php b/src/pocketmine/block/EnderChest.php index 9c697cba46..e5e294797c 100644 --- a/src/pocketmine/block/EnderChest.php +++ b/src/pocketmine/block/EnderChest.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\EnderChest as TileEnderChest; use pocketmine\block\utils\BlockDataValidator; use pocketmine\item\Item; use pocketmine\item\ItemFactory; @@ -31,7 +32,6 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\EnderChest as TileEnderChest; class EnderChest extends Transparent{ diff --git a/src/pocketmine/block/FlowerPot.php b/src/pocketmine/block/FlowerPot.php index 476e194ba0..3c54598ca6 100644 --- a/src/pocketmine/block/FlowerPot.php +++ b/src/pocketmine/block/FlowerPot.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\FlowerPot as TileFlowerPot; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\FlowerPot as TileFlowerPot; use function assert; class FlowerPot extends Flowable{ diff --git a/src/pocketmine/block/Furnace.php b/src/pocketmine/block/Furnace.php index 952d5ba331..fd0a4218f2 100644 --- a/src/pocketmine/block/Furnace.php +++ b/src/pocketmine/block/Furnace.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Furnace as TileFurnace; use pocketmine\block\utils\BlockDataValidator; use pocketmine\item\Item; use pocketmine\item\TieredTool; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Furnace as TileFurnace; class Furnace extends Solid{ /** @var BlockIdentifierFlattened */ diff --git a/src/pocketmine/block/ItemFrame.php b/src/pocketmine/block/ItemFrame.php index 16e7e90c4d..d3dfc235c0 100644 --- a/src/pocketmine/block/ItemFrame.php +++ b/src/pocketmine/block/ItemFrame.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\ItemFrame as TileItemFrame; use pocketmine\block\utils\BlockDataValidator; use pocketmine\item\Item; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\ItemFrame as TileItemFrame; use function lcg_value; class ItemFrame extends Flowable{ diff --git a/src/pocketmine/block/RedstoneComparator.php b/src/pocketmine/block/RedstoneComparator.php index 61f0b3c0dd..3090ee026b 100644 --- a/src/pocketmine/block/RedstoneComparator.php +++ b/src/pocketmine/block/RedstoneComparator.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Comparator; use pocketmine\block\utils\BlockDataValidator; use pocketmine\item\Item; use pocketmine\math\AxisAlignedBB; @@ -30,7 +31,6 @@ use pocketmine\math\Bearing; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Comparator; use function assert; class RedstoneComparator extends Flowable{ diff --git a/src/pocketmine/block/Sign.php b/src/pocketmine/block/Sign.php index d61b700c15..3652b840a8 100644 --- a/src/pocketmine/block/Sign.php +++ b/src/pocketmine/block/Sign.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Sign as TileSign; use pocketmine\block\utils\BlockDataValidator; use pocketmine\block\utils\SignText; use pocketmine\event\block\SignChangeEvent; @@ -31,7 +32,6 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Sign as TileSign; use pocketmine\utils\TextFormat; use function array_map; use function assert; diff --git a/src/pocketmine/block/Skull.php b/src/pocketmine/block/Skull.php index ef450e7f1e..fcd242a923 100644 --- a/src/pocketmine/block/Skull.php +++ b/src/pocketmine/block/Skull.php @@ -23,6 +23,7 @@ declare(strict_types=1); namespace pocketmine\block; +use pocketmine\block\tile\Skull as TileSkull; use pocketmine\block\utils\BlockDataValidator; use pocketmine\block\utils\SkullType; use pocketmine\item\Item; @@ -32,7 +33,6 @@ use pocketmine\math\AxisAlignedBB; use pocketmine\math\Facing; use pocketmine\math\Vector3; use pocketmine\Player; -use pocketmine\tile\Skull as TileSkull; use function assert; use function floor; diff --git a/src/pocketmine/tile/Banner.php b/src/pocketmine/block/tile/Banner.php similarity index 99% rename from src/pocketmine/tile/Banner.php rename to src/pocketmine/block/tile/Banner.php index 0b8997f3d9..58163ebba2 100644 --- a/src/pocketmine/tile/Banner.php +++ b/src/pocketmine/block/tile/Banner.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use Ds\Deque; use pocketmine\block\utils\BannerPattern; diff --git a/src/pocketmine/tile/Bed.php b/src/pocketmine/block/tile/Bed.php similarity index 98% rename from src/pocketmine/tile/Bed.php rename to src/pocketmine/block/tile/Bed.php index bc8f9b444b..2f8b3f2bdd 100644 --- a/src/pocketmine/tile/Bed.php +++ b/src/pocketmine/block/tile/Bed.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\utils\DyeColor; use pocketmine\math\Vector3; diff --git a/src/pocketmine/tile/Chest.php b/src/pocketmine/block/tile/Chest.php similarity index 99% rename from src/pocketmine/tile/Chest.php rename to src/pocketmine/block/tile/Chest.php index b59fd3b5f0..c766ac9196 100644 --- a/src/pocketmine/tile/Chest.php +++ b/src/pocketmine/block/tile/Chest.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\inventory\ChestInventory; use pocketmine\inventory\DoubleChestInventory; diff --git a/src/pocketmine/tile/Comparator.php b/src/pocketmine/block/tile/Comparator.php similarity index 97% rename from src/pocketmine/tile/Comparator.php rename to src/pocketmine/block/tile/Comparator.php index 4e66512707..c19383ab18 100644 --- a/src/pocketmine/tile/Comparator.php +++ b/src/pocketmine/block/tile/Comparator.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\RedstoneComparator; use pocketmine\nbt\tag\CompoundTag; diff --git a/src/pocketmine/tile/Container.php b/src/pocketmine/block/tile/Container.php similarity index 97% rename from src/pocketmine/tile/Container.php rename to src/pocketmine/block/tile/Container.php index 1e98dc5a12..d10a376726 100644 --- a/src/pocketmine/tile/Container.php +++ b/src/pocketmine/block/tile/Container.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\inventory\Inventory; diff --git a/src/pocketmine/tile/ContainerTrait.php b/src/pocketmine/block/tile/ContainerTrait.php similarity index 98% rename from src/pocketmine/tile/ContainerTrait.php rename to src/pocketmine/block/tile/ContainerTrait.php index 28cc6b04eb..00652b5cb3 100644 --- a/src/pocketmine/tile/ContainerTrait.php +++ b/src/pocketmine/block/tile/ContainerTrait.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\inventory\Inventory; use pocketmine\item\Item; diff --git a/src/pocketmine/tile/EnchantTable.php b/src/pocketmine/block/tile/EnchantTable.php similarity index 96% rename from src/pocketmine/tile/EnchantTable.php rename to src/pocketmine/block/tile/EnchantTable.php index 00e64412b8..fe48a85185 100644 --- a/src/pocketmine/tile/EnchantTable.php +++ b/src/pocketmine/block/tile/EnchantTable.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; class EnchantTable extends Spawnable implements Nameable{ use NameableTrait { diff --git a/src/pocketmine/tile/EnderChest.php b/src/pocketmine/block/tile/EnderChest.php similarity index 96% rename from src/pocketmine/tile/EnderChest.php rename to src/pocketmine/block/tile/EnderChest.php index 9493c924e6..902bc79f8a 100644 --- a/src/pocketmine/tile/EnderChest.php +++ b/src/pocketmine/block/tile/EnderChest.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\nbt\tag\CompoundTag; diff --git a/src/pocketmine/tile/FlowerPot.php b/src/pocketmine/block/tile/FlowerPot.php similarity index 98% rename from src/pocketmine/tile/FlowerPot.php rename to src/pocketmine/block/tile/FlowerPot.php index 4aeeceac05..0c626bb33d 100644 --- a/src/pocketmine/tile/FlowerPot.php +++ b/src/pocketmine/block/tile/FlowerPot.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\Air; use pocketmine\block\Block; diff --git a/src/pocketmine/tile/Furnace.php b/src/pocketmine/block/tile/Furnace.php similarity index 99% rename from src/pocketmine/tile/Furnace.php rename to src/pocketmine/block/tile/Furnace.php index ad9337139e..c612e8213d 100644 --- a/src/pocketmine/tile/Furnace.php +++ b/src/pocketmine/block/tile/Furnace.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\Furnace as BlockFurnace; use pocketmine\event\inventory\FurnaceBurnEvent; diff --git a/src/pocketmine/tile/ItemFrame.php b/src/pocketmine/block/tile/ItemFrame.php similarity index 98% rename from src/pocketmine/tile/ItemFrame.php rename to src/pocketmine/block/tile/ItemFrame.php index dd54ef6d6c..e042c049d7 100644 --- a/src/pocketmine/tile/ItemFrame.php +++ b/src/pocketmine/block/tile/ItemFrame.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\item\Item; use pocketmine\item\ItemFactory; diff --git a/src/pocketmine/tile/Nameable.php b/src/pocketmine/block/tile/Nameable.php similarity index 97% rename from src/pocketmine/tile/Nameable.php rename to src/pocketmine/block/tile/Nameable.php index 9f407461ef..8e8683533f 100644 --- a/src/pocketmine/tile/Nameable.php +++ b/src/pocketmine/block/tile/Nameable.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; interface Nameable{ public const TAG_CUSTOM_NAME = "CustomName"; diff --git a/src/pocketmine/tile/NameableTrait.php b/src/pocketmine/block/tile/NameableTrait.php similarity index 98% rename from src/pocketmine/tile/NameableTrait.php rename to src/pocketmine/block/tile/NameableTrait.php index 8f9ad1070b..38b89897c9 100644 --- a/src/pocketmine/tile/NameableTrait.php +++ b/src/pocketmine/block/tile/NameableTrait.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\item\Item; use pocketmine\nbt\tag\CompoundTag; diff --git a/src/pocketmine/tile/Sign.php b/src/pocketmine/block/tile/Sign.php similarity index 98% rename from src/pocketmine/tile/Sign.php rename to src/pocketmine/block/tile/Sign.php index 09ff5d44f6..a53f5cfa6c 100644 --- a/src/pocketmine/tile/Sign.php +++ b/src/pocketmine/block/tile/Sign.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\utils\SignText; use pocketmine\math\Vector3; diff --git a/src/pocketmine/tile/Skull.php b/src/pocketmine/block/tile/Skull.php similarity index 98% rename from src/pocketmine/tile/Skull.php rename to src/pocketmine/block/tile/Skull.php index 10b330d8d6..d4ede3ba98 100644 --- a/src/pocketmine/tile/Skull.php +++ b/src/pocketmine/block/tile/Skull.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\utils\SkullType; use pocketmine\math\Vector3; diff --git a/src/pocketmine/tile/Spawnable.php b/src/pocketmine/block/tile/Spawnable.php similarity index 98% rename from src/pocketmine/tile/Spawnable.php rename to src/pocketmine/block/tile/Spawnable.php index 6bb21cddbf..6568ad6c46 100644 --- a/src/pocketmine/tile/Spawnable.php +++ b/src/pocketmine/block/tile/Spawnable.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\TreeRoot; diff --git a/src/pocketmine/tile/Tile.php b/src/pocketmine/block/tile/Tile.php similarity index 99% rename from src/pocketmine/tile/Tile.php rename to src/pocketmine/block/tile/Tile.php index ee041cc63b..fbdece662d 100644 --- a/src/pocketmine/tile/Tile.php +++ b/src/pocketmine/block/tile/Tile.php @@ -25,7 +25,7 @@ declare(strict_types=1); * All the Tile classes and related classes */ -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\block\Block; use pocketmine\item\Item; diff --git a/src/pocketmine/tile/TileFactory.php b/src/pocketmine/block/tile/TileFactory.php similarity index 99% rename from src/pocketmine/tile/TileFactory.php rename to src/pocketmine/block/tile/TileFactory.php index 35bab3e899..b87e0d4ef0 100644 --- a/src/pocketmine/tile/TileFactory.php +++ b/src/pocketmine/block/tile/TileFactory.php @@ -21,7 +21,7 @@ declare(strict_types=1); -namespace pocketmine\tile; +namespace pocketmine\block\tile; use pocketmine\math\Vector3; use pocketmine\nbt\tag\CompoundTag; diff --git a/src/pocketmine/event/inventory/FurnaceBurnEvent.php b/src/pocketmine/event/inventory/FurnaceBurnEvent.php index 1ace733297..31d69f8957 100644 --- a/src/pocketmine/event/inventory/FurnaceBurnEvent.php +++ b/src/pocketmine/event/inventory/FurnaceBurnEvent.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace pocketmine\event\inventory; +use pocketmine\block\tile\Furnace; use pocketmine\event\block\BlockEvent; use pocketmine\event\Cancellable; use pocketmine\event\CancellableTrait; use pocketmine\item\Item; -use pocketmine\tile\Furnace; class FurnaceBurnEvent extends BlockEvent implements Cancellable{ use CancellableTrait; diff --git a/src/pocketmine/event/inventory/FurnaceSmeltEvent.php b/src/pocketmine/event/inventory/FurnaceSmeltEvent.php index b69f0115ae..5fb1f8be97 100644 --- a/src/pocketmine/event/inventory/FurnaceSmeltEvent.php +++ b/src/pocketmine/event/inventory/FurnaceSmeltEvent.php @@ -23,11 +23,11 @@ declare(strict_types=1); namespace pocketmine\event\inventory; +use pocketmine\block\tile\Furnace; use pocketmine\event\block\BlockEvent; use pocketmine\event\Cancellable; use pocketmine\event\CancellableTrait; use pocketmine\item\Item; -use pocketmine\tile\Furnace; class FurnaceSmeltEvent extends BlockEvent implements Cancellable{ use CancellableTrait; diff --git a/src/pocketmine/inventory/ChestInventory.php b/src/pocketmine/inventory/ChestInventory.php index f9da8aea5a..04e93617d0 100644 --- a/src/pocketmine/inventory/ChestInventory.php +++ b/src/pocketmine/inventory/ChestInventory.php @@ -23,13 +23,13 @@ declare(strict_types=1); namespace pocketmine\inventory; -use pocketmine\world\sound\ChestCloseSound; -use pocketmine\world\sound\ChestOpenSound; -use pocketmine\world\sound\Sound; +use pocketmine\block\tile\Chest; use pocketmine\network\mcpe\protocol\BlockEventPacket; use pocketmine\network\mcpe\protocol\types\WindowTypes; use pocketmine\Player; -use pocketmine\tile\Chest; +use pocketmine\world\sound\ChestCloseSound; +use pocketmine\world\sound\ChestOpenSound; +use pocketmine\world\sound\Sound; use function count; class ChestInventory extends ContainerInventory{ diff --git a/src/pocketmine/inventory/DoubleChestInventory.php b/src/pocketmine/inventory/DoubleChestInventory.php index 2eb0a9f6fc..086fc7f4dc 100644 --- a/src/pocketmine/inventory/DoubleChestInventory.php +++ b/src/pocketmine/inventory/DoubleChestInventory.php @@ -23,9 +23,9 @@ declare(strict_types=1); namespace pocketmine\inventory; +use pocketmine\block\tile\Chest; use pocketmine\item\Item; use pocketmine\Player; -use pocketmine\tile\Chest; use function array_merge; use function array_slice; use function count; diff --git a/src/pocketmine/inventory/EnderChestInventory.php b/src/pocketmine/inventory/EnderChestInventory.php index 6395f4d30c..0dcd970c03 100644 --- a/src/pocketmine/inventory/EnderChestInventory.php +++ b/src/pocketmine/inventory/EnderChestInventory.php @@ -23,8 +23,8 @@ declare(strict_types=1); namespace pocketmine\inventory; +use pocketmine\block\tile\EnderChest; use pocketmine\network\mcpe\protocol\types\WindowTypes; -use pocketmine\tile\EnderChest; use pocketmine\world\Position; use pocketmine\world\sound\EnderChestCloseSound; use pocketmine\world\sound\EnderChestOpenSound; diff --git a/src/pocketmine/inventory/FurnaceInventory.php b/src/pocketmine/inventory/FurnaceInventory.php index 24699a7f0c..81820747bd 100644 --- a/src/pocketmine/inventory/FurnaceInventory.php +++ b/src/pocketmine/inventory/FurnaceInventory.php @@ -23,9 +23,9 @@ declare(strict_types=1); namespace pocketmine\inventory; +use pocketmine\block\tile\Furnace; use pocketmine\item\Item; use pocketmine\network\mcpe\protocol\types\WindowTypes; -use pocketmine\tile\Furnace; class FurnaceInventory extends ContainerInventory{ /** @var Furnace */ diff --git a/src/pocketmine/item/Banner.php b/src/pocketmine/item/Banner.php index f6866880d3..55a80ee61d 100644 --- a/src/pocketmine/item/Banner.php +++ b/src/pocketmine/item/Banner.php @@ -27,11 +27,11 @@ use Ds\Deque; use pocketmine\block\Block; use pocketmine\block\BlockFactory; use pocketmine\block\BlockLegacyIds; +use pocketmine\block\tile\Banner as TileBanner; use pocketmine\block\utils\BannerPattern; use pocketmine\block\utils\DyeColor; use pocketmine\nbt\tag\CompoundTag; use pocketmine\nbt\tag\ListTag; -use pocketmine\tile\Banner as TileBanner; class Banner extends Item{ public const TAG_PATTERNS = TileBanner::TAG_PATTERNS; diff --git a/src/pocketmine/timings/Timings.php b/src/pocketmine/timings/Timings.php index ee218952b3..d5b28a0ffa 100644 --- a/src/pocketmine/timings/Timings.php +++ b/src/pocketmine/timings/Timings.php @@ -23,12 +23,12 @@ declare(strict_types=1); namespace pocketmine\timings; +use pocketmine\block\tile\Tile; use pocketmine\entity\Entity; use pocketmine\network\mcpe\protocol\ClientboundPacket; use pocketmine\network\mcpe\protocol\ServerboundPacket; use pocketmine\Player; use pocketmine\scheduler\TaskHandler; -use pocketmine\tile\Tile; use function dechex; abstract class Timings{ diff --git a/src/pocketmine/world/World.php b/src/pocketmine/world/World.php index 136e266a7c..7f65df8f1f 100644 --- a/src/pocketmine/world/World.php +++ b/src/pocketmine/world/World.php @@ -30,6 +30,8 @@ use pocketmine\block\Air; use pocketmine\block\Block; use pocketmine\block\BlockFactory; use pocketmine\block\BlockLegacyIds; +use pocketmine\block\tile\Spawnable; +use pocketmine\block\tile\Tile; use pocketmine\block\UnknownBlock; use pocketmine\entity\Entity; use pocketmine\entity\EntityFactory; @@ -64,8 +66,6 @@ use pocketmine\network\mcpe\protocol\UpdateBlockPacket; use pocketmine\Player; use pocketmine\plugin\Plugin; use pocketmine\Server; -use pocketmine\tile\Spawnable; -use pocketmine\tile\Tile; use pocketmine\timings\Timings; use pocketmine\utils\ReversePriorityQueue; use pocketmine\world\biome\Biome; diff --git a/src/pocketmine/world/format/Chunk.php b/src/pocketmine/world/format/Chunk.php index 6346634278..18452a42f6 100644 --- a/src/pocketmine/world/format/Chunk.php +++ b/src/pocketmine/world/format/Chunk.php @@ -28,15 +28,15 @@ namespace pocketmine\world\format; use pocketmine\block\BlockFactory; use pocketmine\block\BlockLegacyIds; +use pocketmine\block\tile\Spawnable; +use pocketmine\block\tile\Tile; +use pocketmine\block\tile\TileFactory; use pocketmine\entity\Entity; use pocketmine\entity\EntityFactory; use pocketmine\nbt\tag\CompoundTag; use pocketmine\network\mcpe\NetworkBinaryStream; use pocketmine\network\mcpe\protocol\types\RuntimeBlockMapping; use pocketmine\Player; -use pocketmine\tile\Spawnable; -use pocketmine\tile\Tile; -use pocketmine\tile\TileFactory; use pocketmine\utils\BinaryStream; use pocketmine\world\World; use function array_fill;