From 328cc968bda98406b93a5c1c6aa03d03125d7ef0 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sat, 2 Feb 2013 17:38:15 +0100 Subject: [PATCH] Added more block properties --- src/API/BlockAPI.php | 60 ++++++++----------- src/classes/material/IDs.php | 10 ++-- .../material/block/attachable/Torch.php | 33 ++++++++++ src/classes/material/block/misc/Fire.php | 34 +++++++++++ src/classes/material/block/misc/TNT.php | 33 ++++++++++ src/classes/material/block/ore/DiamondOre.php | 33 ++++++++++ src/classes/material/block/plant/Wheat.php | 33 ++++++++++ .../material/block/solid/Bookshelf.php | 33 ++++++++++ src/classes/material/block/solid/Bricks.php | 33 ++++++++++ .../material/block/solid/BurningFurnace.php | 34 +++++++++++ src/classes/material/block/solid/Chest.php | 34 +++++++++++ .../block/solid/CobblestoneStairs.php | 33 ++++++++++ src/classes/material/block/solid/Diamond.php | 33 ++++++++++ .../material/block/solid/DoubleSlab.php | 44 ++++++++++++++ src/classes/material/block/solid/Farmland.php | 33 ++++++++++ src/classes/material/block/solid/Furnace.php | 34 +++++++++++ src/classes/material/block/solid/Ladder.php | 33 ++++++++++ .../material/block/solid/MossStone.php | 33 ++++++++++ src/classes/material/block/solid/Obsidian.php | 33 ++++++++++ src/classes/material/block/solid/SignPost.php | 33 ++++++++++ src/classes/material/block/solid/Slab.php | 44 ++++++++++++++ src/classes/material/block/solid/WallSign.php | 33 ++++++++++ src/classes/material/block/solid/WoodDoor.php | 34 +++++++++++ .../material/block/solid/WoodStairs.php | 33 ++++++++++ .../material/block/solid/Workbench.php | 34 +++++++++++ 25 files changed, 818 insertions(+), 39 deletions(-) create mode 100644 src/classes/material/block/attachable/Torch.php create mode 100644 src/classes/material/block/misc/Fire.php create mode 100644 src/classes/material/block/misc/TNT.php create mode 100644 src/classes/material/block/ore/DiamondOre.php create mode 100644 src/classes/material/block/plant/Wheat.php create mode 100644 src/classes/material/block/solid/Bookshelf.php create mode 100644 src/classes/material/block/solid/Bricks.php create mode 100644 src/classes/material/block/solid/BurningFurnace.php create mode 100644 src/classes/material/block/solid/Chest.php create mode 100644 src/classes/material/block/solid/CobblestoneStairs.php create mode 100644 src/classes/material/block/solid/Diamond.php create mode 100644 src/classes/material/block/solid/DoubleSlab.php create mode 100644 src/classes/material/block/solid/Farmland.php create mode 100644 src/classes/material/block/solid/Furnace.php create mode 100644 src/classes/material/block/solid/Ladder.php create mode 100644 src/classes/material/block/solid/MossStone.php create mode 100644 src/classes/material/block/solid/Obsidian.php create mode 100644 src/classes/material/block/solid/SignPost.php create mode 100644 src/classes/material/block/solid/Slab.php create mode 100644 src/classes/material/block/solid/WallSign.php create mode 100644 src/classes/material/block/solid/WoodDoor.php create mode 100644 src/classes/material/block/solid/WoodStairs.php create mode 100644 src/classes/material/block/solid/Workbench.php diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index ecc46ec4..4959cf80 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -84,43 +84,34 @@ class BlockAPI{ RED_MUSHROOM => "RedMushRoomBlock", GOLD_BLOCK => "GoldBlock", IRON_BLOCK => "IronBlock", - /*DOUBLE_SLAB => (new GenericBlock(DOUBLE_SLAB, 0, "")), - DOUBLE_SLABS => (new GenericBlock(DOUBLE_SLABS, 0, "")), - SLAB => (new GenericBlock(SLAB, 0, "")), - SLABS => (new GenericBlock(SLABS, 0, "")), - BICKS => (new GenericBlock(BICKS, 0, "")), - TNT => (new GenericBlock(TNT, 0, "")), - BOOKSHELF => (new GenericBlock(BOOKSHELF, 0, "")), - MOSS_STONE => (new GenericBlock(MOSS_STONE, 0, "")), - MOSSY_STONE => (new GenericBlock(MOSSY_STONE, 0, "")), - OBSIDIAN => (new GenericBlock(OBSIDIAN, 0, "")), - TORCH => (new GenericBlock(TORCH, 0, "")), - FIRE => (new GenericBlock(FIRE, 0, "")), + DOUBLE_SLAB => "DoubleSlabBlock", + SLAB => "SlabBlock", + BRICKS => "BricksBlock", + TNT => "TNTBlock", + BOOKSHELF => "BookshelfBlock", + MOSS_STONE => "MossStoneBlock", + OBSIDIAN => "ObsidianBlock", + TORCH => "TorchBlock", + FIRE => "FireBlock", - WOOD_STAIRS => (new GenericBlock(WOOD_STAIRS, 0, "")), - CHEST => (new GenericBlock(CHEST, 0, "")), + WOOD_STAIRS => "WoodStairsBlock", + CHEST => "ChestBlock", - DIAMOND_ORE => (new GenericBlock(DIAMOND_ORE, 0, "")), - DIAMOND_BLOCK => (new GenericBlock(DIAMOND_BLOCK, 0, "")), - CRAFTING_TABLE => (new GenericBlock(CRAFTING_TABLE, 0, "")), - WORKBENCH => (new GenericBlock(WORKBENCH, 0, "")), - WHEAT => (new GenericBlock(WHEAT, 0, "")), - FARMLAND => (new GenericBlock(FARMLAND, 0, "")), - FURNACE => (new GenericBlock(FURNACE, 0, "")), - BURNING_FURNACE => (new GenericBlock(BURNING_FURNACE, 0, "")), - LIT_FURNACE => (new GenericBlock(LIT_FURNACE, 0, "")), - SIGN => (new GenericBlock(SIGN, 0, "")), - SIGN_POST => (new GenericBlock(SIGN_POST, 0, "")), - DOOR => (new GenericBlock(DOOR, 0, "")), - WOODEN_DOOR => (new GenericBlock(WOODEN_DOOR, 0, "")), - WOOD_DOOR => (new GenericBlock(WOOD_DOOR, 0, "")), - LADDER => (new GenericBlock(LADDER, 0, "")), + DIAMOND_ORE => "DiamondOreBlock", + DIAMOND_BLOCK => "DiamondBlock", + WORKBENCH => "WorkbenchBlock", + WHEAT => "WheatBlock", + FARMLAND => "FarmlandBlock", + FURNACE => "FurnaceBlock", + BURNING_FURNACE => "BurningFurnaceBlock", + SIGN_POST => "SignPostBlock", + WOOD_DOOR_BLOCK => "WoodDoorBlock", + LADDER => "LadderBlock", - COBBLE_STAIRS => (new GenericBlock(COBBLE_STAIRS, 0, "")), - COBBLESTONE_STAIRS => (new GenericBlock(COBBLESTONE_STAIRS, 0, "")), - WALL_SIGN => (new GenericBlock(WALL_SIGN, 0, "")), + COBBLESTONE_STAIRS => "CobblestoneStairsBlock", + WALL_SIGN => "WallSignBlock", - IRON_DOOR => (new GenericBlock(IRON_DOOR, 0, "")), + /*IRON_DOOR => (new GenericBlock(IRON_DOOR, 0, "")), REDSTONE_ORE => (new GenericBlock(REDSTONE_ORE, 0, "")), GLOWING_REDSTONE_ORE => (new GenericBlock(GLOWING_REDSTONE_ORE, 0, "")), LIT_REDSTONE_ORE => (new GenericBlock(LIT_REDSTONE_ORE, 0, "")), @@ -163,8 +154,7 @@ class BlockAPI{ STONECUTTER => (new GenericBlock(STONECUTTER, 0, "")), GLOWING_OBSIDIAN => (new GenericBlock(GLOWING_OBSIDIAN, 0, "")), - NETHER_REACTOR => (new GenericBlock(NETHER_REACTOR, 0, "")), - */ + NETHER_REACTOR => (new GenericBlock(NETHER_REACTOR, 0, "")),*/ ); } diff --git a/src/classes/material/IDs.php b/src/classes/material/IDs.php index 07d4e7a7..67094206 100644 --- a/src/classes/material/IDs.php +++ b/src/classes/material/IDs.php @@ -75,7 +75,8 @@ define("DOUBLE_SLAB", 43); define("DOUBLE_SLABS", 43); define("SLAB", 44); define("SLABS", 44); -define("BICKS", 45); +define("BRICKS", 45); +define("BRICKS_BLOCK", 45); define("TNT", 46); define("BOOKSHELF", 47); define("MOSS_STONE", 48); @@ -85,6 +86,7 @@ define("TORCH", 50); define("FIRE", 51); define("WOOD_STAIRS", 53); +define("WOODEN_STAIRS", 53); define("CHEST", 54); define("DIAMOND_ORE", 56); @@ -98,9 +100,9 @@ define("BURNING_FURNACE", 62); define("LIT_FURNACE", 62); define("SIGN", 63); define("SIGN_POST", 63); -define("DOOR", 64); -define("WOODEN_DOOR", 64); -define("WOOD_DOOR", 64); +define("DOOR_BLOCK", 64); +define("WOODEN_DOOR_BLOCK", 64); +define("WOOD_DOOR_BLOCK", 64); define("LADDER", 65); define("COBBLE_STAIRS", 67); diff --git a/src/classes/material/block/attachable/Torch.php b/src/classes/material/block/attachable/Torch.php new file mode 100644 index 00000000..3ef8c6ac --- /dev/null +++ b/src/classes/material/block/attachable/Torch.php @@ -0,0 +1,33 @@ +isReplaceable = true; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/misc/TNT.php b/src/classes/material/block/misc/TNT.php new file mode 100644 index 00000000..3b6a3a8f --- /dev/null +++ b/src/classes/material/block/misc/TNT.php @@ -0,0 +1,33 @@ +isActivable = true; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/Chest.php b/src/classes/material/block/solid/Chest.php new file mode 100644 index 00000000..0bada505 --- /dev/null +++ b/src/classes/material/block/solid/Chest.php @@ -0,0 +1,34 @@ +isActivable = true; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/CobblestoneStairs.php b/src/classes/material/block/solid/CobblestoneStairs.php new file mode 100644 index 00000000..f8cd1f5e --- /dev/null +++ b/src/classes/material/block/solid/CobblestoneStairs.php @@ -0,0 +1,33 @@ + "Stone", + 1 => "Sandstone", + 2 => "Wooden", + 3 => "Cobblestone", + 4 => "Brick", + 5 => "Stone Brick", + 6 => "Nether Brick", + 7 => "Quartz", + ); + $this->name = "Double " . $names[$this->meta & 0x07] . " Slab"; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/Farmland.php b/src/classes/material/block/solid/Farmland.php new file mode 100644 index 00000000..c50e94e2 --- /dev/null +++ b/src/classes/material/block/solid/Farmland.php @@ -0,0 +1,33 @@ +isActivable = true; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/Ladder.php b/src/classes/material/block/solid/Ladder.php new file mode 100644 index 00000000..5f8ef84b --- /dev/null +++ b/src/classes/material/block/solid/Ladder.php @@ -0,0 +1,33 @@ + "Stone", + 1 => "Sandstone", + 2 => "Wooden", + 3 => "Cobblestone", + 4 => "Brick", + 5 => "Stone Brick", + 6 => "Nether Brick", + 7 => "Quartz", + ); + $this->name = (($this->meta & 0x08) === 0x08 ? "Upper ":"") . $names[$this->meta & 0x07] . " Slab"; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/WallSign.php b/src/classes/material/block/solid/WallSign.php new file mode 100644 index 00000000..47f2be41 --- /dev/null +++ b/src/classes/material/block/solid/WallSign.php @@ -0,0 +1,33 @@ +isActivable = true; + } + +} \ No newline at end of file diff --git a/src/classes/material/block/solid/WoodStairs.php b/src/classes/material/block/solid/WoodStairs.php new file mode 100644 index 00000000..d6175ea3 --- /dev/null +++ b/src/classes/material/block/solid/WoodStairs.php @@ -0,0 +1,33 @@ +isActivable = true; + } + +} \ No newline at end of file