diff options
author | Mattes D <github@xoft.cz> | 2014-09-26 22:24:45 +0200 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-09-26 22:24:45 +0200 |
commit | 2c5b0f23788f027ebcb6e38d26036a04d011e1fd (patch) | |
tree | 0fde79c6cc466306eb042e88728c209cbc94f789 /src/Items | |
parent | Merge pull request #1455 from mc-server/includes (diff) | |
parent | Moved curly brace to seperate line (diff) | |
download | cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.gz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.bz2 cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.lz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.xz cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.tar.zst cuberite-2c5b0f23788f027ebcb6e38d26036a04d011e1fd.zip |
Diffstat (limited to 'src/Items')
-rw-r--r-- | src/Items/ItemDoor.h | 17 | ||||
-rw-r--r-- | src/Items/ItemFood.h | 5 | ||||
-rw-r--r-- | src/Items/ItemHandler.cpp | 78 |
3 files changed, 72 insertions, 28 deletions
diff --git a/src/Items/ItemDoor.h b/src/Items/ItemDoor.h index c1b439024..cd5baf44f 100644 --- a/src/Items/ItemDoor.h +++ b/src/Items/ItemDoor.h @@ -30,7 +30,22 @@ public: BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta ) override { - a_BlockType = (m_ItemType == E_ITEM_WOODEN_DOOR) ? E_BLOCK_WOODEN_DOOR : E_BLOCK_IRON_DOOR; + switch (m_ItemType) + { + case E_ITEM_WOODEN_DOOR: a_BlockType = E_BLOCK_WOODEN_DOOR; break; + case E_ITEM_IRON_DOOR: a_BlockType = E_BLOCK_IRON_DOOR; break; + case E_ITEM_SPRUCE_DOOR: a_BlockType = E_BLOCK_SPRUCE_DOOR; break; + case E_ITEM_BIRCH_DOOR: a_BlockType = E_BLOCK_BIRCH_DOOR; break; + case E_ITEM_JUNGLE_DOOR: a_BlockType = E_BLOCK_JUNGLE_DOOR; break; + case E_ITEM_DARK_OAK_DOOR: a_BlockType = E_BLOCK_DARK_OAK_DOOR; break; + case E_ITEM_ACACIA_DOOR: a_BlockType = E_BLOCK_ACACIA_DOOR; break; + default: + { + ASSERT(!"Unhandled door type"); + return false; + } + } + cChunkInterface ChunkInterface(a_World->GetChunkMap()); bool Meta = BlockHandler(a_BlockType)->GetPlacementBlockTypeMeta( ChunkInterface, a_Player, diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index 1af6e21e8..e7c718c77 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -35,7 +35,9 @@ public: // Carrots handled in ItemSeeds case E_ITEM_COOKED_CHICKEN: return FoodInfo(6, 7.2); case E_ITEM_COOKED_FISH: return FoodInfo(5, 6); // TODO: Add other fish types + case E_ITEM_COOKED_MUTTON: return FoodInfo(6, 9.6); case E_ITEM_COOKED_PORKCHOP: return FoodInfo(8, 12.8); + case E_ITEM_COOKED_RABBIT: return FoodInfo(5, 6); case E_ITEM_COOKIE: return FoodInfo(2, 0.4); // Golden apple handled in ItemGoldenApple case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4); @@ -43,16 +45,17 @@ public: case E_ITEM_POISONOUS_POTATO: return FoodInfo(2, 1.2); // Potatoes handled in ItemSeeds case E_ITEM_PUMPKIN_PIE: return FoodInfo(8, 4.8); + case E_ITEM_RABBIT_STEW: return FoodInfo(10, 12); case E_ITEM_RED_APPLE: return FoodInfo(4, 2.4); case E_ITEM_RAW_BEEF: return FoodInfo(3, 1.8); case E_ITEM_RAW_CHICKEN: return FoodInfo(2, 1.2); case E_ITEM_RAW_FISH: return FoodInfo(2, 1.2); case E_ITEM_RAW_MUTTON: return FoodInfo(2, 1.2); case E_ITEM_RAW_PORKCHOP: return FoodInfo(3, 1.8); + case E_ITEM_RAW_RABBIT: return FoodInfo(3, 1.8); case E_ITEM_ROTTEN_FLESH: return FoodInfo(4, 0.8); case E_ITEM_SPIDER_EYE: return FoodInfo(2, 3.2); case E_ITEM_STEAK: return FoodInfo(8, 12.8); - case E_ITEM_MUTTON: return FoodInfo(6, 9.6); } LOGWARNING("%s: Unknown food item (%d), returning zero nutrition", __FUNCTION__, m_ItemType); return FoodInfo(0, 0.f); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 8c3f28c74..caa623abc 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -193,6 +193,11 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) return new cItemSeedsHandler(a_ItemType); } + case E_ITEM_ACACIA_DOOR: + case E_ITEM_BIRCH_DOOR: + case E_ITEM_DARK_OAK_DOOR: + case E_ITEM_JUNGLE_DOOR: + case E_ITEM_SPRUCE_DOOR: case E_ITEM_IRON_DOOR: case E_ITEM_WOODEN_DOOR: { @@ -214,19 +219,22 @@ cItemHandler *cItemHandler::CreateItemHandler(int a_ItemType) case E_ITEM_BREAD: case E_ITEM_COOKED_CHICKEN: case E_ITEM_COOKED_FISH: + case E_ITEM_COOKED_MUTTON: case E_ITEM_COOKED_PORKCHOP: + case E_ITEM_COOKED_RABBIT: case E_ITEM_COOKIE: case E_ITEM_GOLDEN_CARROT: case E_ITEM_MELON_SLICE: - case E_ITEM_MUTTON: case E_ITEM_POISONOUS_POTATO: case E_ITEM_PUMPKIN_PIE: - case E_ITEM_RED_APPLE: + case E_ITEM_RABBIT_STEW: case E_ITEM_RAW_BEEF: case E_ITEM_RAW_CHICKEN: case E_ITEM_RAW_FISH: case E_ITEM_RAW_MUTTON: case E_ITEM_RAW_PORKCHOP: + case E_ITEM_RAW_RABBIT: + case E_ITEM_RED_APPLE: case E_ITEM_ROTTEN_FLESH: case E_ITEM_SPIDER_EYE: case E_ITEM_STEAK: @@ -392,8 +400,12 @@ char cItemHandler::GetMaxStackSize(void) switch (m_ItemType) { + case E_ITEM_ACACIA_DOOR: return 64; + case E_ITEM_ARMOR_STAND: return 16; case E_ITEM_ARROW: return 64; case E_ITEM_BAKED_POTATO: return 64; + case E_ITEM_BANNER: return 16; + case E_ITEM_BIRCH_DOOR: return 64; case E_ITEM_BLAZE_POWDER: return 64; case E_ITEM_BLAZE_ROD: return 64; case E_ITEM_BONE: return 64; @@ -404,7 +416,6 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_BREWING_STAND: return 64; case E_ITEM_BUCKET: return 16; case E_ITEM_CARROT: return 64; - case E_ITEM_CAKE: return 1; case E_ITEM_CAULDRON: return 64; case E_ITEM_CLAY: return 64; case E_ITEM_CLAY_BRICK: return 64; @@ -415,7 +426,9 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_COOKED_CHICKEN: return 64; case E_ITEM_COOKED_FISH: return 64; case E_ITEM_COOKED_PORKCHOP: return 64; + case E_ITEM_COOKED_MUTTON: return 64; case E_ITEM_COOKIE: return 64; + case E_ITEM_DARK_OAK_DOOR: return 64; case E_ITEM_DIAMOND: return 64; case E_ITEM_DYE: return 64; case E_ITEM_EGG: return 16; @@ -439,6 +452,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_GOLD_NUGGET: return 64; case E_ITEM_GUNPOWDER: return 64; case E_ITEM_HEAD: return 64; + case E_ITEM_JUNGLE_DOOR: return 64; case E_ITEM_IRON: return 64; case E_ITEM_ITEM_FRAME: return 64; case E_ITEM_LEATHER: return 64; @@ -452,11 +466,16 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_PAPER: return 64; case E_ITEM_POISONOUS_POTATO: return 64; case E_ITEM_POTATO: return 64; + case E_ITEM_PRISMARINE_CRYSTALS: return 64; + case E_ITEM_PRISMARINE_SHARD: return 64; case E_ITEM_PUMPKIN_PIE: return 64; case E_ITEM_PUMPKIN_SEEDS: return 64; + case E_ITEM_RABBITS_FOOT: return 64; + case E_ITEM_RABBIT_HIDE: return 64; case E_ITEM_RAW_BEEF: return 64; case E_ITEM_RAW_CHICKEN: return 64; case E_ITEM_RAW_FISH: return 64; + case E_ITEM_RAW_MUTTON: return 64; case E_ITEM_RAW_PORKCHOP: return 64; case E_ITEM_RED_APPLE: return 64; case E_ITEM_REDSTONE_DUST: return 64; @@ -468,6 +487,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_SNOWBALL: return 16; case E_ITEM_SPAWN_EGG: return 64; case E_ITEM_SPIDER_EYE: return 64; + case E_ITEM_SPRUCE_DOOR: return 64; case E_ITEM_STEAK: return 64; case E_ITEM_STICK: return 64; case E_ITEM_STRING: return 64; @@ -546,41 +566,47 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_ANVIL: - case E_BLOCK_ENCHANTMENT_TABLE: - case E_BLOCK_FURNACE: - case E_BLOCK_LIT_FURNACE: + case E_BLOCK_BRICK: + case E_BLOCK_CAULDRON: case E_BLOCK_COAL_ORE: - case E_BLOCK_STONE: case E_BLOCK_COBBLESTONE: - case E_BLOCK_END_STONE: - case E_BLOCK_MOSSY_COBBLESTONE: - case E_BLOCK_SANDSTONE_STAIRS: - case E_BLOCK_SANDSTONE: - case E_BLOCK_STONE_BRICKS: - case E_BLOCK_NETHER_BRICK: - case E_BLOCK_NETHERRACK: - case E_BLOCK_STONE_SLAB: - case E_BLOCK_DOUBLE_STONE_SLAB: - case E_BLOCK_STONE_PRESSURE_PLATE: - case E_BLOCK_BRICK: case E_BLOCK_COBBLESTONE_STAIRS: case E_BLOCK_COBBLESTONE_WALL: - case E_BLOCK_STONE_BRICK_STAIRS: - case E_BLOCK_NETHER_BRICK_STAIRS: - case E_BLOCK_CAULDRON: - case E_BLOCK_OBSIDIAN: case E_BLOCK_DIAMOND_BLOCK: case E_BLOCK_DIAMOND_ORE: + case E_BLOCK_DOUBLE_STONE_SLAB: + case E_BLOCK_EMERALD_ORE: + case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_STONE: + case E_BLOCK_FURNACE: case E_BLOCK_GOLD_BLOCK: case E_BLOCK_GOLD_ORE: - case E_BLOCK_REDSTONE_ORE: - case E_BLOCK_REDSTONE_ORE_GLOWING: - case E_BLOCK_EMERALD_ORE: case E_BLOCK_IRON_BLOCK: case E_BLOCK_IRON_ORE: - case E_BLOCK_LAPIS_ORE: + case E_BLOCK_IRON_TRAPDOOR: case E_BLOCK_LAPIS_BLOCK: + case E_BLOCK_LAPIS_ORE: + case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MOSSY_COBBLESTONE: + case E_BLOCK_NETHER_BRICK: + case E_BLOCK_NETHER_BRICK_STAIRS: + case E_BLOCK_NETHER_BRICK_FENCE: + case E_BLOCK_NETHERRACK: + case E_BLOCK_NEW_STONE_SLAB: + case E_BLOCK_OBSIDIAN: + case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_RED_SANDSTONE: + case E_BLOCK_RED_SANDSTONE_STAIRS: + case E_BLOCK_REDSTONE_ORE: + case E_BLOCK_REDSTONE_ORE_GLOWING: + case E_BLOCK_SANDSTONE_STAIRS: + case E_BLOCK_SANDSTONE: case E_BLOCK_SNOW: + case E_BLOCK_STONE: + case E_BLOCK_STONE_BRICKS: + case E_BLOCK_STONE_BRICK_STAIRS: + case E_BLOCK_STONE_PRESSURE_PLATE: + case E_BLOCK_STONE_SLAB: case E_BLOCK_VINES: case E_BLOCK_PACKED_ICE: case E_BLOCK_MOB_SPAWNER: |