diff --git a/src/BlockAPI.php b/src/BlockAPI.php index a4a196d44..a1dbc9cd6 100644 --- a/src/BlockAPI.php +++ b/src/BlockAPI.php @@ -37,196 +37,196 @@ class BlockAPI{ private $randomUpdates = array(); public static $creative = array( //Building - [Item\Item::STONE, 0], - [Item\Item::COBBLESTONE, 0], - [Item\Item::STONE_BRICKS, 0], - [Item\Item::STONE_BRICKS, 1], - [Item\Item::STONE_BRICKS, 2], - [Item\Item::MOSS_STONE, 0], - [Item\Item::WOODEN_PLANKS, 0], - [Item\Item::WOODEN_PLANKS, 1], - [Item\Item::WOODEN_PLANKS, 2], - [Item\Item::WOODEN_PLANKS, 3], - [Item\Item::BRICKS, 0], + [ItemItem::STONE, 0], + [ItemItem::COBBLESTONE, 0], + [ItemItem::STONE_BRICKS, 0], + [ItemItem::STONE_BRICKS, 1], + [ItemItem::STONE_BRICKS, 2], + [ItemItem::MOSS_STONE, 0], + [ItemItem::WOODEN_PLANKS, 0], + [ItemItem::WOODEN_PLANKS, 1], + [ItemItem::WOODEN_PLANKS, 2], + [ItemItem::WOODEN_PLANKS, 3], + [ItemItem::BRICKS, 0], - [Item\Item::DIRT, 0], - [Item\Item::GRASS, 0], - [Item\Item::CLAY_BLOCK, 0], - [Item\Item::SANDSTONE, 0], - [Item\Item::SANDSTONE, 1], - [Item\Item::SANDSTONE, 2], - [Item\Item::SAND, 0], - [Item\Item::GRAVEL, 0], - [Item\Item::TRUNK, 0], - [Item\Item::TRUNK, 1], - [Item\Item::TRUNK, 2], - [Item\Item::TRUNK, 3], - [Item\Item::NETHER_BRICKS, 0], - [Item\Item::NETHERRACK, 0], - [Item\Item::BEDROCK, 0], - [Item\Item::COBBLESTONE_STAIRS, 0], - [Item\Item::OAK_WOODEN_STAIRS, 0], - [Item\Item::SPRUCE_WOODEN_STAIRS, 0], - [Item\Item::BIRCH_WOODEN_STAIRS, 0], - [Item\Item::JUNGLE_WOODEN_STAIRS, 0], - [Item\Item::BRICK_STAIRS, 0], - [Item\Item::SANDSTONE_STAIRS, 0], - [Item\Item::STONE_BRICK_STAIRS, 0], - [Item\Item::NETHER_BRICKS_STAIRS, 0], - [Item\Item::QUARTZ_STAIRS, 0], - [Item\Item::SLAB, 0], - [Item\Item::SLAB, 1], - [Item\Item::WOODEN_SLAB, 0], - [Item\Item::WOODEN_SLAB, 1], - [Item\Item::WOODEN_SLAB, 2], - [Item\Item::WOODEN_SLAB, 3], - [Item\Item::SLAB, 3], - [Item\Item::SLAB, 4], - [Item\Item::SLAB, 5], - [Item\Item::SLAB, 6], - [Item\Item::QUARTZ_BLOCK, 0], - [Item\Item::QUARTZ_BLOCK, 1], - [Item\Item::QUARTZ_BLOCK, 2], - [Item\Item::COAL_ORE, 0], - [Item\Item::IRON_ORE, 0], - [Item\Item::GOLD_ORE, 0], - [Item\Item::DIAMOND_ORE, 0], - [Item\Item::LAPIS_ORE, 0], - [Item\Item::REDSTONE_ORE, 0], - [Item\Item::OBSIDIAN, 0], - [Item\Item::ICE, 0], - [Item\Item::SNOW_BLOCK, 0], + [ItemItem::DIRT, 0], + [ItemItem::GRASS, 0], + [ItemItem::CLAY_BLOCK, 0], + [ItemItem::SANDSTONE, 0], + [ItemItem::SANDSTONE, 1], + [ItemItem::SANDSTONE, 2], + [ItemItem::SAND, 0], + [ItemItem::GRAVEL, 0], + [ItemItem::TRUNK, 0], + [ItemItem::TRUNK, 1], + [ItemItem::TRUNK, 2], + [ItemItem::TRUNK, 3], + [ItemItem::NETHER_BRICKS, 0], + [ItemItem::NETHERRACK, 0], + [ItemItem::BEDROCK, 0], + [ItemItem::COBBLESTONE_STAIRS, 0], + [ItemItem::OAK_WOODEN_STAIRS, 0], + [ItemItem::SPRUCE_WOODEN_STAIRS, 0], + [ItemItem::BIRCH_WOODEN_STAIRS, 0], + [ItemItem::JUNGLE_WOODEN_STAIRS, 0], + [ItemItem::BRICK_STAIRS, 0], + [ItemItem::SANDSTONE_STAIRS, 0], + [ItemItem::STONE_BRICK_STAIRS, 0], + [ItemItem::NETHER_BRICKS_STAIRS, 0], + [ItemItem::QUARTZ_STAIRS, 0], + [ItemItem::SLAB, 0], + [ItemItem::SLAB, 1], + [ItemItem::WOODEN_SLAB, 0], + [ItemItem::WOODEN_SLAB, 1], + [ItemItem::WOODEN_SLAB, 2], + [ItemItem::WOODEN_SLAB, 3], + [ItemItem::SLAB, 3], + [ItemItem::SLAB, 4], + [ItemItem::SLAB, 5], + [ItemItem::SLAB, 6], + [ItemItem::QUARTZ_BLOCK, 0], + [ItemItem::QUARTZ_BLOCK, 1], + [ItemItem::QUARTZ_BLOCK, 2], + [ItemItem::COAL_ORE, 0], + [ItemItem::IRON_ORE, 0], + [ItemItem::GOLD_ORE, 0], + [ItemItem::DIAMOND_ORE, 0], + [ItemItem::LAPIS_ORE, 0], + [ItemItem::REDSTONE_ORE, 0], + [ItemItem::OBSIDIAN, 0], + [ItemItem::ICE, 0], + [ItemItem::SNOW_BLOCK, 0], //Decoration - [Item\Item::COBBLESTONE_WALL, 0], - [Item\Item::COBBLESTONE_WALL, 1], - [Item\Item::GOLD_BLOCK, 0], - [Item\Item::IRON_BLOCK, 0], - [Item\Item::DIAMOND_BLOCK, 0], - [Item\Item::LAPIS_BLOCK, 0], - [Item\Item::COAL_BLOCK, 0], - [Item\Item::SNOW_LAYER, 0], - [Item\Item::GLASS, 0], - [Item\Item::GLOWSTONE_BLOCK, 0], - [Item\Item::NETHER_REACTOR, 0], - [Item\Item::WOOL, 0], - [Item\Item::WOOL, 7], - [Item\Item::WOOL, 6], - [Item\Item::WOOL, 5], - [Item\Item::WOOL, 4], - [Item\Item::WOOL, 3], - [Item\Item::WOOL, 2], - [Item\Item::WOOL, 1], - [Item\Item::WOOL, 15], - [Item\Item::WOOL, 14], - [Item\Item::WOOL, 13], - [Item\Item::WOOL, 12], - [Item\Item::WOOL, 11], - [Item\Item::WOOL, 10], - [Item\Item::WOOL, 9], - [Item\Item::WOOL, 8], - [Item\Item::LADDER, 0], - [Item\Item::SPONGE, 0], - [Item\Item::GLASS_PANE, 0], - [Item\Item::WOODEN_DOOR, 0], - [Item\Item::TRAPDOOR, 0], - [Item\Item::FENCE, 0], - [Item\Item::FENCE_GATE, 0], - [Item\Item::IRON_BARS, 0], - [Item\Item::BED, 0], - [Item\Item::BOOKSHELF, 0], - [Item\Item::PAINTING, 0], - [Item\Item::WORKBENCH, 0], - [Item\Item::STONECUTTER, 0], - [Item\Item::CHEST, 0], - [Item\Item::FURNACE, 0], - [Item\Item::DANDELION, 0], - [Item\Item::CYAN_FLOWER, 0], - [Item\Item::BROWN_MUSHROOM, 0], - [Item\Item::RED_MUSHROOM, 0], - [Item\Item::CACTUS, 0], - [Item\Item::MELON_BLOCK, 0], - [Item\Item::PUMPKIN, 0], - [Item\Item::LIT_PUMPKIN, 0], - [Item\Item::COBWEB, 0], - [Item\Item::HAY_BALE, 0], - [Item\Item::TALL_GRASS, 1], - [Item\Item::TALL_GRASS, 2], - [Item\Item::DEAD_BUSH, 0], - [Item\Item::SAPLING, 0], - [Item\Item::SAPLING, 1], - [Item\Item::SAPLING, 2], - [Item\Item::SAPLING, 3], - [Item\Item::LEAVES, 0], - [Item\Item::LEAVES, 1], - [Item\Item::LEAVES, 2], - [Item\Item::LEAVES, 3], - [Item\Item::CAKE, 0], - [Item\Item::SIGN, 0], - [Item\Item::CARPET, 0], - [Item\Item::CARPET, 7], - [Item\Item::CARPET, 6], - [Item\Item::CARPET, 5], - [Item\Item::CARPET, 4], - [Item\Item::CARPET, 3], - [Item\Item::CARPET, 2], - [Item\Item::CARPET, 1], - [Item\Item::CARPET, 15], - [Item\Item::CARPET, 14], - [Item\Item::CARPET, 13], - [Item\Item::CARPET, 12], - [Item\Item::CARPET, 11], - [Item\Item::CARPET, 10], - [Item\Item::CARPET, 9], - [Item\Item::CARPET, 8], + [ItemItem::COBBLESTONE_WALL, 0], + [ItemItem::COBBLESTONE_WALL, 1], + [ItemItem::GOLD_BLOCK, 0], + [ItemItem::IRON_BLOCK, 0], + [ItemItem::DIAMOND_BLOCK, 0], + [ItemItem::LAPIS_BLOCK, 0], + [ItemItem::COAL_BLOCK, 0], + [ItemItem::SNOW_LAYER, 0], + [ItemItem::GLASS, 0], + [ItemItem::GLOWSTONE_BLOCK, 0], + [ItemItem::NETHER_REACTOR, 0], + [ItemItem::WOOL, 0], + [ItemItem::WOOL, 7], + [ItemItem::WOOL, 6], + [ItemItem::WOOL, 5], + [ItemItem::WOOL, 4], + [ItemItem::WOOL, 3], + [ItemItem::WOOL, 2], + [ItemItem::WOOL, 1], + [ItemItem::WOOL, 15], + [ItemItem::WOOL, 14], + [ItemItem::WOOL, 13], + [ItemItem::WOOL, 12], + [ItemItem::WOOL, 11], + [ItemItem::WOOL, 10], + [ItemItem::WOOL, 9], + [ItemItem::WOOL, 8], + [ItemItem::LADDER, 0], + [ItemItem::SPONGE, 0], + [ItemItem::GLASS_PANE, 0], + [ItemItem::WOODEN_DOOR, 0], + [ItemItem::TRAPDOOR, 0], + [ItemItem::FENCE, 0], + [ItemItem::FENCE_GATE, 0], + [ItemItem::IRON_BARS, 0], + [ItemItem::BED, 0], + [ItemItem::BOOKSHELF, 0], + [ItemItem::PAINTING, 0], + [ItemItem::WORKBENCH, 0], + [ItemItem::STONECUTTER, 0], + [ItemItem::CHEST, 0], + [ItemItem::FURNACE, 0], + [ItemItem::DANDELION, 0], + [ItemItem::CYAN_FLOWER, 0], + [ItemItem::BROWN_MUSHROOM, 0], + [ItemItem::RED_MUSHROOM, 0], + [ItemItem::CACTUS, 0], + [ItemItem::MELON_BLOCK, 0], + [ItemItem::PUMPKIN, 0], + [ItemItem::LIT_PUMPKIN, 0], + [ItemItem::COBWEB, 0], + [ItemItem::HAY_BALE, 0], + [ItemItem::TALL_GRASS, 1], + [ItemItem::TALL_GRASS, 2], + [ItemItem::DEAD_BUSH, 0], + [ItemItem::SAPLING, 0], + [ItemItem::SAPLING, 1], + [ItemItem::SAPLING, 2], + [ItemItem::SAPLING, 3], + [ItemItem::LEAVES, 0], + [ItemItem::LEAVES, 1], + [ItemItem::LEAVES, 2], + [ItemItem::LEAVES, 3], + [ItemItem::CAKE, 0], + [ItemItem::SIGN, 0], + [ItemItem::CARPET, 0], + [ItemItem::CARPET, 7], + [ItemItem::CARPET, 6], + [ItemItem::CARPET, 5], + [ItemItem::CARPET, 4], + [ItemItem::CARPET, 3], + [ItemItem::CARPET, 2], + [ItemItem::CARPET, 1], + [ItemItem::CARPET, 15], + [ItemItem::CARPET, 14], + [ItemItem::CARPET, 13], + [ItemItem::CARPET, 12], + [ItemItem::CARPET, 11], + [ItemItem::CARPET, 10], + [ItemItem::CARPET, 9], + [ItemItem::CARPET, 8], //Tools //array(RAILS, 0), //array(POWERED_RAILS, 0), - [Item\Item::TORCH, 0], - [Item\Item::BUCKET, 0], - [Item\Item::BUCKET, 8], - [Item\Item::BUCKET, 10], - [Item\Item::TNT, 0], - [Item\Item::IRON_HOE, 0], - [Item\Item::IRON_SWORD, 0], - [Item\Item::BOW, 0], - [Item\Item::SHEARS, 0], - [Item\Item::FLINT_AND_STEEL, 0], - [Item\Item::CLOCK, 0], - [Item\Item::COMPASS, 0], - [Item\Item::MINECART, 0], + [ItemItem::TORCH, 0], + [ItemItem::BUCKET, 0], + [ItemItem::BUCKET, 8], + [ItemItem::BUCKET, 10], + [ItemItem::TNT, 0], + [ItemItem::IRON_HOE, 0], + [ItemItem::IRON_SWORD, 0], + [ItemItem::BOW, 0], + [ItemItem::SHEARS, 0], + [ItemItem::FLINT_AND_STEEL, 0], + [ItemItem::CLOCK, 0], + [ItemItem::COMPASS, 0], + [ItemItem::MINECART, 0], array(SPAWN_EGG, MOB_CHICKEN), array(SPAWN_EGG, MOB_COW), array(SPAWN_EGG, MOB_PIG), array(SPAWN_EGG, MOB_SHEEP), //Seeds - [Item\Item::SUGARCANE, 0], - [Item\Item::WHEAT, 0], - [Item\Item::SEEDS, 0], - [Item\Item::MELON_SEEDS, 0], - [Item\Item::PUMPKIN_SEEDS, 0], - [Item\Item::CARROT, 0], - [Item\Item::POTATO, 0], - [Item\Item::BEETROOT_SEEDS, 0], - [Item\Item::EGG, 0], - [Item\Item::DYE, 0], - [Item\Item::DYE, 7], - [Item\Item::DYE, 6], - [Item\Item::DYE, 5], - [Item\Item::DYE, 4], - [Item\Item::DYE, 3], - [Item\Item::DYE, 2], - [Item\Item::DYE, 1], - [Item\Item::DYE, 15], - [Item\Item::DYE, 14], - [Item\Item::DYE, 13], - [Item\Item::DYE, 12], - [Item\Item::DYE, 11], - [Item\Item::DYE, 10], - [Item\Item::DYE, 9], - [Item\Item::DYE, 8], + [ItemItem::SUGARCANE, 0], + [ItemItem::WHEAT, 0], + [ItemItem::SEEDS, 0], + [ItemItem::MELON_SEEDS, 0], + [ItemItem::PUMPKIN_SEEDS, 0], + [ItemItem::CARROT, 0], + [ItemItem::POTATO, 0], + [ItemItem::BEETROOT_SEEDS, 0], + [ItemItem::EGG, 0], + [ItemItem::DYE, 0], + [ItemItem::DYE, 7], + [ItemItem::DYE, 6], + [ItemItem::DYE, 5], + [ItemItem::DYE, 4], + [ItemItem::DYE, 3], + [ItemItem::DYE, 2], + [ItemItem::DYE, 1], + [ItemItem::DYE, 15], + [ItemItem::DYE, 14], + [ItemItem::DYE, 13], + [ItemItem::DYE, 12], + [ItemItem::DYE, 11], + [ItemItem::DYE, 10], + [ItemItem::DYE, 9], + [ItemItem::DYE, 8], ); diff --git a/src/Player.php b/src/Player.php index a1db13665..8f68bcaa6 100644 --- a/src/Player.php +++ b/src/Player.php @@ -1855,25 +1855,25 @@ class Player extends RealHuman{ switch($packet->event){ case 9: //Eating $items = array( - Item\Item::APPLE => 4, - Item\Item::MUSHROOM_STEW => 10, - Item\Item::BEETROOT_SOUP => 10, - Item\Item::BREAD => 5, - Item\Item::RAW_PORKCHOP => 3, - Item\Item::COOKED_PORKCHOP => 8, - Item\Item::RAW_BEEF => 3, - Item\Item::STEAK => 8, - Item\Item::COOKED_CHICKEN => 6, - Item\Item::RAW_CHICKEN => 2, - Item\Item::MELON_SLICE => 2, - Item\Item::GOLDEN_APPLE => 10, - Item\Item::PUMPKIN_PIE => 8, - Item\Item::CARROT => 4, - Item\Item::POTATO => 1, - Item\Item::BAKED_POTATO => 6, - //Item\Item::COOKIE => 2, - //Item\Item::COOKED_FISH => 5, - //Item\Item::RAW_FISH => 2, + ItemItem::APPLE => 4, + ItemItem::MUSHROOM_STEW => 10, + ItemItem::BEETROOT_SOUP => 10, + ItemItem::BREAD => 5, + ItemItem::RAW_PORKCHOP => 3, + ItemItem::COOKED_PORKCHOP => 8, + ItemItem::RAW_BEEF => 3, + ItemItem::STEAK => 8, + ItemItem::COOKED_CHICKEN => 6, + ItemItem::RAW_CHICKEN => 2, + ItemItem::MELON_SLICE => 2, + ItemItem::GOLDEN_APPLE => 10, + ItemItem::PUMPKIN_PIE => 8, + ItemItem::CARROT => 4, + ItemItem::POTATO => 1, + ItemItem::BAKED_POTATO => 6, + //ItemItem::COOKIE => 2, + //ItemItem::COOKED_FISH => 5, + //ItemItem::RAW_FISH => 2, ); $slot = $this->getSlot($this->slot); if($this->entity->getHealth() < 20 and isset($items[$slot->getID()])){ @@ -1888,7 +1888,7 @@ class Player extends RealHuman{ if($slot->getCount() <= 0){ $this->setSlot($this->slot, Item::get(AIR, 0, 0)); } - if($slot->getID() === Item\Item::MUSHROOM_STEW or $slot->getID() === Item\Item::BEETROOT_SOUP){ + if($slot->getID() === ItemItem::MUSHROOM_STEW or $slot->getID() === ItemItem::BEETROOT_SOUP){ $this->addItem(Item::get(BOWL, 0, 1)); } } diff --git a/src/block/Bed.php b/src/block/Bed.php index c8cd7eaf6..285ecd906 100644 --- a/src/block/Bed.php +++ b/src/block/Bed.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Network\Protocol\ChatPacket as ChatPacket; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Bed extends Transparent{ public function __construct($type = 0){ diff --git a/src/block/Beetroot.php b/src/block/Beetroot.php index 0d223f9ca..0292e3d9e 100644 --- a/src/block/Beetroot.php +++ b/src/block/Beetroot.php @@ -43,7 +43,7 @@ class Beetroot extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ @@ -84,10 +84,10 @@ class Beetroot extends Flowable{ public function getDrops(Item $item, Player $player){ $drops = array(); if($this->meta >= 0x07){ - $drops[] = array(Item\Item::BEETROOT, 0, 1); - $drops[] = array(Item\Item::BEETROOT_SEEDS, 0, mt_rand(0, 3)); + $drops[] = array(ItemItem::BEETROOT, 0, 1); + $drops[] = array(ItemItem::BEETROOT_SEEDS, 0, mt_rand(0, 3)); } else{ - $drops[] = array(Item\Item::BEETROOT_SEEDS, 0, 1); + $drops[] = array(ItemItem::BEETROOT_SEEDS, 0, 1); } return $drops; diff --git a/src/block/BurningFurnace.php b/src/block/BurningFurnace.php index 7b3886338..befb0611b 100644 --- a/src/block/BurningFurnace.php +++ b/src/block/BurningFurnace.php @@ -21,7 +21,6 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Enum as Enum; @@ -29,6 +28,7 @@ use PocketMine\NBT\Tag\Int as Int; use PocketMine\NBT\Tag\String as String; use PocketMine\Tile\Furnace as Furnace; use PocketMine\Tile\Tile as Tile; +use PocketMine; class BurningFurnace extends Solid{ public function __construct($meta = 0){ diff --git a/src/block/Cactus.php b/src/block/Cactus.php index c4e40af72..05f08bdf3 100644 --- a/src/block/Cactus.php +++ b/src/block/Cactus.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Math\Vector3 as Vector3; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Cactus extends Transparent{ public function __construct($meta = 0){ diff --git a/src/block/Carrot.php b/src/block/Carrot.php index 698bc771e..ec0b333c4 100644 --- a/src/block/Carrot.php +++ b/src/block/Carrot.php @@ -43,7 +43,7 @@ class Carrot extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ diff --git a/src/block/Chest.php b/src/block/Chest.php index 4b8bf62e1..ac3623ed1 100644 --- a/src/block/Chest.php +++ b/src/block/Chest.php @@ -21,7 +21,6 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Enum as Enum; @@ -29,6 +28,7 @@ use PocketMine\NBT\Tag\Int as Int; use PocketMine\NBT\Tag\String as String; use PocketMine\Tile\Chest as TileChest; use PocketMine\Tile\Tile as Tile; +use PocketMine; class Chest extends Transparent{ public function __construct($meta = 0){ diff --git a/src/block/Clay.php b/src/block/Clay.php index a09d5dc82..b03342e2a 100644 --- a/src/block/Clay.php +++ b/src/block/Clay.php @@ -32,7 +32,7 @@ class Clay extends Solid{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::CLAY, 0, 4), + array(ItemItem::CLAY, 0, 4), ); } } \ No newline at end of file diff --git a/src/block/Door.php b/src/block/Door.php index 724b9e858..877a09188 100644 --- a/src/block/Door.php +++ b/src/block/Door.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Network\Protocol\LevelEventPacket as LevelEventPacket; use PocketMine\Player as Player; +use PocketMine; abstract class Door extends Transparent{ diff --git a/src/block/Fallable.php b/src/block/Fallable.php index 27772b3a6..dc713402d 100644 --- a/src/block/Fallable.php +++ b/src/block/Fallable.php @@ -21,9 +21,9 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Fallable extends Solid{ diff --git a/src/block/Generic.php b/src/block/Generic.php index aad16e9e5..2a7b7488a 100644 --- a/src/block/Generic.php +++ b/src/block/Generic.php @@ -21,9 +21,9 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Generic extends Block{ diff --git a/src/block/GlowingRedstoneOre.php b/src/block/GlowingRedstoneOre.php index bd7c88084..ff95aedd1 100644 --- a/src/block/GlowingRedstoneOre.php +++ b/src/block/GlowingRedstoneOre.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Level\Position as Position; use PocketMine\Utils\Utils as Utils; +use PocketMine; class GlowingRedstoneOre extends Solid{ public function __construct(){ @@ -62,7 +62,7 @@ class GlowingRedstoneOre extends Solid{ public function getDrops(Item $item, Player $player){ if($item->isPickaxe() >= 4){ return array( - array(Item\Item::REDSTONE_DUST, 0, mt_rand(4, 5)), + array(ItemItem::REDSTONE_DUST, 0, mt_rand(4, 5)), ); } else{ return array(); diff --git a/src/block/Glowstone.php b/src/block/Glowstone.php index c96519cea..e1054ba11 100644 --- a/src/block/Glowstone.php +++ b/src/block/Glowstone.php @@ -32,7 +32,7 @@ class Glowstone extends Transparent{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::GLOWSTONE_DUST, 0, mt_rand(2, 4)), + array(ItemItem::GLOWSTONE_DUST, 0, mt_rand(2, 4)), ); } } \ No newline at end of file diff --git a/src/block/Grass.php b/src/block/Grass.php index 4a30bf2f8..b1345ae32 100644 --- a/src/block/Grass.php +++ b/src/block/Grass.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Level\Generator\Object\TallGrass as TallGrass; use PocketMine\Utils\Random as Random; +use PocketMine; class Grass extends Solid{ public function __construct(){ @@ -40,7 +40,7 @@ class Grass extends Solid{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ if(($player->gamemode & 0x01) === 0){ $item->count--; } diff --git a/src/block/Gravel.php b/src/block/Gravel.php index 859f74513..497bc7ebd 100644 --- a/src/block/Gravel.php +++ b/src/block/Gravel.php @@ -33,7 +33,7 @@ class Gravel extends Fallable{ public function getDrops(Item $item, Player $player){ if(mt_rand(1, 10) === 1){ return array( - array(Item\Item::FLINT, 0, 1), + array(ItemItem::FLINT, 0, 1), ); } diff --git a/src/block/IronDoor.php b/src/block/IronDoor.php index d650345b6..b14182141 100644 --- a/src/block/IronDoor.php +++ b/src/block/IronDoor.php @@ -54,7 +54,7 @@ class IronDoor extends Door{ public function getDrops(Item $item, Player $player){ if($item->isPickaxe() >= 1){ return array( - array(Item\Item::IRON_DOOR, 0, 1), + array(ItemItem::IRON_DOOR, 0, 1), ); } else{ return array(); diff --git a/src/block/LapisOre.php b/src/block/LapisOre.php index fa74b69ea..94e0677c6 100644 --- a/src/block/LapisOre.php +++ b/src/block/LapisOre.php @@ -49,7 +49,7 @@ class LapisOre extends Solid{ public function getDrops(Item $item, Player $player){ if($item->isPickaxe() >= 3){ return array( - array(Item\Item::DYE, 4, mt_rand(4, 8)), + array(ItemItem::DYE, 4, mt_rand(4, 8)), ); } else{ return array(); diff --git a/src/block/Lava.php b/src/block/Lava.php index 4f48ab7e5..ea8b07c2a 100644 --- a/src/block/Lava.php +++ b/src/block/Lava.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Level\Position as Position; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Lava extends Liquid{ public function __construct($meta = 0){ diff --git a/src/block/Leaves.php b/src/block/Leaves.php index 80a1e2d73..64c6afaa2 100644 --- a/src/block/Leaves.php +++ b/src/block/Leaves.php @@ -21,9 +21,9 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Leaves extends Transparent{ const OAK = 0; @@ -151,7 +151,7 @@ class Leaves extends Transparent{ $drops[] = array(LEAVES, $this->meta & 0x03, 1); } else{ if(mt_rand(1, 20) === 1){ //Saplings - $drops[] = array(Item\Item::SAPLING, $this->meta & 0x03, 1); + $drops[] = array(ItemItem::SAPLING, $this->meta & 0x03, 1); } if(($this->meta & 0x03) === self::OAK and mt_rand(1, 200) === 1){ //Apples $drops[] = array(APPLE, 0, 1); diff --git a/src/block/Melon.php b/src/block/Melon.php index 841690913..824753075 100644 --- a/src/block/Melon.php +++ b/src/block/Melon.php @@ -32,7 +32,7 @@ class Melon extends Transparent{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::MELON_SLICE, 0, mt_rand(3, 7)), + array(ItemItem::MELON_SLICE, 0, mt_rand(3, 7)), ); } } \ No newline at end of file diff --git a/src/block/MelonStem.php b/src/block/MelonStem.php index 0f1fdc6f0..6d902b05a 100644 --- a/src/block/MelonStem.php +++ b/src/block/MelonStem.php @@ -80,7 +80,7 @@ class MelonStem extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ @@ -95,7 +95,7 @@ class MelonStem extends Flowable{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::MELON_SEEDS, 0, mt_rand(0, 2)), + array(ItemItem::MELON_SEEDS, 0, mt_rand(0, 2)), ); } } \ No newline at end of file diff --git a/src/block/Potato.php b/src/block/Potato.php index 9897e306c..e0c6939fe 100644 --- a/src/block/Potato.php +++ b/src/block/Potato.php @@ -43,7 +43,7 @@ class Potato extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ diff --git a/src/block/PumpkinStem.php b/src/block/PumpkinStem.php index 18f449e37..cd869cf1d 100644 --- a/src/block/PumpkinStem.php +++ b/src/block/PumpkinStem.php @@ -80,7 +80,7 @@ class PumpkinStem extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ @@ -95,7 +95,7 @@ class PumpkinStem extends Flowable{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::PUMPKIN_SEEDS, 0, mt_rand(0, 2)), + array(ItemItem::PUMPKIN_SEEDS, 0, mt_rand(0, 2)), ); } } \ No newline at end of file diff --git a/src/block/Sapling.php b/src/block/Sapling.php index e0b8fc209..264ae70f8 100644 --- a/src/block/Sapling.php +++ b/src/block/Sapling.php @@ -21,10 +21,10 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Level\Generator\Object\Tree as Tree; use PocketMine\Utils\Random as Random; +use PocketMine; class Sapling extends Flowable{ const OAK = 0; @@ -58,7 +58,7 @@ class Sapling extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal Tree::growTree($this->level, $this, new Random(), $this->meta & 0x03); if(($player->gamemode & 0x01) === 0){ $item->count--; diff --git a/src/block/SignPost.php b/src/block/SignPost.php index 0d2cdbd62..515df35fd 100644 --- a/src/block/SignPost.php +++ b/src/block/SignPost.php @@ -78,7 +78,7 @@ class SignPost extends Transparent{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::SIGN, 0, 1), + array(ItemItem::SIGN, 0, 1), ); } } \ No newline at end of file diff --git a/src/block/SnowLayer.php b/src/block/SnowLayer.php index f99294dcc..12e9a04d2 100644 --- a/src/block/SnowLayer.php +++ b/src/block/SnowLayer.php @@ -59,7 +59,7 @@ class SnowLayer extends Flowable{ public function getDrops(Item $item, Player $player){ if($item->isShovel() !== false){ return array( - array(Item\Item::SNOWBALL, 0, 1), + array(ItemItem::SNOWBALL, 0, 1), ); } diff --git a/src/block/Sugarcane.php b/src/block/Sugarcane.php index 38ba5f3bf..5ababb3a5 100644 --- a/src/block/Sugarcane.php +++ b/src/block/Sugarcane.php @@ -21,9 +21,9 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Math\Vector3 as Vector3; +use PocketMine; class Sugarcane extends Flowable{ public function __construct($meta = 0){ diff --git a/src/block/TNT.php b/src/block/TNT.php index 7a0f46f9e..b9cf29581 100644 --- a/src/block/TNT.php +++ b/src/block/TNT.php @@ -32,7 +32,7 @@ class TNT extends Solid{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::FLINT_STEEL){ + if($item->getID() === ItemItem::FLINT_STEEL){ if(($player->gamemode & 0x01) === 0){ $item->useOn($this); } diff --git a/src/block/Water.php b/src/block/Water.php index 670965ec5..340f6b751 100644 --- a/src/block/Water.php +++ b/src/block/Water.php @@ -21,9 +21,9 @@ namespace PocketMine\Block; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Water extends Liquid{ public function __construct($meta = 0){ diff --git a/src/block/Wheat.php b/src/block/Wheat.php index c5c8231b4..42e8b6a1f 100644 --- a/src/block/Wheat.php +++ b/src/block/Wheat.php @@ -43,7 +43,7 @@ class Wheat extends Flowable{ } public function onActivate(Item $item, Player $player){ - if($item->getID() === Item\Item::DYE and $item->getMetadata() === 0x0F){ //Bonemeal + if($item->getID() === ItemItem::DYE and $item->getMetadata() === 0x0F){ //Bonemeal $this->meta = 0x07; $this->level->setBlock($this, $this, true, false, true); if(($player->gamemode & 0x01) === 0){ @@ -80,10 +80,10 @@ class Wheat extends Flowable{ public function getDrops(Item $item, Player $player){ $drops = array(); if($this->meta >= 0x07){ - $drops[] = array(Item\Item::WHEAT, 0, 1); - $drops[] = array(Item\Item::WHEAT_SEEDS, 0, mt_rand(0, 3)); + $drops[] = array(ItemItem::WHEAT, 0, 1); + $drops[] = array(ItemItem::WHEAT_SEEDS, 0, mt_rand(0, 3)); } else{ - $drops[] = array(Item\Item::WHEAT_SEEDS, 0, 1); + $drops[] = array(ItemItem::WHEAT_SEEDS, 0, 1); } return $drops; diff --git a/src/block/WoodDoor.php b/src/block/WoodDoor.php index 29d188e5f..cfe864b42 100644 --- a/src/block/WoodDoor.php +++ b/src/block/WoodDoor.php @@ -33,7 +33,7 @@ class WoodDoor extends Door{ public function getDrops(Item $item, Player $player){ return array( - array(Item\Item::WOODEN_DOOR, 0, 1), + array(ItemItem::WOODEN_DOOR, 0, 1), ); } } \ No newline at end of file diff --git a/src/entity/Entity.php b/src/entity/Entity.php index 6bdc06767..dc4971d9f 100644 --- a/src/entity/Entity.php +++ b/src/entity/Entity.php @@ -24,7 +24,6 @@ */ namespace PocketMine\Entity; -use PocketMine; use PocketMine\Event\Entity\EntityLevelChangeEvent as EntityLevelChangeEvent; use PocketMine\Event\Entity\EntityMotionEvent as EntityMotionEvent; use PocketMine\Event\Entity\EntityMoveEvent as EntityMoveEvent; @@ -41,6 +40,7 @@ use PocketMine\Network\Protocol\RemoveEntityPacket as RemoveEntityPacket; use PocketMine\Network\Protocol\SetEntityMotionPacket as SetEntityMotionPacket; use PocketMine\Player as Player; use PocketMine\PMF\LevelFormat as LevelFormat; +use PocketMine; abstract class Entity extends Position{ public static $entityCount = 1; diff --git a/src/entity/Human.php b/src/entity/Human.php index e6d9798b9..62348a33d 100644 --- a/src/entity/Human.php +++ b/src/entity/Human.php @@ -21,7 +21,6 @@ namespace PocketMine\Entity; -use PocketMine; use PocketMine\Event\Entity\EntityArmorChangeEvent as EntityArmorChangeEvent; use PocketMine\Event\Entity\EntityInventoryChangeEvent as EntityInventoryChangeEvent; use PocketMine\Event\Event as Event; @@ -35,6 +34,7 @@ use PocketMine\Network\Protocol\ContainerSetContentPacket as ContainerSetContent use PocketMine\Network\Protocol\PlayerEquipmentPacket as PlayerEquipmentPacket; use PocketMine\Network\Protocol\RemovePlayerPacket as RemovePlayerPacket; use PocketMine\Network\Protocol\SetEntityMotionPacket as SetEntityMotionPacket; +use PocketMine; class Human extends Creature implements ProjectileSource, InventorySource{ diff --git a/src/event/entity/EntityArmorChangeEvent.php b/src/event/entity/EntityArmorChangeEvent.php index 7ea03b501..e018dd464 100644 --- a/src/event/entity/EntityArmorChangeEvent.php +++ b/src/event/entity/EntityArmorChangeEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Entity; use PocketMine\Entity\Entity as Entity; -use PocketMine; use PocketMine\Event; +use PocketMine; use PocketMine\Item\Item as Item; class EntityArmorChangeEvent extends EntityEvent implements CancellableEvent{ diff --git a/src/event/entity/EntityInventoryChangeEvent.php b/src/event/entity/EntityInventoryChangeEvent.php index ee1fd088e..91066839d 100644 --- a/src/event/entity/EntityInventoryChangeEvent.php +++ b/src/event/entity/EntityInventoryChangeEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Entity; use PocketMine\Entity\Entity as Entity; -use PocketMine; use PocketMine\Event; +use PocketMine; use PocketMine\Item\Item as Item; class EntityInventoryChangeEvent extends EntityEvent implements CancellableEvent{ diff --git a/src/event/entity/EntityLevelChangeEvent.php b/src/event/entity/EntityLevelChangeEvent.php index 29e698203..99a7b916a 100644 --- a/src/event/entity/EntityLevelChangeEvent.php +++ b/src/event/entity/EntityLevelChangeEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Entity; use PocketMine\Entity\Entity as Entity; -use PocketMine; use PocketMine\Event; +use PocketMine; use PocketMine\Level\Level as Level; class EntityLevelChangeEvent extends EntityEvent implements CancellableEvent{ diff --git a/src/event/entity/EntityMotionEvent.php b/src/event/entity/EntityMotionEvent.php index 505fb6122..4f53c8015 100644 --- a/src/event/entity/EntityMotionEvent.php +++ b/src/event/entity/EntityMotionEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Entity; use PocketMine\Entity\Entity as Entity; -use PocketMine; use PocketMine\Event; +use PocketMine; use PocketMine\Math\Vector3 as Vector3; class EntityMotionEvent extends EntityEvent implements CancellableEvent{ diff --git a/src/event/entity/EntityMoveEvent.php b/src/event/entity/EntityMoveEvent.php index 7a0bc24bd..4cddb703b 100644 --- a/src/event/entity/EntityMoveEvent.php +++ b/src/event/entity/EntityMoveEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Entity; use PocketMine\Entity\Entity as Entity; -use PocketMine; use PocketMine\Event; +use PocketMine; use PocketMine\Math\Vector3 as Vector3; class EntityMoveEvent extends EntityEvent implements CancellableEvent{ diff --git a/src/event/tile/TileInventoryChangeEvent.php b/src/event/tile/TileInventoryChangeEvent.php index 5c7b5909e..f990d861e 100644 --- a/src/event/tile/TileInventoryChangeEvent.php +++ b/src/event/tile/TileInventoryChangeEvent.php @@ -22,8 +22,8 @@ namespace PocketMine\Event\Tile; use PocketMine\Event; -use PocketMine; use PocketMine\Item\Item as Item; +use PocketMine; use PocketMine\Tile\Tile as Tile; class TileInventoryChangeEvent extends TileEvent implements CancellableEvent{ diff --git a/src/item/Bucket.php b/src/item/Bucket.php index 1a3d328f7..43b845dea 100644 --- a/src/item/Bucket.php +++ b/src/item/Bucket.php @@ -21,13 +21,13 @@ namespace PocketMine\Item; -use PocketMine; use PocketMine\Block\Air as Air; use PocketMine\Block\Block as Block; use PocketMine\Block\Lava as Lava; use PocketMine\Block\Liquid as Liquid; use PocketMine\Block\Water as Water; use PocketMine\Level\Level as Level; +use PocketMine; class Bucket extends Item{ public function __construct($meta = 0, $count = 1){ diff --git a/src/item/FlintSteel.php b/src/item/FlintSteel.php index 8af04869f..a1d3077c9 100644 --- a/src/item/FlintSteel.php +++ b/src/item/FlintSteel.php @@ -21,11 +21,11 @@ namespace PocketMine\Item; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Block\Fire as Fire; use PocketMine\Block\Solid as Solid; use PocketMine\Level\Level as Level; +use PocketMine; class FlintSteel extends Item{ public function __construct($meta = 0, $count = 1){ diff --git a/src/item/Item.php b/src/item/Item.php index ed77d9ef0..5d12760fd 100644 --- a/src/item/Item.php +++ b/src/item/Item.php @@ -23,13 +23,13 @@ * All the Item classes */ namespace PocketMine\Item; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Entity\Entity as Entity; use PocketMine\Item\Block as ItemBlock; use PocketMine\Level\Level as Level; use PocketMine\Recipes\Fuel as Fuel; use PocketMine\Recipes\Smelt as Smelt; +use PocketMine; class Item{ //All Block IDs are here too diff --git a/src/item/Painting.php b/src/item/Painting.php index 72399d300..32fc4ed8c 100644 --- a/src/item/Painting.php +++ b/src/item/Painting.php @@ -21,10 +21,10 @@ namespace PocketMine\Item; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Level\Level as Level; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Painting extends Item{ public function __construct($meta = 0, $count = 1){ diff --git a/src/item/SpawnEgg.php b/src/item/SpawnEgg.php index 0827a99fc..3b378b1b6 100644 --- a/src/item/SpawnEgg.php +++ b/src/item/SpawnEgg.php @@ -21,9 +21,9 @@ namespace PocketMine\Item; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Level\Level as Level; +use PocketMine; class SpawnEgg extends Item{ public function __construct($meta = 0, $count = 1){ diff --git a/src/level/Explosion.php b/src/level/Explosion.php index 93a1f5bdf..29b9e1c7e 100644 --- a/src/level/Explosion.php +++ b/src/level/Explosion.php @@ -21,13 +21,13 @@ namespace PocketMine\Level; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Block\TNT as TNT; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Network\Protocol\ExplodePacket as ExplodePacket; use PocketMine\Player as Player; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Explosion{ public static $specialDrops = array( diff --git a/src/level/Level.php b/src/level/Level.php index c60de58d3..c49cf21f2 100644 --- a/src/level/Level.php +++ b/src/level/Level.php @@ -24,7 +24,6 @@ */ namespace PocketMine\Level; -use PocketMine; use PocketMine\Block\Air as Air; use PocketMine\Block\Block as Block; use PocketMine\Level\Generator\Generator as Generator; @@ -42,6 +41,7 @@ use PocketMine\Tile\Sign as Sign; use PocketMine\Tile\Tile as Tile; use PocketMine\Utils\Cache as Cache; use PocketMine\Utils\Random as Random; +use PocketMine; class Level{ public $players = array(); diff --git a/src/level/LevelImport.php b/src/level/LevelImport.php index d539937b3..b074cfc58 100644 --- a/src/level/LevelImport.php +++ b/src/level/LevelImport.php @@ -21,9 +21,9 @@ namespace PocketMine\Level; -use PocketMine; use PocketMine\PMF\LevelFormat as LevelFormat; use PocketMine\Utils\Config as Config; +use PocketMine; class LevelImport{ private $path; diff --git a/src/level/WorldGenerator.php b/src/level/WorldGenerator.php index c1ec46f5d..41c35f86d 100644 --- a/src/level/WorldGenerator.php +++ b/src/level/WorldGenerator.php @@ -21,12 +21,12 @@ namespace PocketMine\Level; -use PocketMine; use PocketMine\Level\Generator\Generator as Generator; use PocketMine\PMF\LevelFormat as LevelFormat; use PocketMine\Utils\Config as Config; use PocketMine\Utils\Random as Random; use PocketMine\Utils\Utils as Utils; +use PocketMine; class WorldGenerator{ private $seed, $level, $path, $random, $generator, $height; diff --git a/src/level/generator/Flat.php b/src/level/generator/Flat.php index bf0335a44..bf6a50040 100644 --- a/src/level/generator/Flat.php +++ b/src/level/generator/Flat.php @@ -21,7 +21,6 @@ namespace PocketMine\Level\Generator; -use PocketMine; use PocketMine\Block\CoalOre as CoalOre; use PocketMine\Block\DiamondOre as DiamondOre; use PocketMine\Block\Dirt as Dirt; @@ -35,6 +34,7 @@ use PocketMine\Level\Generator\Populator\Ore as Ore; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Flat extends Generator{ private $level, $random, $structure, $chunks, $options, $floorLevel, $preset, $populators = array(); diff --git a/src/level/generator/Generator.php b/src/level/generator/Generator.php index dd97c8101..f83dbbc4d 100644 --- a/src/level/generator/Generator.php +++ b/src/level/generator/Generator.php @@ -24,9 +24,9 @@ */ namespace PocketMine\Level\Generator; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Utils\Random as Random; +use PocketMine; abstract class Generator{ private static $list = array(); diff --git a/src/level/generator/Normal.php b/src/level/generator/Normal.php index ff2d45acf..c2b20c82a 100644 --- a/src/level/generator/Normal.php +++ b/src/level/generator/Normal.php @@ -21,7 +21,6 @@ namespace PocketMine\Level\Generator; -use PocketMine; use PocketMine\Block\CoalOre as CoalOre; use PocketMine\Block\DiamondOre as DiamondOre; use PocketMine\Block\Dirt as Dirt; @@ -38,6 +37,7 @@ use PocketMine\Level\Generator\Populator\Tree as Tree; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Normal extends Generator{ diff --git a/src/level/generator/object/BigTree.php b/src/level/generator/object/BigTree.php index dcb74660c..2d82f26cc 100644 --- a/src/level/generator/object/BigTree.php +++ b/src/level/generator/object/BigTree.php @@ -21,9 +21,9 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; +use PocketMine; class BigTree extends Tree{ private $trunkHeightMultiplier = 0.618; diff --git a/src/level/generator/object/Ore.php b/src/level/generator/object/Ore.php index 9dcef1861..1dbb4929b 100644 --- a/src/level/generator/object/Ore.php +++ b/src/level/generator/object/Ore.php @@ -21,11 +21,11 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Math\VectorMath as VectorMath; use PocketMine\Utils\Random as Random; +use PocketMine; class Ore{ private $random; diff --git a/src/level/generator/object/PineTree.php b/src/level/generator/object/PineTree.php index 5f45ce725..b550cb44a 100644 --- a/src/level/generator/object/PineTree.php +++ b/src/level/generator/object/PineTree.php @@ -21,13 +21,13 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Block\Dirt as Dirt; use PocketMine\Block\Leaves as Leaves; use PocketMine\Block\Wood as Wood; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class PineTree extends Tree{ var $type = 1; diff --git a/src/level/generator/object/Pond.php b/src/level/generator/object/Pond.php index 6430534f2..1b4e0d3e6 100644 --- a/src/level/generator/object/Pond.php +++ b/src/level/generator/object/Pond.php @@ -21,11 +21,11 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Pond{ private $random; diff --git a/src/level/generator/object/SmallTree.php b/src/level/generator/object/SmallTree.php index 226dca255..69c0a9ac0 100644 --- a/src/level/generator/object/SmallTree.php +++ b/src/level/generator/object/SmallTree.php @@ -21,13 +21,13 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Block\Dirt as Dirt; use PocketMine\Block\Leaves as Leaves; use PocketMine\Block\Wood as Wood; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class SmallTree extends Tree{ public $type = 0; diff --git a/src/level/generator/object/SpruceTree.php b/src/level/generator/object/SpruceTree.php index 709f392bc..7b2dca1bf 100644 --- a/src/level/generator/object/SpruceTree.php +++ b/src/level/generator/object/SpruceTree.php @@ -21,13 +21,13 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Block\Dirt as Dirt; use PocketMine\Block\Leaves as Leaves; use PocketMine\Block\Wood as Wood; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class SpruceTree extends Tree{ var $type = 1; diff --git a/src/level/generator/object/TallGrass.php b/src/level/generator/object/TallGrass.php index 1bea98a41..a36111443 100644 --- a/src/level/generator/object/TallGrass.php +++ b/src/level/generator/object/TallGrass.php @@ -22,8 +22,8 @@ namespace PocketMine\Level\Generator\Object; use PocketMine\Block\Block as Block; -use PocketMine; use PocketMine\Level; +use PocketMine; use PocketMine\Math\Vector3 as Vector3; class TallGrass{ diff --git a/src/level/generator/object/Tree.php b/src/level/generator/object/Tree.php index a6aacf686..546f63999 100644 --- a/src/level/generator/object/Tree.php +++ b/src/level/generator/object/Tree.php @@ -21,10 +21,10 @@ namespace PocketMine\Level\Generator\Object; -use PocketMine; use PocketMine\Block\Sapling as Sapling; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; +use PocketMine; class Tree{ public $overridable = array( diff --git a/src/level/generator/populator/Mineshaft.php b/src/level/generator/populator/Mineshaft.php index 60ba58299..51e4c88b0 100644 --- a/src/level/generator/populator/Mineshaft.php +++ b/src/level/generator/populator/Mineshaft.php @@ -21,9 +21,9 @@ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Utils\Random as Random; +use PocketMine; class Mineshaft extends Populator{ private static $DISTANCE = 256; diff --git a/src/level/generator/populator/Ore.php b/src/level/generator/populator/Ore.php index 124a69e82..38e659c8e 100644 --- a/src/level/generator/populator/Ore.php +++ b/src/level/generator/populator/Ore.php @@ -21,11 +21,11 @@ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Level\Generator\Object\Ore as ObjectOre; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Ore extends Populator{ private $oreTypes = array(); diff --git a/src/level/generator/populator/Pond.php b/src/level/generator/populator/Pond.php index 2a42c476e..486d517f3 100644 --- a/src/level/generator/populator/Pond.php +++ b/src/level/generator/populator/Pond.php @@ -21,11 +21,11 @@ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Block\Water as Water; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Pond extends Populator{ private $waterOdd = 4; diff --git a/src/level/generator/populator/Populator.php b/src/level/generator/populator/Populator.php index 2ffcd25fc..aff26b397 100644 --- a/src/level/generator/populator/Populator.php +++ b/src/level/generator/populator/Populator.php @@ -24,9 +24,9 @@ */ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Utils\Random as Random; +use PocketMine; abstract class Populator{ public abstract function populate(Level $level, $chunkX, $chunkZ, Random $random); diff --git a/src/level/generator/populator/TallGrass.php b/src/level/generator/populator/TallGrass.php index 06cebd245..181f87c6a 100644 --- a/src/level/generator/populator/TallGrass.php +++ b/src/level/generator/populator/TallGrass.php @@ -21,9 +21,9 @@ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Block\TallGrass as BlockTallGrass; use PocketMine\Math\Vector3 as Vector3; +use PocketMine; class TallGrass extends Populator{ private $level; diff --git a/src/level/generator/populator/Tree.php b/src/level/generator/populator/Tree.php index f0a06d17c..c7c3f34e5 100644 --- a/src/level/generator/populator/Tree.php +++ b/src/level/generator/populator/Tree.php @@ -21,10 +21,10 @@ namespace PocketMine\Level\Generator\Populator; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\Utils\Random as Random; +use PocketMine; class Tree extends Populator{ private $level; diff --git a/src/nbt/NBT.php b/src/nbt/NBT.php index 868f7efd6..6b0cffc42 100644 --- a/src/nbt/NBT.php +++ b/src/nbt/NBT.php @@ -37,7 +37,6 @@ const TAG_String = 8; const TAG_Enum = 9; const TAG_Compound = 10; const TAG_Int_Array = 11; -use PocketMine; use PocketMine\NBT\Tag\Byte as Byte; use PocketMine\NBT\Tag\Byte_Array as Byte_Array; use PocketMine\NBT\Tag\Compound as Compound; @@ -53,6 +52,7 @@ use PocketMine\NBT\Tag\Short as Short; use PocketMine\NBT\Tag\String as String; use PocketMine\NBT\Tag\Tag as Tag; use PocketMine\Utils\Utils as Utils; +use PocketMine; class NBT implements \ArrayAccess{ private $buffer; diff --git a/src/nbt/tag/Enum.php b/src/nbt/tag/Enum.php index dc94b0559..8a5225564 100644 --- a/src/nbt/tag/Enum.php +++ b/src/nbt/tag/Enum.php @@ -21,9 +21,9 @@ namespace PocketMine\NBT\Tag; -use PocketMine\NBT; -use PocketMine; use PocketMine\NBT\Tag\Enum as TagEnum; +use PocketMine; +use PocketMine\NBT; class Enum extends NamedTag implements \ArrayAccess, \Iterator{ diff --git a/src/network/Handler.php b/src/network/Handler.php index 3230d6f96..0fd03ac2d 100644 --- a/src/network/Handler.php +++ b/src/network/Handler.php @@ -24,7 +24,6 @@ */ namespace PocketMine\Network; -use PocketMine; use PocketMine\Event\Event as Event; use PocketMine\Event\EventHandler as EventHandler; use PocketMine\Event\Server\PacketReceiveEvent as PacketReceiveEvent; @@ -34,6 +33,7 @@ use PocketMine\Network\Query\QueryPacket as QueryPacket; use PocketMine\Network\RakNet\Info as Info; use PocketMine\Network\RakNet\Packet as Packet; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; class Handler{ public $bandwidth; diff --git a/src/network/protocol/DataPacket.php b/src/network/protocol/DataPacket.php index 9d4bb21fb..5f0904fad 100644 --- a/src/network/protocol/DataPacket.php +++ b/src/network/protocol/DataPacket.php @@ -21,9 +21,9 @@ namespace PocketMine\Network\Protocol; -use PocketMine; use PocketMine\Item\Item as Item; use PocketMine\Utils\Utils as Utils; +use PocketMine; abstract class DataPacket{ private $offset = 0; diff --git a/src/network/query/QueryHandler.php b/src/network/query/QueryHandler.php index 6a742d4b1..f523200b0 100644 --- a/src/network/query/QueryHandler.php +++ b/src/network/query/QueryHandler.php @@ -25,10 +25,10 @@ */ namespace PocketMine\Network\Query; -use PocketMine; use PocketMine\Player as Player; use PocketMine\ServerAPI as ServerAPI; use PocketMine\Utils\Utils as Utils; +use PocketMine; class QueryHandler{ private $socket, $server, $lastToken, $token, $longData, $timeout; diff --git a/src/network/query/QueryPacket.php b/src/network/query/QueryPacket.php index cc414f7d7..f15f7b52a 100644 --- a/src/network/query/QueryPacket.php +++ b/src/network/query/QueryPacket.php @@ -21,9 +21,9 @@ namespace PocketMine\Network\Query; -use PocketMine; use PocketMine\Network\Packet as Packet; use PocketMine\Utils\Utils as Utils; +use PocketMine; class QueryPacket extends Packet{ const HANDSHAKE = 9; diff --git a/src/network/raknet/Packet.php b/src/network/raknet/Packet.php index 60308e1c1..0e980f0c9 100644 --- a/src/network/raknet/Packet.php +++ b/src/network/raknet/Packet.php @@ -21,10 +21,10 @@ namespace PocketMine\Network\RakNet; -use PocketMine; use PocketMine\Network\Packet as NetworkPacket; use PocketMine\Network\Protocol\Info as ProtocolInfo; use PocketMine\Utils\Utils as Utils; +use PocketMine; class Packet extends NetworkPacket{ private $packetID; diff --git a/src/pmf/LevelFormat.php b/src/pmf/LevelFormat.php index a16dae51c..2b51e61e9 100644 --- a/src/pmf/LevelFormat.php +++ b/src/pmf/LevelFormat.php @@ -21,11 +21,11 @@ namespace PocketMine\PMF; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Enum as Enum; use PocketMine\Utils\Utils as Utils; +use PocketMine; class LevelFormat extends PMF{ const VERSION = 2; diff --git a/src/recipes/Crafting.php b/src/recipes/Crafting.php index 3d80d64ea..48bb99c4a 100644 --- a/src/recipes/Crafting.php +++ b/src/recipes/Crafting.php @@ -24,9 +24,9 @@ */ namespace PocketMine\Recipes; -use PocketMine; use PocketMine\BlockAPI as BlockAPI; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; abstract class Crafting{ private static $small = array( //Probably means craftable on crafting bench and in inventory. Name it better! diff --git a/src/recipes/Fuel.php b/src/recipes/Fuel.php index 22662fa95..3afe8c2a6 100644 --- a/src/recipes/Fuel.php +++ b/src/recipes/Fuel.php @@ -22,31 +22,32 @@ namespace PocketMine\Recipes; use PocketMine; +use PocketMine\Item\Item as Item; abstract class Fuel{ public static $duration = array( - Item\Item::COAL => 80, - Item\Item::COAL_BLOCK => 800, - Item\Item::TRUNK => 15, - Item\Item::WOODEN_PLANKS => 15, - Item\Item::SAPLING => 5, - Item\Item::WOODEN_AXE => 10, - Item\Item::WOODEN_PICKAXE => 10, - Item\Item::WOODEN_SWORD => 10, - Item\Item::WOODEN_SHOVEL => 10, - Item\Item::WOODEN_HOE => 10, - Item\Item::STICK => 5, - Item\Item::FENCE => 15, - Item\Item::FENCE_GATE => 15, - Item\Item::WOODEN_STAIRS => 15, - Item\Item::SPRUCE_WOOD_STAIRS => 15, - Item\Item::BIRCH_WOOD_STAIRS => 15, - Item\Item::JUNGLE_WOOD_STAIRS => 15, - Item\Item::TRAPDOOR => 15, - Item\Item::WORKBENCH => 15, - Item\Item::BOOKSHELF => 15, - Item\Item::CHEST => 15, - Item\Item::BUCKET => 1000, + Item::COAL => 80, + Item::COAL_BLOCK => 800, + Item::TRUNK => 15, + Item::WOODEN_PLANKS => 15, + Item::SAPLING => 5, + Item::WOODEN_AXE => 10, + Item::WOODEN_PICKAXE => 10, + Item::WOODEN_SWORD => 10, + Item::WOODEN_SHOVEL => 10, + Item::WOODEN_HOE => 10, + Item::STICK => 5, + Item::FENCE => 15, + Item::FENCE_GATE => 15, + Item::WOODEN_STAIRS => 15, + Item::SPRUCE_WOOD_STAIRS => 15, + Item::BIRCH_WOOD_STAIRS => 15, + Item::JUNGLE_WOOD_STAIRS => 15, + Item::TRAPDOOR => 15, + Item::WORKBENCH => 15, + Item::BOOKSHELF => 15, + Item::CHEST => 15, + Item::BUCKET => 1000, ); diff --git a/src/recipes/Smelt.php b/src/recipes/Smelt.php index cd860e737..212a9b290 100644 --- a/src/recipes/Smelt.php +++ b/src/recipes/Smelt.php @@ -21,23 +21,24 @@ namespace PocketMine\Recipes; use PocketMine; +use PocketMine\Item\Item as Item; class Smelt{ public static $product = array( - Item\Item::COBBLESTONE => array(Item\Item::STONE, 0), - Item\Item::SAND => array(Item\Item::GLASS, 0), - Item\Item::TRUNK => array(Item\Item::COAL, 1), //Charcoal - Item\Item::GOLD_ORE => array(Item\Item::GOLD_INGOT, 0), - Item\Item::IRON_ORE => array(Item\Item::IRON_INGOT, 0), - Item\Item::NETHERRACK => array(Item\Item::NETHER_BRICK, 0), - Item\Item::RAW_PORKCHOP => array(Item\Item::COOKED_PORKCHOP, 0), - Item\Item::CLAY => array(Item\Item::BRICK, 0), - //Item\Item::RAW_FISH => array(Item\Item::COOKED_FISH, 0), - Item\Item::CACTUS => array(Item\Item::DYE, 2), - Item\Item::RED_MUSHROOM => array(Item\Item::DYE, 1), - Item\Item::RAW_BEEF => array(Item\Item::STEAK, 0), - Item\Item::RAW_CHICKEN => array(Item\Item::COOKED_CHICKEN, 0), - Item\Item::RED_MUSHROOM => array(Item\Item::DYE, 1), - Item\Item::POTATO => array(Item\Item::BAKED_POTATO, 0), + Item::COBBLESTONE => array(Item::STONE, 0), + Item::SAND => array(Item::GLASS, 0), + Item::TRUNK => array(Item::COAL, 1), //Charcoal + Item::GOLD_ORE => array(Item::GOLD_INGOT, 0), + Item::IRON_ORE => array(Item::IRON_INGOT, 0), + Item::NETHERRACK => array(Item::NETHER_BRICK, 0), + Item::RAW_PORKCHOP => array(Item::COOKED_PORKCHOP, 0), + Item::CLAY => array(Item::BRICK, 0), + //Item::RAW_FISH => array(Item::COOKED_FISH, 0), + Item::CACTUS => array(Item::DYE, 2), + Item::RED_MUSHROOM => array(Item::DYE, 1), + Item::RAW_BEEF => array(Item::STEAK, 0), + Item::RAW_CHICKEN => array(Item::COOKED_CHICKEN, 0), + Item::RED_MUSHROOM => array(Item::DYE, 1), + Item::POTATO => array(Item::BAKED_POTATO, 0), ); } \ No newline at end of file diff --git a/src/tile/Chest.php b/src/tile/Chest.php index ccad9bb13..77e933c97 100644 --- a/src/tile/Chest.php +++ b/src/tile/Chest.php @@ -21,13 +21,13 @@ namespace PocketMine\Tile; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\Math\Vector3 as Vector3; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Int as Int; use PocketMine\NBT\Tag\String as String; use PocketMine\Network\Protocol\EntityDataPacket as EntityDataPacket; +use PocketMine; class Chest extends Spawnable{ use Container; diff --git a/src/tile/Container.php b/src/tile/Container.php index 2d60608c0..d0cbc923e 100644 --- a/src/tile/Container.php +++ b/src/tile/Container.php @@ -21,7 +21,6 @@ namespace PocketMine\Tile; -use PocketMine; use PocketMine\Event\Event as Event; use PocketMine\Event\EventHandler as EventHandler; use PocketMine\Event\Tile\TileInventoryChangeEvent as TileInventoryChangeEvent; @@ -30,6 +29,7 @@ use PocketMine\NBT\Tag\Byte as Byte; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Short as Short; use PocketMine\Player as Player; +use PocketMine; trait Container{ public function openInventory(Player $player){ diff --git a/src/tile/Furnace.php b/src/tile/Furnace.php index 58a1e47cb..2cac10213 100644 --- a/src/tile/Furnace.php +++ b/src/tile/Furnace.php @@ -21,11 +21,11 @@ namespace PocketMine\Tile; -use PocketMine; use PocketMine\Block\Block as Block; use PocketMine\Item\Item as Item; use PocketMine\Level\Level as Level; use PocketMine\NBT\Tag\Compound as Compound; +use PocketMine; class Furnace extends Tile{ use Container; diff --git a/src/tile/Sign.php b/src/tile/Sign.php index a9b1bfaf2..d4f494a75 100644 --- a/src/tile/Sign.php +++ b/src/tile/Sign.php @@ -21,12 +21,12 @@ namespace PocketMine\Tile; -use PocketMine; use PocketMine\NBT\NBT as NBT; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\NBT\Tag\Int as Int; use PocketMine\NBT\Tag\String as String; use PocketMine\Network\Protocol\EntityDataPacket as EntityDataPacket; +use PocketMine; class Sign extends Spawnable{ diff --git a/src/tile/Tile.php b/src/tile/Tile.php index 8d2b82c30..283d2d4c7 100644 --- a/src/tile/Tile.php +++ b/src/tile/Tile.php @@ -25,11 +25,11 @@ */ namespace PocketMine\Tile; -use PocketMine; use PocketMine\Level\Level as Level; use PocketMine\NBT\Tag\Compound as Compound; use PocketMine\PMF\LevelFormat as LevelFormat; use PocketMine\ServerAPI as ServerAPI; +use PocketMine; abstract class Tile extends Position{ const SIGN = "Sign";