From 4311f4a658fe2bef362aeb9b4bdbcd59c9617ad6 Mon Sep 17 00:00:00 2001 From: mathiascode Date: Tue, 14 Feb 2017 12:13:55 +0200 Subject: Added some blocks and items (#3503) --- src/BlockEntities/NoteEntity.cpp | 126 ++++++++++++++++++++++++++++++-- src/BlockID.h | 41 ++++++++++- src/BlockInfo.cpp | 122 ++++++++++++++++++++++++++++++- src/Blocks/BlockCrops.h | 23 ++++-- src/Blocks/BlockFarmland.h | 2 + src/Blocks/BlockFluid.h | 1 + src/Blocks/BlockHandler.cpp | 18 ++++- src/Blocks/BlockPiston.h | 4 + src/Blocks/BlockSlab.h | 13 +++- src/Blocks/BlockStairs.h | 1 + src/Defines.h | 26 ++++++- src/Generating/DungeonRoomsFinisher.cpp | 7 ++ src/Items/ItemFood.h | 7 +- src/Items/ItemHandler.cpp | 36 ++++++++- src/Items/ItemPickaxe.h | 11 ++- src/Items/ItemSeeds.h | 15 ++-- src/Items/ItemShovel.h | 2 +- src/Mobs/Villager.cpp | 1 + src/Protocol/Protocol_1_8.cpp | 10 +++ src/Protocol/Protocol_1_9.cpp | 10 +++ src/Simulator/FluidSimulator.cpp | 1 + src/Simulator/SandSimulator.cpp | 9 +++ src/World.cpp | 22 ++++++ src/World.h | 1 + 24 files changed, 474 insertions(+), 35 deletions(-) (limited to 'src') diff --git a/src/BlockEntities/NoteEntity.cpp b/src/BlockEntities/NoteEntity.cpp index a1e1d931d..7430cfba0 100644 --- a/src/BlockEntities/NoteEntity.cpp +++ b/src/BlockEntities/NoteEntity.cpp @@ -38,11 +38,52 @@ void cNoteEntity::MakeSound(void) switch (m_World->GetBlock(m_PosX, m_PosY - 1, m_PosZ)) { - case E_BLOCK_PLANKS: + case E_BLOCK_ACACIA_DOOR: + case E_BLOCK_ACACIA_FENCE: + case E_BLOCK_ACACIA_FENCE_GATE: + case E_BLOCK_ACACIA_WOOD_STAIRS: + case E_BLOCK_BIRCH_DOOR: + case E_BLOCK_BIRCH_FENCE: + case E_BLOCK_BIRCH_FENCE_GATE: + case E_BLOCK_BIRCH_WOOD_STAIRS: + case E_BLOCK_BOOKCASE: + case E_BLOCK_CHEST: + case E_BLOCK_CRAFTING_TABLE: + case E_BLOCK_DARK_OAK_DOOR: + case E_BLOCK_DARK_OAK_FENCE: + case E_BLOCK_DARK_OAK_FENCE_GATE: + case E_BLOCK_DARK_OAK_WOOD_STAIRS: + case E_BLOCK_DAYLIGHT_SENSOR: + case E_BLOCK_DOUBLE_WOODEN_SLAB: + case E_BLOCK_FENCE: + case E_BLOCK_HUGE_BROWN_MUSHROOM: + case E_BLOCK_HUGE_RED_MUSHROOM: + case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: + case E_BLOCK_JUKEBOX: + case E_BLOCK_JUNGLE_DOOR: + case E_BLOCK_JUNGLE_FENCE: + case E_BLOCK_JUNGLE_FENCE_GATE: + case E_BLOCK_JUNGLE_WOOD_STAIRS: case E_BLOCK_LOG: + case E_BLOCK_NEW_LOG: case E_BLOCK_NOTE_BLOCK: + case E_BLOCK_OAK_DOOR: + case E_BLOCK_OAK_FENCE_GATE: + case E_BLOCK_OAK_WOOD_STAIRS: + case E_BLOCK_PLANKS: + case E_BLOCK_SIGN_POST: + case E_BLOCK_SPRUCE_DOOR: + case E_BLOCK_SPRUCE_FENCE: + case E_BLOCK_SPRUCE_FENCE_GATE: + case E_BLOCK_SPRUCE_WOOD_STAIRS: + case E_BLOCK_STANDING_BANNER: + case E_BLOCK_TRAPDOOR: + case E_BLOCK_TRAPPED_CHEST: + case E_BLOCK_WALL_BANNER: + case E_BLOCK_WALLSIGN: + case E_BLOCK_WOODEN_PRESSURE_PLATE: + case E_BLOCK_WOODEN_SLAB: { - // TODO: add other wood-based blocks if needed instrument = E_INST_DOUBLE_BASS; sampleName = "note.bassattack"; break; @@ -57,24 +98,93 @@ void cNoteEntity::MakeSound(void) break; } + case E_BLOCK_BEACON: case E_BLOCK_GLASS: case E_BLOCK_GLASS_PANE: case E_BLOCK_GLOWSTONE: + case E_BLOCK_SEA_LANTERN: + case E_BLOCK_STAINED_GLASS: + case E_BLOCK_STAINED_GLASS_PANE: { instrument = E_INST_CLICKS; sampleName = "note.hat"; break; } - case E_BLOCK_STONE: - case E_BLOCK_STONE_BRICKS: - case E_BLOCK_COBBLESTONE: - case E_BLOCK_OBSIDIAN: - case E_BLOCK_NETHERRACK: + case E_BLOCK_BEDROCK: + case E_BLOCK_BLACK_SHULKER_BOX: + case E_BLOCK_BLOCK_OF_COAL: + case E_BLOCK_BLUE_SHULKER_BOX: + case E_BLOCK_BONE_BLOCK: case E_BLOCK_BRICK: + case E_BLOCK_BRICK_STAIRS: + case E_BLOCK_BROWN_SHULKER_BOX: + case E_BLOCK_CLAY: + case E_BLOCK_COAL_ORE: + case E_BLOCK_COBBLESTONE: + case E_BLOCK_COBBLESTONE_STAIRS: + case E_BLOCK_COBBLESTONE_WALL: + case E_BLOCK_CYAN_SHULKER_BOX: + case E_BLOCK_DIAMOND_ORE: + case E_BLOCK_DISPENSER: + case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: + case E_BLOCK_DOUBLE_STONE_SLAB: + case E_BLOCK_DROPPER: + case E_BLOCK_EMERALD_ORE: + case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_BRICKS: + case E_BLOCK_END_PORTAL_FRAME: + case E_BLOCK_END_STONE: + case E_BLOCK_ENDER_CHEST: + case E_BLOCK_FURNACE: + case E_BLOCK_GOLD_ORE: + case E_BLOCK_GRAY_SHULKER_BOX: + case E_BLOCK_GREEN_SHULKER_BOX: + case E_BLOCK_IRON_ORE: + case E_BLOCK_LAPIS_ORE: + case E_BLOCK_LIGHT_BLUE_SHULKER_BOX: + case E_BLOCK_LIGHT_GRAY_SHULKER_BOX: + case E_BLOCK_LIME_SHULKER_BOX: + case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MAGENTA_SHULKER_BOX: + case E_BLOCK_MAGMA: + case E_BLOCK_MOB_SPAWNER: + case E_BLOCK_MOSSY_COBBLESTONE: case E_BLOCK_NETHER_BRICK: + case E_BLOCK_NETHER_BRICK_FENCE: + case E_BLOCK_NETHER_BRICK_STAIRS: + case E_BLOCK_NETHER_QUARTZ_ORE: + case E_BLOCK_NETHERRACK: + case E_BLOCK_OBSERVER: + case E_BLOCK_OBSIDIAN: + case E_BLOCK_ORANGE_SHULKER_BOX: + case E_BLOCK_PINK_SHULKER_BOX: + case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_PURPLE_SHULKER_BOX: + case E_BLOCK_PURPUR_BLOCK: + case E_BLOCK_PURPUR_DOUBLE_SLAB: + case E_BLOCK_PURPUR_PILLAR: + case E_BLOCK_PURPUR_SLAB: + case E_BLOCK_PURPUR_STAIRS: + case E_BLOCK_QUARTZ_BLOCK: + case E_BLOCK_QUARTZ_STAIRS: + case E_BLOCK_RED_NETHER_BRICK: + case E_BLOCK_RED_SANDSTONE: + case E_BLOCK_RED_SANDSTONE_SLAB: + case E_BLOCK_RED_SANDSTONE_STAIRS: + case E_BLOCK_RED_SHULKER_BOX: + case E_BLOCK_REDSTONE_ORE: + case E_BLOCK_REDSTONE_ORE_GLOWING: + case E_BLOCK_SANDSTONE: + case E_BLOCK_SANDSTONE_STAIRS: + case E_BLOCK_STONE: + case E_BLOCK_STONE_BRICK_STAIRS: + case E_BLOCK_STONE_BRICKS: + case E_BLOCK_STONE_PRESSURE_PLATE: + case E_BLOCK_STONE_SLAB: + case E_BLOCK_WHITE_SHULKER_BOX: + case E_BLOCK_YELLOW_SHULKER_BOX: { - // TODO: add other stone-based blocks if needed instrument = E_INST_BASS_DRUM; sampleName = "note.bd"; break; diff --git a/src/BlockID.h b/src/BlockID.h index bf668377c..8ce7a040b 100644 --- a/src/BlockID.h +++ b/src/BlockID.h @@ -235,12 +235,29 @@ enum BLOCKTYPE E_BLOCK_RED_NETHER_BRICK = 215, E_BLOCK_BONE_BLOCK = 216, E_BLOCK_STRUCTURE_VOID = 217, + E_BLOCK_OBSERVER = 218, + E_BLOCK_WHITE_SHULKER_BOX = 219, + E_BLOCK_ORANGE_SHULKER_BOX = 220, + E_BLOCK_MAGENTA_SHULKER_BOX = 221, + E_BLOCK_LIGHT_BLUE_SHULKER_BOX = 222, + E_BLOCK_YELLOW_SHULKER_BOX = 223, + E_BLOCK_LIME_SHULKER_BOX = 224, + E_BLOCK_PINK_SHULKER_BOX = 225, + E_BLOCK_GRAY_SHULKER_BOX = 226, + E_BLOCK_LIGHT_GRAY_SHULKER_BOX = 227, + E_BLOCK_CYAN_SHULKER_BOX = 228, + E_BLOCK_PURPLE_SHULKER_BOX = 229, + E_BLOCK_BLUE_SHULKER_BOX = 230, + E_BLOCK_BROWN_SHULKER_BOX = 231, + E_BLOCK_GREEN_SHULKER_BOX = 232, + E_BLOCK_RED_SHULKER_BOX = 233, + E_BLOCK_BLACK_SHULKER_BOX = 234, // ... E_BLOCK_STRUCTURE_BLOCK = 255, // Keep these two as the last values. Update the last block value to the last block with an id less than 255 when adding another block // IsValidBlock() depends on this (255 gets checked additionally because there is a gap. See http://minecraft.gamepedia.com/Data_values#Block_IDs - E_BLOCK_NUMBER_OF_TYPES = E_BLOCK_STRUCTURE_VOID + 1, ///< Number of individual (different) blocktypes + E_BLOCK_NUMBER_OF_TYPES = E_BLOCK_BLACK_SHULKER_BOX + 1, ///< Number of individual (different) blocktypes E_BLOCK_MAX_TYPE_ID = E_BLOCK_NUMBER_OF_TYPES - 1, ///< Maximum BlockType number used // Synonym or ID compatibility @@ -439,11 +456,32 @@ enum ENUM_ITEM_ID E_ITEM_RAW_MUTTON = 423, E_ITEM_COOKED_MUTTON = 424, E_ITEM_BANNER = 425, + E_ITEM_END_CRYSTAL = 426, E_ITEM_SPRUCE_DOOR = 427, E_ITEM_BIRCH_DOOR = 428, E_ITEM_JUNGLE_DOOR = 429, E_ITEM_ACACIA_DOOR = 430, E_ITEM_DARK_OAK_DOOR = 431, + E_ITEM_CHORUS_FRUIT = 432, + E_ITEM_POPPED_CHORUS_FRUIT = 433, + E_ITEM_BEETROOT = 434, + E_ITEM_BEETROOT_SEEDS = 435, + E_ITEM_BEETROOT_SOUP = 436, + E_ITEM_DRAGON_BREATH = 437, + E_ITEM_SPLASH_POTION = 438, + E_ITEM_SPECTRAL_ARROW = 439, + E_ITEM_TIPPED_ARROW = 440, + E_ITEM_LINGERING_POTION = 441, + E_ITEM_SHIELD = 442, + E_ITEM_ELYTRA = 443, + E_ITEM_SPRUCE_BOAT = 444, + E_ITEM_BIRCH_BOAT = 445, + E_ITEM_JUNGLE_BOAT = 446, + E_ITEM_ACACIA_BOAT = 447, + E_ITEM_DARK_OAK_BOAT = 448, + E_ITEM_TOTEM_OF_UNDYING = 449, + E_ITEM_SHULKER_SHELL = 450, + E_ITEM_IRON_NUGGET = 452, // Keep these two as the last values of the consecutive list, without a number - they will get their correct number assigned automagically by C++ // IsValidItem() depends on this! @@ -928,6 +966,7 @@ enum E_META_HEAD_ZOMBIE = 2, E_META_HEAD_PLAYER = 3, E_META_HEAD_CREEPER = 4, + E_META_HEAD_DRAGON = 5, // E_ITEM_RAW_FISH metas: E_META_RAW_FISH_FISH = 0, diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp index 7fb6cf567..7a4e87356 100644 --- a/src/BlockInfo.cpp +++ b/src/BlockInfo.cpp @@ -32,11 +32,13 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_DRAGON_EGG ].m_LightValue = 1; a_Info[E_BLOCK_END_PORTAL ].m_LightValue = 15; a_Info[E_BLOCK_END_PORTAL_FRAME ].m_LightValue = 1; + a_Info[E_BLOCK_END_ROD ].m_LightValue = 14; a_Info[E_BLOCK_ENDER_CHEST ].m_LightValue = 7; a_Info[E_BLOCK_FIRE ].m_LightValue = 15; a_Info[E_BLOCK_GLOWSTONE ].m_LightValue = 15; a_Info[E_BLOCK_JACK_O_LANTERN ].m_LightValue = 15; a_Info[E_BLOCK_LAVA ].m_LightValue = 15; + a_Info[E_BLOCK_MAGMA ].m_LightValue = 3; a_Info[E_BLOCK_NETHER_PORTAL ].m_LightValue = 11; a_Info[E_BLOCK_REDSTONE_LAMP_ON ].m_LightValue = 15; a_Info[E_BLOCK_REDSTONE_ORE_GLOWING].m_LightValue = 9; @@ -58,6 +60,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_BARRIER ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_BEACON ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_BED ].m_SpreadLightFalloff = 1; + a_Info[E_BLOCK_BEETROOTS ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_BIG_FLOWER ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_BIRCH_DOOR ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_BIRCH_FENCE ].m_SpreadLightFalloff = 1; @@ -69,6 +72,8 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_CARPET ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_CARROTS ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_CAULDRON ].m_SpreadLightFalloff = 1; + a_Info[E_BLOCK_CHORUS_FLOWER ].m_SpreadLightFalloff = 1; + a_Info[E_BLOCK_CHORUS_PLANT ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_CHEST ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_COBBLESTONE_WALL ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_COCOA_POD ].m_SpreadLightFalloff = 1; @@ -86,6 +91,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_ENDER_CHEST ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_END_PORTAL ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_END_PORTAL_FRAME ].m_SpreadLightFalloff = 1; + a_Info[E_BLOCK_END_ROD ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_FARMLAND ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_FENCE ].m_SpreadLightFalloff = 1; a_Info[E_BLOCK_OAK_FENCE_GATE ].m_SpreadLightFalloff = 1; @@ -180,7 +186,11 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_BIRCH_DOOR ].m_Transparent = true; a_Info[E_BLOCK_BIRCH_FENCE ].m_Transparent = true; a_Info[E_BLOCK_BIRCH_FENCE_GATE ].m_Transparent = true; + a_Info[E_BLOCK_BLACK_SHULKER_BOX ].m_Transparent = true; + a_Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_Transparent = true; + a_Info[E_BLOCK_BLUE_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_BROWN_MUSHROOM ].m_Transparent = true; + a_Info[E_BLOCK_BROWN_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_BREWING_STAND ].m_Transparent = true; a_Info[E_BLOCK_CACTUS ].m_Transparent = true; a_Info[E_BLOCK_CAKE ].m_Transparent = true; @@ -192,6 +202,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_COCOA_POD ].m_Transparent = true; a_Info[E_BLOCK_COBWEB ].m_Transparent = true; a_Info[E_BLOCK_CROPS ].m_Transparent = true; + a_Info[E_BLOCK_CYAN_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_DANDELION ].m_Transparent = true; a_Info[E_BLOCK_DARK_OAK_DOOR ].m_Transparent = true; a_Info[E_BLOCK_DARK_OAK_FENCE ].m_Transparent = true; @@ -204,6 +215,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_ENDER_CHEST ].m_Transparent = true; a_Info[E_BLOCK_END_PORTAL ].m_Transparent = true; a_Info[E_BLOCK_END_PORTAL_FRAME ].m_Transparent = true; + a_Info[E_BLOCK_FARMLAND ].m_Transparent = true; a_Info[E_BLOCK_FENCE ].m_Transparent = true; a_Info[E_BLOCK_OAK_FENCE_GATE ].m_Transparent = true; a_Info[E_BLOCK_FIRE ].m_Transparent = true; @@ -211,6 +223,8 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_FLOWER_POT ].m_Transparent = true; a_Info[E_BLOCK_GLASS ].m_Transparent = true; a_Info[E_BLOCK_GLASS_PANE ].m_Transparent = true; + a_Info[E_BLOCK_GLOWSTONE ].m_Transparent = true; + a_Info[E_BLOCK_GRAY_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_HEAD ].m_Transparent = true; a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_Transparent = true; a_Info[E_BLOCK_HOPPER ].m_Transparent = true; @@ -219,6 +233,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_IRON_BARS ].m_Transparent = true; a_Info[E_BLOCK_IRON_DOOR ].m_Transparent = true; a_Info[E_BLOCK_IRON_TRAPDOOR ].m_Transparent = true; + a_Info[E_BLOCK_JACK_O_LANTERN ].m_Transparent = true; a_Info[E_BLOCK_JUNGLE_DOOR ].m_Transparent = true; a_Info[E_BLOCK_JUNGLE_FENCE ].m_Transparent = true; a_Info[E_BLOCK_JUNGLE_FENCE_GATE ].m_Transparent = true; @@ -227,22 +242,33 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_LEAVES ].m_Transparent = true; a_Info[E_BLOCK_LEVER ].m_Transparent = true; a_Info[E_BLOCK_LILY_PAD ].m_Transparent = true; + a_Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX].m_Transparent = true; + a_Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX].m_Transparent = true; a_Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_Transparent = true; + a_Info[E_BLOCK_LIME_SHULKER_BOX ].m_Transparent = true; + a_Info[E_BLOCK_LIT_FURNACE ].m_Transparent = true; + a_Info[E_BLOCK_MAGENTA_SHULKER_BOX].m_Transparent = true; a_Info[E_BLOCK_MELON_STEM ].m_Transparent = true; a_Info[E_BLOCK_MOB_SPAWNER ].m_Transparent = true; a_Info[E_BLOCK_NETHER_BRICK_FENCE ].m_Transparent = true; a_Info[E_BLOCK_NETHER_PORTAL ].m_Transparent = true; a_Info[E_BLOCK_NETHER_WART ].m_Transparent = true; a_Info[E_BLOCK_NEW_LEAVES ].m_Transparent = true; - a_Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_Transparent = true; + a_Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_Transparent = true; + a_Info[E_BLOCK_PINK_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_PISTON ].m_Transparent = true; a_Info[E_BLOCK_PISTON_EXTENSION ].m_Transparent = true; a_Info[E_BLOCK_PISTON_MOVED_BLOCK ].m_Transparent = true; a_Info[E_BLOCK_POTATOES ].m_Transparent = true; a_Info[E_BLOCK_POWERED_RAIL ].m_Transparent = true; a_Info[E_BLOCK_PUMPKIN_STEM ].m_Transparent = true; + a_Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_Transparent = true; + a_Info[E_BLOCK_PURPUR_SLAB ].m_Transparent = true; a_Info[E_BLOCK_RAIL ].m_Transparent = true; a_Info[E_BLOCK_RED_MUSHROOM ].m_Transparent = true; + a_Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_Transparent = true; + a_Info[E_BLOCK_RED_SHULKER_BOX ].m_Transparent = true; + a_Info[E_BLOCK_REDSTONE_ORE_GLOWING].m_Transparent = true; a_Info[E_BLOCK_REDSTONE_REPEATER_OFF].m_Transparent = true; a_Info[E_BLOCK_REDSTONE_REPEATER_ON].m_Transparent = true; a_Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_Transparent = true; @@ -273,20 +299,24 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_WALL_BANNER ].m_Transparent = true; a_Info[E_BLOCK_WALLSIGN ].m_Transparent = true; a_Info[E_BLOCK_WATER ].m_Transparent = true; + a_Info[E_BLOCK_WHITE_SHULKER_BOX ].m_Transparent = true; a_Info[E_BLOCK_WOODEN_BUTTON ].m_Transparent = true; a_Info[E_BLOCK_OAK_DOOR ].m_Transparent = true; a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE].m_Transparent = true; a_Info[E_BLOCK_WOODEN_SLAB ].m_Transparent = true; + a_Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_Transparent = true; // One hit break blocks: a_Info[E_BLOCK_ACTIVE_COMPARATOR ].m_OneHitDig = true; + a_Info[E_BLOCK_BEETROOTS ].m_OneHitDig = true; a_Info[E_BLOCK_BIG_FLOWER ].m_OneHitDig = true; a_Info[E_BLOCK_BROWN_MUSHROOM ].m_OneHitDig = true; a_Info[E_BLOCK_CARROTS ].m_OneHitDig = true; a_Info[E_BLOCK_CROPS ].m_OneHitDig = true; a_Info[E_BLOCK_DANDELION ].m_OneHitDig = true; a_Info[E_BLOCK_DEAD_BUSH ].m_OneHitDig = true; + a_Info[E_BLOCK_END_ROD ].m_OneHitDig = true; a_Info[E_BLOCK_FIRE ].m_OneHitDig = true; a_Info[E_BLOCK_FLOWER ].m_OneHitDig = true; a_Info[E_BLOCK_FLOWER_POT ].m_OneHitDig = true; @@ -316,42 +346,58 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_AIR ].m_PistonBreakable = true; a_Info[E_BLOCK_BED ].m_PistonBreakable = true; a_Info[E_BLOCK_BIG_FLOWER ].m_PistonBreakable = true; + a_Info[E_BLOCK_BLACK_SHULKER_BOX ].m_PistonBreakable = true; + a_Info[E_BLOCK_BLUE_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_BROWN_MUSHROOM ].m_PistonBreakable = true; + a_Info[E_BLOCK_BROWN_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_CACTUS ].m_PistonBreakable = true; a_Info[E_BLOCK_CAKE ].m_PistonBreakable = true; a_Info[E_BLOCK_CARROTS ].m_PistonBreakable = true; + a_Info[E_BLOCK_CHORUS_FLOWER ].m_PistonBreakable = true; + a_Info[E_BLOCK_CHORUS_PLANT ].m_PistonBreakable = true; a_Info[E_BLOCK_COCOA_POD ].m_PistonBreakable = true; a_Info[E_BLOCK_COBWEB ].m_PistonBreakable = true; a_Info[E_BLOCK_CROPS ].m_PistonBreakable = true; + a_Info[E_BLOCK_CYAN_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_DANDELION ].m_PistonBreakable = true; a_Info[E_BLOCK_DEAD_BUSH ].m_PistonBreakable = true; a_Info[E_BLOCK_DRAGON_EGG ].m_PistonBreakable = true; a_Info[E_BLOCK_FIRE ].m_PistonBreakable = true; a_Info[E_BLOCK_FLOWER ].m_PistonBreakable = true; a_Info[E_BLOCK_FLOWER_POT ].m_PistonBreakable = true; + a_Info[E_BLOCK_GRAY_SHULKER_BOX ].m_PistonBreakable = true; + a_Info[E_BLOCK_GREEN_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_HEAD ].m_PistonBreakable = true; a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_PistonBreakable = true; a_Info[E_BLOCK_INACTIVE_COMPARATOR ].m_PistonBreakable = true; a_Info[E_BLOCK_IRON_DOOR ].m_PistonBreakable = true; a_Info[E_BLOCK_IRON_TRAPDOOR ].m_PistonBreakable = true; a_Info[E_BLOCK_JACK_O_LANTERN ].m_PistonBreakable = true; + a_Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX].m_PistonBreakable = true; + a_Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX].m_PistonBreakable = true; a_Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_PistonBreakable = true; a_Info[E_BLOCK_LILY_PAD ].m_PistonBreakable = true; + a_Info[E_BLOCK_LIME_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_LADDER ].m_PistonBreakable = true; a_Info[E_BLOCK_LAVA ].m_PistonBreakable = true; a_Info[E_BLOCK_LEVER ].m_PistonBreakable = true; + a_Info[E_BLOCK_MAGENTA_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_MELON ].m_PistonBreakable = true; a_Info[E_BLOCK_MELON_STEM ].m_PistonBreakable = true; a_Info[E_BLOCK_NETHER_WART ].m_PistonBreakable = true; + a_Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_PistonBreakable = true; + a_Info[E_BLOCK_PINK_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_POTATOES ].m_PistonBreakable = true; a_Info[E_BLOCK_PUMPKIN ].m_PistonBreakable = true; a_Info[E_BLOCK_PUMPKIN_STEM ].m_PistonBreakable = true; + a_Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_REDSTONE_REPEATER_OFF].m_PistonBreakable = true; a_Info[E_BLOCK_REDSTONE_REPEATER_ON].m_PistonBreakable = true; a_Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_PistonBreakable = true; a_Info[E_BLOCK_REDSTONE_TORCH_ON ].m_PistonBreakable = true; a_Info[E_BLOCK_REDSTONE_WIRE ].m_PistonBreakable = true; a_Info[E_BLOCK_RED_MUSHROOM ].m_PistonBreakable = true; + a_Info[E_BLOCK_RED_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_REEDS ].m_PistonBreakable = true; a_Info[E_BLOCK_SAPLING ].m_PistonBreakable = true; a_Info[E_BLOCK_SIGN_POST ].m_PistonBreakable = true; @@ -368,17 +414,21 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_VINES ].m_PistonBreakable = true; a_Info[E_BLOCK_WALLSIGN ].m_PistonBreakable = true; a_Info[E_BLOCK_WATER ].m_PistonBreakable = true; + a_Info[E_BLOCK_WHITE_SHULKER_BOX ].m_PistonBreakable = true; a_Info[E_BLOCK_WOODEN_BUTTON ].m_PistonBreakable = true; a_Info[E_BLOCK_OAK_DOOR ].m_PistonBreakable = true; a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE].m_PistonBreakable = true; + a_Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_PistonBreakable = true; // Blocks that can be snowed over: a_Info[E_BLOCK_BEDROCK ].m_IsSnowable = true; a_Info[E_BLOCK_BLOCK_OF_COAL ].m_IsSnowable = true; a_Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_IsSnowable = true; + a_Info[E_BLOCK_BONE_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_BOOKCASE ].m_IsSnowable = true; a_Info[E_BLOCK_BRICK ].m_IsSnowable = true; + a_Info[E_BLOCK_CHAIN_COMMAND_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_CLAY ].m_IsSnowable = true; a_Info[E_BLOCK_CRAFTING_TABLE ].m_IsSnowable = true; a_Info[E_BLOCK_COAL_ORE ].m_IsSnowable = true; @@ -394,6 +444,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_DROPPER ].m_IsSnowable = true; a_Info[E_BLOCK_EMERALD_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_EMERALD_ORE ].m_IsSnowable = true; + a_Info[E_BLOCK_END_BRICKS ].m_IsSnowable = true; a_Info[E_BLOCK_END_STONE ].m_IsSnowable = true; a_Info[E_BLOCK_FURNACE ].m_IsSnowable = true; a_Info[E_BLOCK_GLOWSTONE ].m_IsSnowable = true; @@ -419,20 +470,27 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_MYCELIUM ].m_IsSnowable = true; a_Info[E_BLOCK_NETHER_BRICK ].m_IsSnowable = true; a_Info[E_BLOCK_NETHER_QUARTZ_ORE ].m_IsSnowable = true; + a_Info[E_BLOCK_NETHER_WART_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_NETHERRACK ].m_IsSnowable = true; a_Info[E_BLOCK_NEW_LEAVES ].m_IsSnowable = true; a_Info[E_BLOCK_NEW_LOG ].m_IsSnowable = true; a_Info[E_BLOCK_NOTE_BLOCK ].m_IsSnowable = true; + a_Info[E_BLOCK_OBSERVER ].m_IsSnowable = true; a_Info[E_BLOCK_OBSIDIAN ].m_IsSnowable = true; a_Info[E_BLOCK_PLANKS ].m_IsSnowable = true; a_Info[E_BLOCK_PRISMARINE_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_PUMPKIN ].m_IsSnowable = true; + a_Info[E_BLOCK_PURPUR_BLOCK ].m_IsSnowable = true; + a_Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_IsSnowable = true; + a_Info[E_BLOCK_PURPUR_PILLAR ].m_IsSnowable = true; a_Info[E_BLOCK_QUARTZ_BLOCK ].m_IsSnowable = true; + a_Info[E_BLOCK_RED_NETHER_BRICK ].m_IsSnowable = true; a_Info[E_BLOCK_RED_SANDSTONE ].m_IsSnowable = true; a_Info[E_BLOCK_REDSTONE_LAMP_OFF ].m_IsSnowable = true; a_Info[E_BLOCK_REDSTONE_LAMP_ON ].m_IsSnowable = true; a_Info[E_BLOCK_REDSTONE_ORE ].m_IsSnowable = true; a_Info[E_BLOCK_REDSTONE_ORE_GLOWING].m_IsSnowable = true; + a_Info[E_BLOCK_REPEATING_COMMAND_BLOCK].m_IsSnowable = true; a_Info[E_BLOCK_SAND ].m_IsSnowable = true; a_Info[E_BLOCK_SANDSTONE ].m_IsSnowable = true; a_Info[E_BLOCK_SEA_LANTERN ].m_IsSnowable = true; @@ -443,6 +501,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_STAINED_CLAY ].m_IsSnowable = true; a_Info[E_BLOCK_STONE ].m_IsSnowable = true; a_Info[E_BLOCK_STONE_BRICKS ].m_IsSnowable = true; + a_Info[E_BLOCK_STRUCTURE_BLOCK ].m_IsSnowable = true; a_Info[E_BLOCK_TNT ].m_IsSnowable = true; a_Info[E_BLOCK_WOOL ].m_IsSnowable = true; @@ -452,11 +511,15 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_BIG_FLOWER ].m_IsSolid = false; a_Info[E_BLOCK_BROWN_MUSHROOM ].m_IsSolid = false; a_Info[E_BLOCK_CARROTS ].m_IsSolid = false; + a_Info[E_BLOCK_CHORUS_PLANT ].m_IsSolid = false; + a_Info[E_BLOCK_CHORUS_FLOWER ].m_IsSolid = false; a_Info[E_BLOCK_COBWEB ].m_IsSolid = false; a_Info[E_BLOCK_CROPS ].m_IsSolid = false; a_Info[E_BLOCK_DANDELION ].m_IsSolid = false; a_Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false; + a_Info[E_BLOCK_END_GATEWAY ].m_IsSolid = false; a_Info[E_BLOCK_END_PORTAL ].m_IsSolid = false; + a_Info[E_BLOCK_END_ROD ].m_IsSolid = false; a_Info[E_BLOCK_FIRE ].m_IsSolid = false; a_Info[E_BLOCK_FLOWER ].m_IsSolid = false; a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false; @@ -506,8 +569,10 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_BEDROCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_BLOCK_OF_COAL ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_BONE_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_BOOKCASE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_BRICK ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_CHAIN_COMMAND_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_CLAY ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_COAL_ORE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_COBBLESTONE ].m_FullyOccupiesVoxel = true; @@ -517,12 +582,15 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_DIAMOND_ORE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_DIRT ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_DISPENSER ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_DROPPER ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_EMERALD_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_EMERALD_ORE ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_END_BRICKS ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_END_STONE ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_FROSTED_ICE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_FURNACE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_GLOWSTONE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_GOLD_BLOCK ].m_FullyOccupiesVoxel = true; @@ -541,6 +609,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_LAPIS_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_LAPIS_ORE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_LOG ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_MAGMA ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_MELON ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_MOB_SPAWNER ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_MOSSY_COBBLESTONE ].m_FullyOccupiesVoxel = true; @@ -548,19 +617,26 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_NETHERRACK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_NETHER_BRICK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_NETHER_QUARTZ_ORE ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_NETHER_WART_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_NEW_LOG ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_NOTE_BLOCK ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_OBSERVER ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_OBSIDIAN ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_PACKED_ICE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_PLANKS ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_PRISMARINE_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_PUMPKIN ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_PURPUR_BLOCK ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_PURPUR_PILLAR ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_QUARTZ_BLOCK ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_RED_NETHER_BRICK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_RED_SANDSTONE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_REDSTONE_LAMP_OFF ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_REDSTONE_LAMP_ON ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_REDSTONE_ORE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_REDSTONE_ORE_GLOWING].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_REPEATING_COMMAND_BLOCK].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_SANDSTONE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_SAND ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_SILVERFISH_EGG ].m_FullyOccupiesVoxel = true; @@ -568,6 +644,7 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_STAINED_CLAY ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_STONE ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_STONE_BRICKS ].m_FullyOccupiesVoxel = true; + a_Info[E_BLOCK_STRUCTURE_BLOCK ].m_FullyOccupiesVoxel = true; a_Info[E_BLOCK_WOOL ].m_FullyOccupiesVoxel = true; @@ -596,6 +673,8 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_BED ].m_BlockHeight = 0.5625; // 9 pixels a_Info[E_BLOCK_CAKE ].m_BlockHeight = 0.5; // 8 pixels a_Info[E_BLOCK_ENCHANTMENT_TABLE ].m_BlockHeight = 0.75; // 12 pixels + a_Info[E_BLOCK_PURPUR_SLAB ].m_BlockHeight = 0.5; + a_Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_BlockHeight = 0.5; a_Info[E_BLOCK_STONE_SLAB ].m_BlockHeight = 0.5; a_Info[E_BLOCK_WOODEN_SLAB ].m_BlockHeight = 0.5; a_Info[E_BLOCK_SNOW ].m_BlockHeight = 0.125; // one layer is 1 / 8 (2 pixels) tall @@ -803,6 +882,8 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_ACACIA_DOOR ].m_PlaceSound = "dig.wood"; a_Info[E_BLOCK_DARK_OAK_DOOR ].m_PlaceSound = "dig.wood"; + + // Block hardness: a_Info[E_BLOCK_AIR ].m_Hardness = 0.0f; a_Info[E_BLOCK_STONE ].m_Hardness = 1.5f; a_Info[E_BLOCK_GRASS ].m_Hardness = 0.6f; @@ -1001,6 +1082,45 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_JUNGLE_DOOR ].m_Hardness = 3.0f; a_Info[E_BLOCK_ACACIA_DOOR ].m_Hardness = 3.0f; a_Info[E_BLOCK_DARK_OAK_DOOR ].m_Hardness = 3.0f; + a_Info[E_BLOCK_END_ROD ].m_Hardness = 0.0f; + a_Info[E_BLOCK_CHORUS_PLANT ].m_Hardness = 0.4f; + a_Info[E_BLOCK_CHORUS_FLOWER ].m_Hardness = 0.4f; + a_Info[E_BLOCK_PURPUR_BLOCK ].m_Hardness = 1.5f; + a_Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_Hardness = 2.0f; + a_Info[E_BLOCK_PURPUR_PILLAR ].m_Hardness = 1.5f; + a_Info[E_BLOCK_PURPUR_SLAB ].m_Hardness = 2.0f; + a_Info[E_BLOCK_PURPUR_STAIRS ].m_Hardness = 1.5f; + a_Info[E_BLOCK_END_BRICKS ].m_Hardness = 0.8f; + a_Info[E_BLOCK_BEETROOTS ].m_Hardness = 0.0f; + a_Info[E_BLOCK_GRASS_PATH ].m_Hardness = 0.6f; + a_Info[E_BLOCK_END_GATEWAY ].m_Hardness = -1.0f; + a_Info[E_BLOCK_REPEATING_COMMAND_BLOCK].m_Hardness = -1.0f; + a_Info[E_BLOCK_CHAIN_COMMAND_BLOCK ].m_Hardness = -1.0f; + a_Info[E_BLOCK_FROSTED_ICE ].m_Hardness = 0.5f; + a_Info[E_BLOCK_MAGMA ].m_Hardness = 0.5f; + a_Info[E_BLOCK_NETHER_WART_BLOCK ].m_Hardness = 1.0f; + a_Info[E_BLOCK_RED_NETHER_BRICK ].m_Hardness = 2.0f; + a_Info[E_BLOCK_BONE_BLOCK ].m_Hardness = 2.0f; + a_Info[E_BLOCK_END_BRICKS ].m_Hardness = 0.8f; + a_Info[E_BLOCK_STRUCTURE_VOID ].m_Hardness = 0.0f; + a_Info[E_BLOCK_OBSERVER ].m_Hardness = 3.5f; + a_Info[E_BLOCK_WHITE_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_MAGENTA_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX].m_Hardness = 0.2f; + a_Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_LIME_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_PINK_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_GRAY_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX].m_Hardness = 0.2f; + a_Info[E_BLOCK_CYAN_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_BLUE_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_BROWN_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_GREEN_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_RED_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_BLACK_SHULKER_BOX ].m_Hardness = 0.2f; + a_Info[E_BLOCK_STRUCTURE_BLOCK ].m_Hardness = -1.0f; } diff --git a/src/Blocks/BlockCrops.h b/src/Blocks/BlockCrops.h index cc18a2b18..4ea94cf86 100644 --- a/src/Blocks/BlockCrops.h +++ b/src/Blocks/BlockCrops.h @@ -8,7 +8,8 @@ -/** Common class that takes care of carrots, potatoes and wheat */ +/** Common class that takes care of beetroots, carrots, potatoes and wheat */ +template class cBlockCropsHandler : public cBlockPlant { @@ -23,11 +24,20 @@ public: { cFastRandom rand; - if (a_Meta == 0x7) + // Beetroots have three stages before fully grown + if (a_Meta >= RipeMeta) { // Is fully grown, drop the entire produce: switch (m_BlockType) { + case E_BLOCK_BEETROOTS: + { + char SeedCount = static_cast(1 + (rand.NextInt(3) + rand.NextInt(3)) / 2); + a_Pickups.push_back(cItem(E_ITEM_BEETROOT_SEEDS, SeedCount, 0)); + char BeetrootCount = static_cast(1 + (rand.NextInt(3) + rand.NextInt(3)) / 2); + a_Pickups.push_back(cItem(E_ITEM_BEETROOT, BeetrootCount, 0)); // [1 .. 3] with high preference of 2 + break; + } case E_BLOCK_CROPS: { a_Pickups.push_back(cItem(E_ITEM_WHEAT, 1, 0)); @@ -61,9 +71,10 @@ public: // Drop 1 item of whatever is growing switch (m_BlockType) { - case E_BLOCK_CROPS: a_Pickups.push_back(cItem(E_ITEM_SEEDS, 1, 0)); break; - case E_BLOCK_CARROTS: a_Pickups.push_back(cItem(E_ITEM_CARROT, 1, 0)); break; - case E_BLOCK_POTATOES: a_Pickups.push_back(cItem(E_ITEM_POTATO, 1, 0)); break; + case E_BLOCK_BEETROOTS: a_Pickups.push_back(cItem(E_ITEM_BEETROOT_SEEDS, 1, 0)); break; + case E_BLOCK_CROPS: a_Pickups.push_back(cItem(E_ITEM_SEEDS, 1, 0)); break; + case E_BLOCK_CARROTS: a_Pickups.push_back(cItem(E_ITEM_CARROT, 1, 0)); break; + case E_BLOCK_POTATOES: a_Pickups.push_back(cItem(E_ITEM_POTATO, 1, 0)); break; default: { ASSERT(!"Unhandled block type"); @@ -82,7 +93,7 @@ public: // If there is still room to grow and the plant can grow, then grow. // Otherwise if the plant needs to die, then dig it up - if ((Meta < 7) && (Action == paGrowth)) + if ((Meta < RipeMeta) && (Action == paGrowth)) { a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, m_BlockType, ++Meta); } diff --git a/src/Blocks/BlockFarmland.h b/src/Blocks/BlockFarmland.h index ddbd79335..7efd062d5 100644 --- a/src/Blocks/BlockFarmland.h +++ b/src/Blocks/BlockFarmland.h @@ -48,6 +48,7 @@ public: BLOCKTYPE UpperBlock = (a_RelY >= cChunkDef::Height - 1) ? static_cast(E_BLOCK_AIR) : a_Chunk.GetBlock(a_RelX, a_RelY + 1, a_RelZ); switch (UpperBlock) { + case E_BLOCK_BEETROOTS: case E_BLOCK_CROPS: case E_BLOCK_POTATOES: case E_BLOCK_CARROTS: @@ -131,6 +132,7 @@ public: virtual bool CanSustainPlant(BLOCKTYPE a_Plant) override { return ( + (a_Plant == E_BLOCK_BEETROOTS) || (a_Plant == E_BLOCK_CROPS) || (a_Plant == E_BLOCK_CARROTS) || (a_Plant == E_BLOCK_POTATOES) || diff --git a/src/Blocks/BlockFluid.h b/src/Blocks/BlockFluid.h index df51fb104..0a8b34145 100644 --- a/src/Blocks/BlockFluid.h +++ b/src/Blocks/BlockFluid.h @@ -61,6 +61,7 @@ public: virtual bool CanSustainPlant(BLOCKTYPE a_Plant) override { return ( + (a_Plant == E_BLOCK_BEETROOTS) || (a_Plant == E_BLOCK_CROPS) || (a_Plant == E_BLOCK_CARROTS) || (a_Plant == E_BLOCK_POTATOES) || diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index be254900d..028fdbfbd 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -187,6 +187,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_ANVIL: return new cBlockAnvilHandler (a_BlockType); case E_BLOCK_BEACON: return new cBlockEntityHandler (a_BlockType); case E_BLOCK_BED: return new cBlockBedHandler (a_BlockType); + case E_BLOCK_BEETROOTS: return new cBlockCropsHandler<4> (a_BlockType); // 4 stages of growth case E_BLOCK_BIG_FLOWER: return new cBlockBigFlowerHandler (a_BlockType); case E_BLOCK_BIRCH_DOOR: return new cBlockDoorHandler (a_BlockType); case E_BLOCK_BIRCH_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); @@ -196,9 +197,10 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_BROWN_MUSHROOM: return new cBlockMushroomHandler (a_BlockType); case E_BLOCK_CACTUS: return new cBlockCactusHandler (a_BlockType); case E_BLOCK_CAKE: return new cBlockCakeHandler (a_BlockType); - case E_BLOCK_CARROTS: return new cBlockCropsHandler (a_BlockType); + case E_BLOCK_CARROTS: return new cBlockCropsHandler<8> (a_BlockType); // 8 stages of growth case E_BLOCK_CARPET: return new cBlockCarpetHandler (a_BlockType); case E_BLOCK_CAULDRON: return new cBlockCauldronHandler (a_BlockType); + case E_BLOCK_CHAIN_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType); case E_BLOCK_CHEST: return new cBlockChestHandler (a_BlockType); case E_BLOCK_CLAY: return new cBlockOreHandler (a_BlockType); case E_BLOCK_COAL_ORE: return new cBlockOreHandler (a_BlockType); @@ -208,7 +210,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_COBBLESTONE: return new cBlockStoneHandler (a_BlockType); case E_BLOCK_COBBLESTONE_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_COBWEB: return new cBlockCobWebHandler (a_BlockType); - case E_BLOCK_CROPS: return new cBlockCropsHandler (a_BlockType); + case E_BLOCK_CROPS: return new cBlockCropsHandler<8> (a_BlockType); // 8 stages of growth case E_BLOCK_DARK_OAK_DOOR: return new cBlockDoorHandler (a_BlockType); case E_BLOCK_DARK_OAK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); case E_BLOCK_DARK_OAK_WOOD_STAIRS: return new cBlockStairsHandler (a_BlockType); @@ -225,7 +227,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_ENCHANTMENT_TABLE: return new cBlockEnchantmentTableHandler(a_BlockType); case E_BLOCK_ENDER_CHEST: return new cBlockEnderchestHandler (a_BlockType); case E_BLOCK_FARMLAND: return new cBlockFarmlandHandler (a_BlockType); - case E_BLOCK_OAK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); + case E_BLOCK_FROSTED_ICE: return new cBlockIceHandler (a_BlockType); case E_BLOCK_FIRE: return new cBlockFireHandler (a_BlockType); case E_BLOCK_FLOWER_POT: return new cBlockFlowerPotHandler (a_BlockType); case E_BLOCK_FURNACE: return new cBlockFurnaceHandler (a_BlockType); @@ -271,13 +273,18 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_NEW_LOG: return new cBlockSidewaysHandler (a_BlockType); case E_BLOCK_RED_SANDSTONE_SLAB: return new cBlockSlabHandler (a_BlockType); case E_BLOCK_NOTE_BLOCK: return new cBlockEntityHandler (a_BlockType); + case E_BLOCK_OAK_FENCE_GATE: return new cBlockFenceGateHandler (a_BlockType); + case E_BLOCK_PACKED_ICE: return new cBlockIceHandler (a_BlockType); case E_BLOCK_PISTON: return new cBlockPistonHandler (a_BlockType); case E_BLOCK_PISTON_EXTENSION: return new cBlockPistonHeadHandler; case E_BLOCK_PLANKS: return new cBlockPlanksHandler (a_BlockType); - case E_BLOCK_POTATOES: return new cBlockCropsHandler (a_BlockType); + case E_BLOCK_POTATOES: return new cBlockCropsHandler<8> (a_BlockType); // 8 stages of growth case E_BLOCK_POWERED_RAIL: return new cBlockRailHandler (a_BlockType); case E_BLOCK_PUMPKIN: return new cBlockPumpkinHandler (a_BlockType); case E_BLOCK_PUMPKIN_STEM: return new cBlockStemsHandler (a_BlockType); + case E_BLOCK_PURPUR_DOUBLE_SLAB: return new cBlockDoubleSlabHandler (a_BlockType); + case E_BLOCK_PURPUR_SLAB: return new cBlockSlabHandler (a_BlockType); + case E_BLOCK_PURPUR_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_QUARTZ_BLOCK: return new cBlockQuartzHandler (a_BlockType); case E_BLOCK_QUARTZ_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_RAIL: return new cBlockRailHandler (a_BlockType); @@ -292,6 +299,7 @@ cBlockHandler * cBlockHandler::CreateBlockHandler(BLOCKTYPE a_BlockType) case E_BLOCK_REDSTONE_WIRE: return new cBlockRedstoneHandler (a_BlockType); case E_BLOCK_RED_MUSHROOM: return new cBlockMushroomHandler (a_BlockType); case E_BLOCK_RED_ROSE: return new cBlockFlowerHandler (a_BlockType); + case E_BLOCK_REPEATING_COMMAND_BLOCK: return new cBlockCommandBlockHandler (a_BlockType); case E_BLOCK_SAND: return new cBlockSandHandler (a_BlockType); case E_BLOCK_SANDSTONE_STAIRS: return new cBlockStairsHandler (a_BlockType); case E_BLOCK_SAPLING: return new cBlockSaplingHandler (a_BlockType); @@ -456,6 +464,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac case E_BLOCK_ACACIA_DOOR: case E_BLOCK_ACTIVE_COMPARATOR: case E_BLOCK_BED: + case E_BLOCK_BEETROOTS: case E_BLOCK_BIRCH_DOOR: case E_BLOCK_BREWING_STAND: case E_BLOCK_CAKE: @@ -482,6 +491,7 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac case E_BLOCK_PISTON_EXTENSION: case E_BLOCK_POTATOES: case E_BLOCK_PUMPKIN_STEM: + case E_BLOCK_PURPUR_DOUBLE_SLAB: case E_BLOCK_REDSTONE_ORE_GLOWING: case E_BLOCK_REDSTONE_REPEATER_OFF: case E_BLOCK_REDSTONE_REPEATER_ON: diff --git a/src/Blocks/BlockPiston.h b/src/Blocks/BlockPiston.h index 18b688256..e1445c21c 100644 --- a/src/Blocks/BlockPiston.h +++ b/src/Blocks/BlockPiston.h @@ -113,12 +113,14 @@ private: case E_BLOCK_BEACON: case E_BLOCK_BEDROCK: case E_BLOCK_BREWING_STAND: + case E_BLOCK_CHAIN_COMMAND_BLOCK: case E_BLOCK_CHEST: case E_BLOCK_COMMAND_BLOCK: case E_BLOCK_DAYLIGHT_SENSOR: case E_BLOCK_DISPENSER: case E_BLOCK_DROPPER: case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_GATEWAY: case E_BLOCK_END_PORTAL: case E_BLOCK_END_PORTAL_FRAME: // Notice the lack of an E_BLOCK_ENDER_CHEST here; its because ender chests can totally be pushed / pulled in MCS :) @@ -132,7 +134,9 @@ private: case E_BLOCK_NOTE_BLOCK: case E_BLOCK_OBSIDIAN: case E_BLOCK_PISTON_EXTENSION: + case E_BLOCK_REPEATING_COMMAND_BLOCK: case E_BLOCK_STANDING_BANNER: + case E_BLOCK_STRUCTURE_BLOCK: case E_BLOCK_TRAPPED_CHEST: case E_BLOCK_WALL_BANNER: { diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h index c75dee50d..01e9e701d 100644 --- a/src/Blocks/BlockSlab.h +++ b/src/Blocks/BlockSlab.h @@ -88,7 +88,12 @@ public: /** Returns true if the specified blocktype is one of the slabs handled by this handler */ static bool IsAnySlabType(BLOCKTYPE a_BlockType) { - return ((a_BlockType == E_BLOCK_WOODEN_SLAB) || (a_BlockType == E_BLOCK_STONE_SLAB) || (a_BlockType == E_BLOCK_RED_SANDSTONE_SLAB)); + return ( + (a_BlockType == E_BLOCK_WOODEN_SLAB) || + (a_BlockType == E_BLOCK_STONE_SLAB) || + (a_BlockType == E_BLOCK_RED_SANDSTONE_SLAB) || + (a_BlockType == E_BLOCK_PURPUR_SLAB) + ); } virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override @@ -110,6 +115,7 @@ public: case E_BLOCK_STONE_SLAB: return E_BLOCK_DOUBLE_STONE_SLAB; case E_BLOCK_WOODEN_SLAB: return E_BLOCK_DOUBLE_WOODEN_SLAB; case E_BLOCK_RED_SANDSTONE_SLAB: return E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB; + case E_BLOCK_PURPUR_SLAB: return E_BLOCK_PURPUR_DOUBLE_SLAB; } ASSERT(!"Unhandled slab type!"); return E_BLOCK_AIR; @@ -167,6 +173,10 @@ public: { return 10; } + case E_BLOCK_PURPUR_SLAB: + { + return 16; + } default: { ASSERT(!"Unhandled blocktype in slab handler!"); @@ -211,6 +221,7 @@ public: case E_BLOCK_DOUBLE_STONE_SLAB: return E_BLOCK_STONE_SLAB; case E_BLOCK_DOUBLE_WOODEN_SLAB: return E_BLOCK_WOODEN_SLAB; case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return E_BLOCK_RED_SANDSTONE_SLAB; + case E_BLOCK_PURPUR_DOUBLE_SLAB: return E_BLOCK_PURPUR_SLAB; } ASSERT(!"Unhandled double slab type!"); return a_BlockType; diff --git a/src/Blocks/BlockStairs.h b/src/Blocks/BlockStairs.h index 3d7dd1442..c3d5193e8 100644 --- a/src/Blocks/BlockStairs.h +++ b/src/Blocks/BlockStairs.h @@ -104,6 +104,7 @@ public: case E_BLOCK_STONE_BRICK_STAIRS: return 11; case E_BLOCK_OAK_WOOD_STAIRS: return 13; case E_BLOCK_ACACIA_WOOD_STAIRS: return 15; + case E_BLOCK_PURPUR_STAIRS: return 16; case E_BLOCK_DARK_OAK_WOOD_STAIRS: return 26; case E_BLOCK_BRICK_STAIRS: return 28; case E_BLOCK_NETHER_BRICK_STAIRS: return 35; diff --git a/src/Defines.h b/src/Defines.h index a1de94897..172d5e30d 100644 --- a/src/Defines.h +++ b/src/Defines.h @@ -173,6 +173,7 @@ enum eMobHeadType SKULL_TYPE_ZOMBIE = 2, SKULL_TYPE_PLAYER = 3, SKULL_TYPE_CREEPER = 4, + SKULL_TYPE_DRAGON = 5, } ; @@ -455,9 +456,30 @@ inline bool IsBlockWater(BLOCKTYPE a_BlockType) +inline bool IsBlockIce(BLOCKTYPE a_BlockType) +{ + switch (a_BlockType) + { + case E_BLOCK_ICE: + case E_BLOCK_PACKED_ICE: + case E_BLOCK_FROSTED_ICE: + { + return true; + } + default: + { + return false; + } + } +} + + + + + inline bool IsBlockWaterOrIce(BLOCKTYPE a_BlockType) { - return (IsBlockWater(a_BlockType) || (a_BlockType == E_BLOCK_ICE)); + return (IsBlockWater(a_BlockType) || IsBlockIce(a_BlockType)); } @@ -507,6 +529,7 @@ inline bool IsBlockTypeOfDirt(BLOCKTYPE a_BlockType) case E_BLOCK_DIRT: case E_BLOCK_GRASS: case E_BLOCK_FARMLAND: + case E_BLOCK_GRASS_PATH: { return true; } @@ -832,6 +855,7 @@ inline bool IsBlockMaterialRock(BLOCKTYPE a_BlockType) case E_BLOCK_MAGMA: case E_BLOCK_RED_NETHER_BRICK: case E_BLOCK_BONE_BLOCK: + case E_BLOCK_OBSERVER: { return true; } diff --git a/src/Generating/DungeonRoomsFinisher.cpp b/src/Generating/DungeonRoomsFinisher.cpp index 7ee7f91f0..c1ff763eb 100644 --- a/src/Generating/DungeonRoomsFinisher.cpp +++ b/src/Generating/DungeonRoomsFinisher.cpp @@ -203,6 +203,7 @@ protected: { cItem(E_ITEM_GOLDEN_APPLE), 1, 1, 1 }, { cItem(E_ITEM_DIAMOND_HORSE_ARMOR), 1, 1, 1 }, { cItem(E_ITEM_GOLD_HORSE_ARMOR), 1, 1, 2 }, + { cItem(E_ITEM_GOLD), 1, 4, 2 }, { cItem(E_ITEM_13_DISC), 1, 1, 4 }, { cItem(E_ITEM_CAT_DISC), 1, 1, 4 }, { cItem(E_ITEM_IRON_HORSE_ARMOR), 1, 1, 5 }, @@ -211,10 +212,16 @@ protected: { cItem(E_ITEM_GUNPOWDER), 1, 4, 10 }, { cItem(E_ITEM_STRING), 1, 4, 10 }, { cItem(E_ITEM_REDSTONE_DUST), 1, 4, 10 }, + { cItem(E_ITEM_COAL), 1, 4, 10 }, + { cItem(E_ITEM_BONE), 1, 4, 10 }, + { cItem(E_ITEM_ROTTEN_FLESH), 1, 4, 10 }, { cItem(E_ITEM_SADDLE), 1, 1, 10 }, { cItem(E_ITEM_BUCKET), 1, 1, 10 }, { cItem(E_ITEM_BREAD), 1, 1, 10 }, { cItem(E_ITEM_NAME_TAG), 1, 1, 10 }, + { cItem(E_ITEM_BEETROOT_SEEDS), 2, 4, 10 }, + { cItem(E_ITEM_MELON_SEEDS), 2, 4, 10 }, + { cItem(E_ITEM_PUMPKIN_SEEDS), 2, 4, 10 }, } ; cChestEntity * ChestEntity = static_cast(a_ChunkDesc.GetBlockEntity(RelX, m_FloorHeight + 1, RelZ)); diff --git a/src/Items/ItemFood.h b/src/Items/ItemFood.h index cfdac26c6..d06b4701c 100644 --- a/src/Items/ItemFood.h +++ b/src/Items/ItemFood.h @@ -30,15 +30,18 @@ public: switch (m_ItemType) { // Please keep alpha-sorted. - case E_ITEM_BAKED_POTATO: return FoodInfo(5, 7.2); + case E_ITEM_BAKED_POTATO: return FoodInfo(5, 6); + case E_ITEM_BEETROOT: return FoodInfo(1, 1.2); + case E_ITEM_BEETROOT_SOUP: return FoodInfo(6, 7.2); case E_ITEM_BREAD: return FoodInfo(5, 6); // Carrots handled in ItemSeeds + case E_ITEM_CHORUS_FRUIT: return FoodInfo(4, 2.4); 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); + case E_ITEM_COOKIE: return FoodInfo(2, 0.5); // Golden apple handled in ItemGoldenApple case E_ITEM_GOLDEN_CARROT: return FoodInfo(6, 14.4); case E_ITEM_MELON_SLICE: return FoodInfo(2, 1.2); diff --git a/src/Items/ItemHandler.cpp b/src/Items/ItemHandler.cpp index 6984b6111..b3ad73b25 100644 --- a/src/Items/ItemHandler.cpp +++ b/src/Items/ItemHandler.cpp @@ -114,13 +114,14 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType) case E_BLOCK_HEAD: return new cItemMobHeadHandler(a_ItemType); case E_BLOCK_NEW_LEAVES: return new cItemLeavesHandler(a_ItemType); case E_BLOCK_PUMPKIN: return new cItemPumpkinHandler; + case E_BLOCK_PURPUR_SLAB: return new cItemSlabHandler(E_BLOCK_PURPUR_SLAB, E_BLOCK_PURPUR_DOUBLE_SLAB); + case E_BLOCK_RED_SANDSTONE_SLAB: return new cItemSlabHandler(E_BLOCK_RED_SANDSTONE_SLAB, E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB); case E_BLOCK_SAPLING: return new cItemSaplingHandler(a_ItemType); case E_BLOCK_STONE_SLAB: return new cItemSlabHandler(E_BLOCK_STONE_SLAB, E_BLOCK_DOUBLE_STONE_SLAB); case E_BLOCK_TRAPPED_CHEST: return new cItemChestHandler(a_ItemType); case E_BLOCK_WOODEN_SLAB: return new cItemSlabHandler(E_BLOCK_WOODEN_SLAB, E_BLOCK_DOUBLE_WOODEN_SLAB); case E_BLOCK_WOOL: return new cItemClothHandler(a_ItemType); case E_ITEM_BED: return new cItemBedHandler(a_ItemType); - case E_ITEM_BOAT: return new cItemBoatHandler(a_ItemType); case E_ITEM_BOTTLE_O_ENCHANTING: return new cItemBottleOEnchantingHandler(); case E_ITEM_BOW: return new cItemBowHandler(); case E_ITEM_BREWING_STAND: return new cItemBrewingStandHandler(a_ItemType); @@ -206,6 +207,7 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType) return new cItemBucketHandler(a_ItemType); } + case E_ITEM_BEETROOT_SEEDS: case E_ITEM_CARROT: case E_ITEM_MELON_SEEDS: case E_ITEM_POTATO: @@ -238,7 +240,10 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType) // Food (please keep alpha-sorted): // (carrots and potatoes handled separately in SeedHandler as they're both seed and food) case E_ITEM_BAKED_POTATO: + case E_ITEM_BEETROOT: + case E_ITEM_BEETROOT_SOUP: case E_ITEM_BREAD: + case E_ITEM_CHORUS_FRUIT: case E_ITEM_COOKED_CHICKEN: case E_ITEM_COOKED_FISH: case E_ITEM_COOKED_MUTTON: @@ -289,6 +294,16 @@ cItemHandler * cItemHandler::CreateItemHandler(int a_ItemType) { return new cItemArmorHandler(a_ItemType); } + + case E_ITEM_ACACIA_BOAT: + case E_ITEM_BIRCH_BOAT: + case E_ITEM_BOAT: + case E_ITEM_DARK_OAK_BOAT: + case E_ITEM_JUNGLE_BOAT: + case E_ITEM_SPRUCE_BOAT: + { + return new cItemBoatHandler(a_ItemType); + } } } @@ -572,6 +587,8 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_ARROW: return 64; case E_ITEM_BAKED_POTATO: return 64; case E_ITEM_BANNER: return 16; + case E_ITEM_BEETROOT: return 64; + case E_ITEM_BEETROOT_SEEDS: return 64; case E_ITEM_BIRCH_DOOR: return 64; case E_ITEM_BLAZE_POWDER: return 64; case E_ITEM_BLAZE_ROD: return 64; @@ -584,6 +601,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_BUCKET: return 16; case E_ITEM_CARROT: return 64; case E_ITEM_CAULDRON: return 64; + case E_ITEM_CHORUS_FRUIT: return 64; case E_ITEM_CLAY: return 64; case E_ITEM_CLAY_BRICK: return 64; case E_ITEM_CLOCK: return 64; @@ -598,6 +616,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_COOKIE: return 64; case E_ITEM_DARK_OAK_DOOR: return 64; case E_ITEM_DIAMOND: return 64; + case E_ITEM_DRAGON_BREATH: return 64; case E_ITEM_DYE: return 64; case E_ITEM_EGG: return 16; case E_ITEM_EMERALD: return 64; @@ -623,6 +642,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_HEAD: return 64; case E_ITEM_JUNGLE_DOOR: return 64; case E_ITEM_IRON: return 64; + case E_ITEM_IRON_NUGGET: return 64; case E_ITEM_ITEM_FRAME: return 64; case E_ITEM_LEATHER: return 64; case E_ITEM_MAGMA_CREAM: return 64; @@ -635,6 +655,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_PAINTING: return 64; case E_ITEM_PAPER: return 64; case E_ITEM_POISONOUS_POTATO: return 64; + case E_ITEM_POPPED_CHORUS_FRUIT: return 64; case E_ITEM_POTATO: return 64; case E_ITEM_PRISMARINE_CRYSTALS: return 64; case E_ITEM_PRISMARINE_SHARD: return 64; @@ -657,6 +678,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_SLIMEBALL: return 64; case E_ITEM_SNOWBALL: return 16; case E_ITEM_SPAWN_EGG: return 64; + case E_ITEM_SPECTRAL_ARROW: return 64; case E_ITEM_SPIDER_EYE: return 64; case E_ITEM_SPRUCE_DOOR: return 64; case E_ITEM_STEAK: return 64; @@ -664,6 +686,7 @@ char cItemHandler::GetMaxStackSize(void) case E_ITEM_STRING: return 64; case E_ITEM_SUGAR: return 64; case E_ITEM_SUGAR_CANE: return 64; + case E_ITEM_TIPPED_ARROW: return 64; case E_ITEM_WHEAT: return 64; } // By default items don't stack: @@ -737,6 +760,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_ANVIL: + case E_BLOCK_BONE_BLOCK: case E_BLOCK_BRICK: case E_BLOCK_CAULDRON: case E_BLOCK_COAL_ORE: @@ -751,6 +775,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_DOUBLE_STONE_SLAB: case E_BLOCK_EMERALD_ORE: case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_BRICKS: case E_BLOCK_END_STONE: case E_BLOCK_FURNACE: case E_BLOCK_GOLD_BLOCK: @@ -761,6 +786,7 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_LAPIS_BLOCK: case E_BLOCK_LAPIS_ORE: case E_BLOCK_LIT_FURNACE: + case E_BLOCK_MAGMA: case E_BLOCK_MOB_SPAWNER: case E_BLOCK_MOSSY_COBBLESTONE: case E_BLOCK_NETHER_BRICK: @@ -768,9 +794,15 @@ bool cItemHandler::CanHarvestBlock(BLOCKTYPE a_BlockType) case E_BLOCK_NETHER_BRICK_FENCE: case E_BLOCK_NETHERRACK: case E_BLOCK_RED_SANDSTONE_SLAB: + case E_BLOCK_OBSERVER: case E_BLOCK_OBSIDIAN: - case E_BLOCK_PACKED_ICE: case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_PURPUR_BLOCK: + case E_BLOCK_PURPUR_DOUBLE_SLAB: + case E_BLOCK_PURPUR_PILLAR: + case E_BLOCK_PURPUR_SLAB: + case E_BLOCK_PURPUR_STAIRS: + case E_BLOCK_RED_NETHER_BRICK: case E_BLOCK_RED_SANDSTONE: case E_BLOCK_RED_SANDSTONE_STAIRS: case E_BLOCK_REDSTONE_ORE: diff --git a/src/Items/ItemPickaxe.h b/src/Items/ItemPickaxe.h index 99c0c9c9a..3a04b17b4 100644 --- a/src/Items/ItemPickaxe.h +++ b/src/Items/ItemPickaxe.h @@ -59,6 +59,7 @@ public: } case E_BLOCK_ANVIL: + case E_BLOCK_BONE_BLOCK: case E_BLOCK_BRICK: case E_BLOCK_CAULDRON: case E_BLOCK_COAL_ORE: @@ -68,17 +69,25 @@ public: case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: case E_BLOCK_DOUBLE_STONE_SLAB: case E_BLOCK_ENCHANTMENT_TABLE: + case E_BLOCK_END_BRICKS: case E_BLOCK_END_STONE: case E_BLOCK_FURNACE: case E_BLOCK_LIT_FURNACE: case E_BLOCK_MOB_SPAWNER: case E_BLOCK_MOSSY_COBBLESTONE: + case E_BLOCK_MAGMA: case E_BLOCK_NETHER_BRICK: case E_BLOCK_NETHER_BRICK_STAIRS: case E_BLOCK_NETHER_BRICK_FENCE: case E_BLOCK_NETHERRACK: - case E_BLOCK_RED_SANDSTONE_SLAB: + case E_BLOCK_OBSERVER: case E_BLOCK_PRISMARINE_BLOCK: + case E_BLOCK_PURPUR_BLOCK: + case E_BLOCK_PURPUR_DOUBLE_SLAB: + case E_BLOCK_PURPUR_PILLAR: + case E_BLOCK_PURPUR_SLAB: + case E_BLOCK_PURPUR_STAIRS: + case E_BLOCK_RED_NETHER_BRICK: case E_BLOCK_RED_SANDSTONE: case E_BLOCK_RED_SANDSTONE_STAIRS: case E_BLOCK_SANDSTONE: diff --git a/src/Items/ItemSeeds.h b/src/Items/ItemSeeds.h index 408899a78..0661d2b9b 100644 --- a/src/Items/ItemSeeds.h +++ b/src/Items/ItemSeeds.h @@ -37,7 +37,7 @@ public: { switch (m_ItemType) { - case E_ITEM_CARROT: return FoodInfo(3, 4.8); + case E_ITEM_CARROT: return FoodInfo(3, 3.6); case E_ITEM_POTATO: return FoodInfo(1, 0.6); default: return FoodInfo(0, 0); } @@ -69,12 +69,13 @@ public: a_BlockMeta = 0; switch (m_ItemType) { - case E_ITEM_CARROT: a_BlockType = E_BLOCK_CARROTS; return true; - case E_ITEM_MELON_SEEDS: a_BlockType = E_BLOCK_MELON_STEM; return true; - case E_ITEM_POTATO: a_BlockType = E_BLOCK_POTATOES; return true; - case E_ITEM_PUMPKIN_SEEDS: a_BlockType = E_BLOCK_PUMPKIN_STEM; return true; - case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true; - default: a_BlockType = E_BLOCK_AIR; return true; + case E_ITEM_BEETROOT_SEEDS: a_BlockType = E_BLOCK_BEETROOTS; return true; + case E_ITEM_CARROT: a_BlockType = E_BLOCK_CARROTS; return true; + case E_ITEM_MELON_SEEDS: a_BlockType = E_BLOCK_MELON_STEM; return true; + case E_ITEM_POTATO: a_BlockType = E_BLOCK_POTATOES; return true; + case E_ITEM_PUMPKIN_SEEDS: a_BlockType = E_BLOCK_PUMPKIN_STEM; return true; + case E_ITEM_SEEDS: a_BlockType = E_BLOCK_CROPS; return true; + default: a_BlockType = E_BLOCK_AIR; return true; } } } ; diff --git a/src/Items/ItemShovel.h b/src/Items/ItemShovel.h index ba5fbb48e..6db96095d 100644 --- a/src/Items/ItemShovel.h +++ b/src/Items/ItemShovel.h @@ -67,13 +67,13 @@ public: case E_BLOCK_DIRT: case E_BLOCK_FARMLAND: case E_BLOCK_GRASS: + case E_BLOCK_GRASS_PATH: case E_BLOCK_GRAVEL: case E_BLOCK_MYCELIUM: case E_BLOCK_SAND: case E_BLOCK_SNOW: case E_BLOCK_SNOW_BLOCK: case E_BLOCK_SOULSAND: - case E_BLOCK_GRASS_PATH: { switch (m_ItemType) { diff --git a/src/Mobs/Villager.cpp b/src/Mobs/Villager.cpp index d4a7a8c3d..6bfc5594f 100644 --- a/src/Mobs/Villager.cpp +++ b/src/Mobs/Villager.cpp @@ -199,6 +199,7 @@ bool cVillager::IsBlockFarmable(BLOCKTYPE a_BlockType) { switch (a_BlockType) { + case E_BLOCK_BEETROOTS: case E_BLOCK_CROPS: case E_BLOCK_POTATOES: case E_BLOCK_CARROTS: diff --git a/src/Protocol/Protocol_1_8.cpp b/src/Protocol/Protocol_1_8.cpp index 07366210e..b7310adb8 100644 --- a/src/Protocol/Protocol_1_8.cpp +++ b/src/Protocol/Protocol_1_8.cpp @@ -1754,6 +1754,16 @@ int cProtocol_1_8_0::GetParticleID(const AString & a_ParticleName) ParticleMap["droplet"] = 39; ParticleMap["take"] = 40; ParticleMap["mobappearance"] = 41; + ParticleMap["ironcrack"] = 42; + ParticleMap["blockcrack"] = 43; + ParticleMap["blockdust"] = 44; + ParticleMap["endRod"] = 45; + ParticleMap["dragonbreath"] = 46; + ParticleMap["damageIndicator"] = 47; + ParticleMap["sweepAttack"] = 48; + ParticleMap["fallingdust"] = 49; + ParticleMap["spit"] = 50; + ParticleMap["totem"] = 51; } AString ParticleName = StrToLower(a_ParticleName); diff --git a/src/Protocol/Protocol_1_9.cpp b/src/Protocol/Protocol_1_9.cpp index 1bda4b853..19a00ce37 100644 --- a/src/Protocol/Protocol_1_9.cpp +++ b/src/Protocol/Protocol_1_9.cpp @@ -1771,6 +1771,16 @@ int cProtocol_1_9_0::GetParticleID(const AString & a_ParticleName) ParticleMap["droplet"] = 39; ParticleMap["take"] = 40; ParticleMap["mobappearance"] = 41; + ParticleMap["ironcrack"] = 42; + ParticleMap["blockcrack"] = 43; + ParticleMap["blockdust"] = 44; + ParticleMap["endRod"] = 45; + ParticleMap["dragonbreath"] = 46; + ParticleMap["damageIndicator"] = 47; + ParticleMap["sweepAttack"] = 48; + ParticleMap["fallingdust"] = 49; + ParticleMap["spit"] = 50; + ParticleMap["totem"] = 51; } AString ParticleName = StrToLower(a_ParticleName); diff --git a/src/Simulator/FluidSimulator.cpp b/src/Simulator/FluidSimulator.cpp index fce5e64b9..a1b14044b 100644 --- a/src/Simulator/FluidSimulator.cpp +++ b/src/Simulator/FluidSimulator.cpp @@ -31,6 +31,7 @@ bool cFluidSimulator::CanWashAway(BLOCKTYPE a_BlockType) { switch (a_BlockType) { + case E_BLOCK_BEETROOTS: case E_BLOCK_BROWN_MUSHROOM: case E_BLOCK_CACTUS: case E_BLOCK_COBWEB: diff --git a/src/Simulator/SandSimulator.cpp b/src/Simulator/SandSimulator.cpp index d3773ee41..59990cea3 100644 --- a/src/Simulator/SandSimulator.cpp +++ b/src/Simulator/SandSimulator.cpp @@ -153,7 +153,9 @@ bool cSandSimulator::CanContinueFallThrough(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_AIR: + case E_BLOCK_BEETROOTS: case E_BLOCK_BROWN_MUSHROOM: + case E_BLOCK_CARROTS: case E_BLOCK_COBWEB: case E_BLOCK_CROPS: case E_BLOCK_DEAD_BUSH: @@ -178,6 +180,7 @@ bool cSandSimulator::CanContinueFallThrough(BLOCKTYPE a_BlockType) case E_BLOCK_RED_ROSE: case E_BLOCK_SIGN_POST: case E_BLOCK_SNOW: + case E_BLOCK_STANDING_BANNER: case E_BLOCK_STATIONARY_LAVA: case E_BLOCK_STATIONARY_WATER: case E_BLOCK_STONE_BUTTON: @@ -187,6 +190,7 @@ bool cSandSimulator::CanContinueFallThrough(BLOCKTYPE a_BlockType) case E_BLOCK_TRAPDOOR: case E_BLOCK_TRIPWIRE: case E_BLOCK_TRIPWIRE_HOOK: + case E_BLOCK_WALL_BANNER: case E_BLOCK_WALLSIGN: case E_BLOCK_WATER: case E_BLOCK_WOODEN_BUTTON: @@ -209,12 +213,15 @@ bool cSandSimulator::IsReplacedOnRematerialization(BLOCKTYPE a_BlockType) switch (a_BlockType) { case E_BLOCK_AIR: + case E_BLOCK_CHORUS_FLOWER: + case E_BLOCK_CHORUS_PLANT: case E_BLOCK_DEAD_BUSH: case E_BLOCK_FIRE: case E_BLOCK_LAVA: case E_BLOCK_SNOW: case E_BLOCK_STATIONARY_LAVA: case E_BLOCK_STATIONARY_WATER: + case E_BLOCK_STRUCTURE_VOID: case E_BLOCK_TALL_GRASS: case E_BLOCK_WATER: { @@ -232,6 +239,8 @@ bool cSandSimulator::DoesBreakFallingThrough(BLOCKTYPE a_BlockType, NIBBLETYPE a { switch (a_BlockType) { + case E_BLOCK_PURPUR_SLAB: + case E_BLOCK_RED_SANDSTONE_SLAB: case E_BLOCK_STONE_SLAB: case E_BLOCK_WOODEN_SLAB: { diff --git a/src/World.cpp b/src/World.cpp index 241bf6135..38b86827f 100644 --- a/src/World.cpp +++ b/src/World.cpp @@ -177,6 +177,7 @@ cWorld::cWorld(const AString & a_WorldName, eDimension a_Dimension, const AStrin m_MinThunderStormTicks(3600), // 3 real-world minutes -+ m_MaxCactusHeight(3), m_MaxSugarcaneHeight(4), + m_IsBeetrootsBonemealable(true), m_IsCactusBonemealable(false), m_IsCarrotsBonemealable(true), m_IsCropsBonemealable(true), @@ -443,6 +444,7 @@ void cWorld::Start(cDeadlockDetect & a_DeadlockDetect) m_StorageCompressionFactor = IniFile.GetValueSetI("Storage", "CompressionFactor", m_StorageCompressionFactor); m_MaxCactusHeight = IniFile.GetValueSetI("Plants", "MaxCactusHeight", 3); m_MaxSugarcaneHeight = IniFile.GetValueSetI("Plants", "MaxSugarcaneHeight", 3); + m_IsBeetrootsBonemealable = IniFile.GetValueSetB("Plants", "IsBeetrootsBonemealable", true); m_IsCactusBonemealable = IniFile.GetValueSetB("Plants", "IsCactusBonemealable", false); m_IsCarrotsBonemealable = IniFile.GetValueSetB("Plants", "IsCarrotsBonemealable", true); m_IsCropsBonemealable = IniFile.GetValueSetB("Plants", "IsCropsBonemealable", true); @@ -1700,6 +1702,26 @@ bool cWorld::GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsBy GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta); switch (BlockType) { + case E_BLOCK_BEETROOTS: + { + if ((a_IsByBonemeal && !m_IsBeetrootsBonemealable) || (BlockMeta >= 3)) + { + return false; + } + if (!a_IsByBonemeal) + { + ++BlockMeta; + } + else + { + BlockMeta += 1; + BlockMeta = std::min(BlockMeta, static_cast(3)); + } + FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, BlockType, BlockMeta); + BroadcastSoundParticleEffect(EffectID::PARTICLE_HAPPY_VILLAGER, a_BlockX, a_BlockY, a_BlockZ, 0); + return true; + } + case E_BLOCK_CARROTS: { if ((a_IsByBonemeal && !m_IsCarrotsBonemealable) || (BlockMeta >= 7)) diff --git a/src/World.h b/src/World.h index 5957f5432..196a1b2e1 100644 --- a/src/World.h +++ b/src/World.h @@ -946,6 +946,7 @@ private: int m_MaxCactusHeight; int m_MaxSugarcaneHeight; + bool m_IsBeetrootsBonemealable; bool m_IsCactusBonemealable; bool m_IsCarrotsBonemealable; bool m_IsCropsBonemealable; -- cgit v1.2.3