summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTiger Wang <ziwei.tiger@outlook.com>2020-10-18 17:37:07 +0200
committerGitHub <noreply@github.com>2020-10-18 17:37:07 +0200
commit64442b05f8aa39918f5cb75503c7f57b0bd62827 (patch)
treeda09654d0e4ce16468b1ef90930742ec0c2b7f07
parentMUSL stack size (#4995) (diff)
downloadcuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar.gz
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar.bz2
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar.lz
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar.xz
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.tar.zst
cuberite-64442b05f8aa39918f5cb75503c7f57b0bd62827.zip
-rw-r--r--src/Bindings/DeprecatedBindings.cpp121
-rw-r--r--src/BlockInfo.cpp1984
-rw-r--r--src/BlockInfo.h111
-rw-r--r--tests/LuaThreadStress/Stubs.cpp11
-rw-r--r--tests/SchematicFileSerializer/Stubs.cpp16
5 files changed, 1064 insertions, 1179 deletions
diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp
index 3704551eb..d2400e7d1 100644
--- a/src/Bindings/DeprecatedBindings.cpp
+++ b/src/Bindings/DeprecatedBindings.cpp
@@ -292,32 +292,6 @@ tolua_lerror:
-static int tolua_cBlockInfo_Get(lua_State * tolua_S)
-{
- cLuaState L(tolua_S);
- if (
- !L.CheckParamStaticSelf("cBlockInfo") ||
- !L.CheckParamNumber(2)
- )
- {
- return 0;
- }
-
- BLOCKTYPE BlockType{};
- L.GetStackValue(2, BlockType);
-
- LOGWARNING("cBlockInfo:Get() is deprecated, use the static querying functions instead");
- L.LogStackTrace(0);
-
- cBlockInfo & BlockInfo = const_cast<cBlockInfo &>(cBlockInfo::Get(BlockType));
- L.Push(&BlockInfo);
- return 1;
-}
-
-
-
-
-
static int tolua_cBlockInfo_GetPlaceSound(lua_State * tolua_S)
{
cLuaState L(tolua_S);
@@ -339,85 +313,6 @@ static int tolua_cBlockInfo_GetPlaceSound(lua_State * tolua_S)
-static int tolua_get_cBlockInfo_m_PlaceSound(lua_State * tolua_S)
-{
- cLuaState L(tolua_S);
- if (!L.CheckParamSelf("const cBlockInfo"))
- {
- return 0;
- }
-
- L.Push("");
- LOGWARNING("cBlockInfo.m_PlaceSound is deprecated");
- L.LogStackTrace(0);
- return 1;
-}
-
-
-
-
-
-static int tolua_set_cBlockInfo_m_PlaceSound(lua_State * tolua_S)
-{
- cLuaState L(tolua_S);
- if (!L.CheckParamSelf("cBlockInfo"))
- {
- return 0;
- }
-
- LOGWARNING("cBlockInfo.m_PlaceSound is deprecated");
- L.LogStackTrace(0);
- return 0;
-}
-
-
-
-
-
-/** cBlockInfo variables: access the corresponding getter function instead of the variable.
-\tparam VariableType The type of the variable being accessed.
-\tparam GetterFunction The function called to get the value returned to lua. */
-template <typename VariableType, VariableType (*GetterFunction)(BLOCKTYPE)>
-static int tolua_get_cBlockInfo(lua_State * tolua_S)
-{
- cLuaState L(tolua_S);
- if (!L.CheckParamSelf("const cBlockInfo"))
- {
- return 0;
- }
-
- const cBlockInfo * Self = nullptr;
- L.GetStackValue(1, Self);
-
- L.Push(GetterFunction(Self->m_BlockType));
- LOGWARNING("cBlockInfo variables are deprecated, use the static functions instead.");
- L.LogStackTrace(0);
-
- return 1;
-}
-
-
-
-
-
-/** cBlockInfo variables: Print deprecation message on assignment. */
-static int tolua_set_cBlockInfo(lua_State * tolua_S)
-{
- cLuaState L(tolua_S);
- if (!L.CheckParamSelf("cBlockInfo"))
- {
- return 0;
- }
-
- LOGWARNING("cBlockInfo variables are deprecated in favour of the static functions.");
- L.LogStackTrace(0);
- return 0;
-}
-
-
-
-
-
static int tolua_get_cItem_m_Lore(lua_State * tolua_S)
{
// Maintain legacy m_Lore variable as Lore table split by ` (grave-accent)
@@ -785,23 +680,7 @@ void DeprecatedBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "StringToMobType", tolua_AllToLua_StringToMobType00);
tolua_beginmodule(tolua_S, "cBlockInfo");
- tolua_function(tolua_S, "Get", tolua_cBlockInfo_Get);
tolua_function(tolua_S, "GetPlaceSound", tolua_cBlockInfo_GetPlaceSound);
- tolua_variable(tolua_S, "m_PlaceSound", tolua_get_cBlockInfo_m_PlaceSound, tolua_set_cBlockInfo_m_PlaceSound);
- tolua_variable(tolua_S, "m_LightValue", tolua_get_cBlockInfo<NIBBLETYPE, cBlockInfo::GetLightValue >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_SpreadLightFalloff", tolua_get_cBlockInfo<NIBBLETYPE, cBlockInfo::GetSpreadLightFalloff>, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_Transparent", tolua_get_cBlockInfo<bool, cBlockInfo::IsTransparent >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_OneHitDig", tolua_get_cBlockInfo<bool, cBlockInfo::IsOneHitDig >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_PistonBreakable", tolua_get_cBlockInfo<bool, cBlockInfo::IsPistonBreakable >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_IsRainBlocker", tolua_get_cBlockInfo<bool, cBlockInfo::IsRainBlocker >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_IsSkylightDispersant", tolua_get_cBlockInfo<bool, cBlockInfo::IsSkylightDispersant >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_IsSnowable", tolua_get_cBlockInfo<bool, cBlockInfo::IsSnowable >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_IsSolid", tolua_get_cBlockInfo<bool, cBlockInfo::IsSolid >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_UseableBySpectator", tolua_get_cBlockInfo<bool, cBlockInfo::IsUseableBySpectator >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_FullyOccupiesVoxel", tolua_get_cBlockInfo<bool, cBlockInfo::FullyOccupiesVoxel >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_CanBeTerraformed", tolua_get_cBlockInfo<bool, cBlockInfo::CanBeTerraformed >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_BlockHeight", tolua_get_cBlockInfo<float, cBlockInfo::GetBlockHeight >, tolua_set_cBlockInfo);
- tolua_variable(tolua_S, "m_Hardness", tolua_get_cBlockInfo<float, cBlockInfo::GetHardness >, tolua_set_cBlockInfo);
tolua_endmodule(tolua_S);
tolua_beginmodule(tolua_S, "cItem");
diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp
index 9279f93a1..21fa9e220 100644
--- a/src/BlockInfo.cpp
+++ b/src/BlockInfo.cpp
@@ -399,28 +399,6 @@ bool IsBlockMaterialRock(BLOCKTYPE a_BlockType)
////////////////////////////////////////////////////////////////////////////////
// cBlockInfo:
-cBlockInfo::cBlockInfo():
- m_BlockType(E_BLOCK_STONE),
- m_LightValue(0x00),
- m_SpreadLightFalloff(0x0f),
- m_Transparent(false),
- m_OneHitDig(false),
- m_PistonBreakable(false),
- m_IsRainBlocker(false),
- m_IsSkylightDispersant(false),
- m_IsSolid(true),
- m_UseableBySpectator(false),
- m_FullyOccupiesVoxel(false),
- m_CanBeTerraformed(false),
- m_BlockHeight(1.0),
- m_Hardness(0.0f)
-{
-}
-
-
-
-
-
float cBlockInfo::GetExplosionAbsorption(const BLOCKTYPE Block)
{
switch (Block)
@@ -542,6 +520,511 @@ float cBlockInfo::GetExplosionAbsorption(const BLOCKTYPE Block)
+NIBBLETYPE cBlockInfo::GetLightValue(const BLOCKTYPE Block)
+{
+ // Emissive blocks:
+ switch (Block)
+ {
+ case E_BLOCK_ACTIVE_COMPARATOR: return 9;
+ case E_BLOCK_BEACON: return 15;
+ case E_BLOCK_BREWING_STAND: return 1;
+ case E_BLOCK_BROWN_MUSHROOM: return 1;
+ case E_BLOCK_BURNING_FURNACE: return 13;
+ case E_BLOCK_DRAGON_EGG: return 1;
+ case E_BLOCK_END_PORTAL: return 15;
+ case E_BLOCK_END_PORTAL_FRAME: return 1;
+ case E_BLOCK_END_ROD: return 14;
+ case E_BLOCK_ENDER_CHEST: return 7;
+ case E_BLOCK_FIRE: return 15;
+ case E_BLOCK_GLOWSTONE: return 15;
+ case E_BLOCK_JACK_O_LANTERN: return 15;
+ case E_BLOCK_LAVA: return 15;
+ case E_BLOCK_MAGMA: return 3;
+ case E_BLOCK_NETHER_PORTAL: return 11;
+ case E_BLOCK_REDSTONE_LAMP_ON: return 15;
+ case E_BLOCK_REDSTONE_ORE_GLOWING: return 9;
+ case E_BLOCK_REDSTONE_REPEATER_ON: return 9;
+ case E_BLOCK_REDSTONE_TORCH_ON: return 7;
+ case E_BLOCK_SEA_LANTERN: return 15;
+ case E_BLOCK_STATIONARY_LAVA: return 15;
+ case E_BLOCK_TORCH: return 14;
+ default: return 0;
+ }
+}
+
+
+
+
+
+NIBBLETYPE cBlockInfo::GetSpreadLightFalloff(const BLOCKTYPE Block)
+{
+ switch (Block)
+ {
+ // Spread blocks:
+ case E_BLOCK_ACACIA_DOOR:
+ case E_BLOCK_ACACIA_FENCE:
+ case E_BLOCK_ACACIA_FENCE_GATE:
+ case E_BLOCK_ACTIVATOR_RAIL:
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_AIR:
+ case E_BLOCK_ANVIL:
+ case E_BLOCK_BARRIER:
+ case E_BLOCK_BEACON:
+ case E_BLOCK_BED:
+ case E_BLOCK_BEETROOTS:
+ case E_BLOCK_BIG_FLOWER:
+ case E_BLOCK_BIRCH_DOOR:
+ case E_BLOCK_BIRCH_FENCE:
+ case E_BLOCK_BIRCH_FENCE_GATE:
+ case E_BLOCK_BROWN_MUSHROOM:
+ case E_BLOCK_BREWING_STAND:
+ case E_BLOCK_CACTUS:
+ case E_BLOCK_CAKE:
+ case E_BLOCK_CARPET:
+ case E_BLOCK_CARROTS:
+ case E_BLOCK_CAULDRON:
+ case E_BLOCK_CHORUS_FLOWER:
+ case E_BLOCK_CHORUS_PLANT:
+ case E_BLOCK_CHEST:
+ case E_BLOCK_COBBLESTONE_WALL:
+ case E_BLOCK_COCOA_POD:
+ case E_BLOCK_COBWEB:
+ case E_BLOCK_CROPS:
+ case E_BLOCK_DANDELION:
+ case E_BLOCK_DARK_OAK_DOOR:
+ case E_BLOCK_DARK_OAK_FENCE:
+ case E_BLOCK_DARK_OAK_FENCE_GATE:
+ case E_BLOCK_DAYLIGHT_SENSOR:
+ case E_BLOCK_DEAD_BUSH:
+ case E_BLOCK_DETECTOR_RAIL:
+ case E_BLOCK_DRAGON_EGG:
+ case E_BLOCK_ENCHANTMENT_TABLE:
+ case E_BLOCK_ENDER_CHEST:
+ case E_BLOCK_END_PORTAL:
+ case E_BLOCK_END_PORTAL_FRAME:
+ case E_BLOCK_END_ROD:
+ case E_BLOCK_FENCE:
+ case E_BLOCK_OAK_FENCE_GATE:
+ case E_BLOCK_FIRE:
+ case E_BLOCK_FLOWER:
+ case E_BLOCK_FLOWER_POT:
+ case E_BLOCK_GLASS:
+ case E_BLOCK_GLASS_PANE:
+ case E_BLOCK_HEAD:
+ case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_HOPPER:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ case E_BLOCK_INVERTED_DAYLIGHT_SENSOR:
+ case E_BLOCK_IRON_BARS:
+ case E_BLOCK_IRON_DOOR:
+ case E_BLOCK_IRON_TRAPDOOR:
+ case E_BLOCK_JUNGLE_DOOR:
+ case E_BLOCK_JUNGLE_FENCE:
+ case E_BLOCK_JUNGLE_FENCE_GATE:
+ case E_BLOCK_LADDER:
+ case E_BLOCK_LEAVES:
+ case E_BLOCK_LEVER:
+ case E_BLOCK_LILY_PAD:
+ case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_MELON_STEM:
+ case E_BLOCK_MOB_SPAWNER:
+ case E_BLOCK_NETHER_PORTAL:
+ case E_BLOCK_NETHER_WART:
+ case E_BLOCK_NEW_LEAVES:
+ case E_BLOCK_PISTON:
+ case E_BLOCK_PISTON_EXTENSION:
+ case E_BLOCK_PISTON_MOVED_BLOCK:
+ case E_BLOCK_POTATOES:
+ case E_BLOCK_POWERED_RAIL:
+ case E_BLOCK_PUMPKIN_STEM:
+ case E_BLOCK_RAIL:
+ case E_BLOCK_RED_MUSHROOM:
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ case E_BLOCK_REDSTONE_REPEATER_ON:
+ case E_BLOCK_REDSTONE_TORCH_OFF:
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ case E_BLOCK_SAPLING:
+ case E_BLOCK_SIGN_POST:
+ case E_BLOCK_SNOW:
+ case E_BLOCK_SPRUCE_DOOR:
+ case E_BLOCK_SPRUCE_FENCE:
+ case E_BLOCK_SPRUCE_FENCE_GATE:
+ case E_BLOCK_STAINED_GLASS:
+ case E_BLOCK_STAINED_GLASS_PANE:
+ case E_BLOCK_STANDING_BANNER:
+ case E_BLOCK_STICKY_PISTON:
+ case E_BLOCK_STONE_BUTTON:
+ case E_BLOCK_STONE_PRESSURE_PLATE:
+ case E_BLOCK_SUGARCANE:
+ case E_BLOCK_TALL_GRASS:
+ case E_BLOCK_TORCH:
+ case E_BLOCK_TRAPDOOR:
+ case E_BLOCK_TRAPPED_CHEST:
+ case E_BLOCK_TRIPWIRE:
+ case E_BLOCK_TRIPWIRE_HOOK:
+ case E_BLOCK_VINES:
+ case E_BLOCK_WALL_BANNER:
+ case E_BLOCK_WALLSIGN:
+ case E_BLOCK_WOODEN_BUTTON:
+ case E_BLOCK_OAK_DOOR:
+ case E_BLOCK_WOODEN_PRESSURE_PLATE: return 1;
+
+ // Light in ice and water disappears faster:
+ case E_BLOCK_ICE:
+ case E_BLOCK_STATIONARY_WATER:
+ case E_BLOCK_WATER: return 3;
+
+ // Light does not pass through these blocks at all:
+ case E_BLOCK_ACACIA_WOOD_STAIRS:
+ case E_BLOCK_BIRCH_WOOD_STAIRS:
+ case E_BLOCK_BRICK_STAIRS:
+ case E_BLOCK_COBBLESTONE_STAIRS:
+ case E_BLOCK_DARK_OAK_WOOD_STAIRS:
+ case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB:
+ case E_BLOCK_DOUBLE_STONE_SLAB:
+ case E_BLOCK_DOUBLE_WOODEN_SLAB:
+ case E_BLOCK_FARMLAND:
+ case E_BLOCK_JUNGLE_WOOD_STAIRS:
+ case E_BLOCK_NETHER_BRICK_STAIRS:
+ case E_BLOCK_OAK_WOOD_STAIRS:
+ case E_BLOCK_PURPUR_DOUBLE_SLAB:
+ case E_BLOCK_PURPUR_SLAB:
+ case E_BLOCK_PURPUR_STAIRS:
+ case E_BLOCK_QUARTZ_STAIRS:
+ case E_BLOCK_RED_SANDSTONE_SLAB:
+ case E_BLOCK_RED_SANDSTONE_STAIRS:
+ case E_BLOCK_SANDSTONE_STAIRS:
+ case E_BLOCK_SPRUCE_WOOD_STAIRS:
+ case E_BLOCK_STONE_BRICK_STAIRS:
+ case E_BLOCK_STONE_SLAB:
+ case E_BLOCK_WOODEN_SLAB: return 15;
+
+ default: return 0;
+ }
+}
+
+
+
+
+
+bool cBlockInfo::CanBeTerraformed(const BLOCKTYPE Block)
+{
+ // Blocks that can be terraformed:
+ switch (Block)
+ {
+ case E_BLOCK_COAL_ORE:
+ case E_BLOCK_COBBLESTONE:
+ case E_BLOCK_DIAMOND_ORE:
+ case E_BLOCK_DIRT:
+ case E_BLOCK_GOLD_ORE:
+ case E_BLOCK_GRASS:
+ case E_BLOCK_GRAVEL:
+ case E_BLOCK_HARDENED_CLAY:
+ case E_BLOCK_IRON_ORE:
+ case E_BLOCK_MYCELIUM:
+ case E_BLOCK_NETHERRACK:
+ case E_BLOCK_REDSTONE_ORE:
+ case E_BLOCK_REDSTONE_ORE_GLOWING:
+ case E_BLOCK_SAND:
+ case E_BLOCK_SANDSTONE:
+ case E_BLOCK_SOULSAND:
+ case E_BLOCK_STAINED_CLAY:
+ case E_BLOCK_STONE: return true;
+ default: return false;
+ }
+}
+
+
+
+
+
+bool cBlockInfo::FullyOccupiesVoxel(const BLOCKTYPE Block)
+{
+ // Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things:
+ switch (Block)
+ {
+ case E_BLOCK_BARRIER:
+ case E_BLOCK_BEDROCK:
+ case E_BLOCK_BLOCK_OF_COAL:
+ case E_BLOCK_BLOCK_OF_REDSTONE:
+ case E_BLOCK_BONE_BLOCK:
+ case E_BLOCK_BOOKCASE:
+ case E_BLOCK_BRICK:
+ case E_BLOCK_CHAIN_COMMAND_BLOCK:
+ case E_BLOCK_CLAY:
+ case E_BLOCK_COAL_ORE:
+ case E_BLOCK_COBBLESTONE:
+ case E_BLOCK_COMMAND_BLOCK:
+ case E_BLOCK_CONCRETE:
+ case E_BLOCK_CONCRETE_POWDER:
+ case E_BLOCK_CRAFTING_TABLE:
+ case E_BLOCK_DIAMOND_BLOCK:
+ case E_BLOCK_DIAMOND_ORE:
+ case E_BLOCK_DIRT:
+ case E_BLOCK_DISPENSER:
+ case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB:
+ case E_BLOCK_DOUBLE_STONE_SLAB:
+ case E_BLOCK_DOUBLE_WOODEN_SLAB:
+ case E_BLOCK_DROPPER:
+ case E_BLOCK_EMERALD_BLOCK:
+ case E_BLOCK_EMERALD_ORE:
+ case E_BLOCK_END_BRICKS:
+ case E_BLOCK_END_STONE:
+ case E_BLOCK_FROSTED_ICE:
+ case E_BLOCK_FURNACE:
+ case E_BLOCK_GLOWSTONE:
+ case E_BLOCK_GOLD_BLOCK:
+ case E_BLOCK_GOLD_ORE:
+ case E_BLOCK_WHITE_GLAZED_TERRACOTTA:
+ case E_BLOCK_ORANGE_GLAZED_TERRACOTTA:
+ case E_BLOCK_MAGENTA_GLAZED_TERRACOTTA:
+ case E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA:
+ case E_BLOCK_YELLOW_GLAZED_TERRACOTTA:
+ case E_BLOCK_LIME_GLAZED_TERRACOTTA:
+ case E_BLOCK_PINK_GLAZED_TERRACOTTA:
+ case E_BLOCK_GRAY_GLAZED_TERRACOTTA:
+ case E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA:
+ case E_BLOCK_CYAN_GLAZED_TERRACOTTA:
+ case E_BLOCK_PURPLE_GLAZED_TERRACOTTA:
+ case E_BLOCK_BLUE_GLAZED_TERRACOTTA:
+ case E_BLOCK_BROWN_GLAZED_TERRACOTTA:
+ case E_BLOCK_GREEN_GLAZED_TERRACOTTA:
+ case E_BLOCK_BLACK_GLAZED_TERRACOTTA:
+ case E_BLOCK_RED_GLAZED_TERRACOTTA:
+ case E_BLOCK_GRASS:
+ case E_BLOCK_GRAVEL:
+ case E_BLOCK_HARDENED_CLAY:
+ case E_BLOCK_HAY_BALE:
+ case E_BLOCK_HUGE_BROWN_MUSHROOM:
+ case E_BLOCK_HUGE_RED_MUSHROOM:
+ case E_BLOCK_ICE:
+ case E_BLOCK_IRON_BLOCK:
+ case E_BLOCK_IRON_ORE:
+ case E_BLOCK_JACK_O_LANTERN:
+ case E_BLOCK_JUKEBOX:
+ case E_BLOCK_LAPIS_BLOCK:
+ case E_BLOCK_LAPIS_ORE:
+ case E_BLOCK_LOG:
+ case E_BLOCK_MAGMA:
+ case E_BLOCK_MELON:
+ case E_BLOCK_MOB_SPAWNER:
+ case E_BLOCK_MOSSY_COBBLESTONE:
+ case E_BLOCK_MYCELIUM:
+ case E_BLOCK_NETHERRACK:
+ case E_BLOCK_NETHER_BRICK:
+ case E_BLOCK_NETHER_QUARTZ_ORE:
+ case E_BLOCK_NETHER_WART_BLOCK:
+ case E_BLOCK_NEW_LOG:
+ case E_BLOCK_NOTE_BLOCK:
+ case E_BLOCK_OBSERVER:
+ case E_BLOCK_OBSIDIAN:
+ case E_BLOCK_PACKED_ICE:
+ case E_BLOCK_PLANKS:
+ case E_BLOCK_PRISMARINE_BLOCK:
+ case E_BLOCK_PUMPKIN:
+ case E_BLOCK_PURPUR_BLOCK:
+ case E_BLOCK_PURPUR_PILLAR:
+ case E_BLOCK_PURPUR_DOUBLE_SLAB:
+ case E_BLOCK_QUARTZ_BLOCK:
+ case E_BLOCK_RED_NETHER_BRICK:
+ case E_BLOCK_RED_SANDSTONE:
+ case E_BLOCK_REDSTONE_LAMP_OFF:
+ case E_BLOCK_REDSTONE_LAMP_ON:
+ case E_BLOCK_REDSTONE_ORE:
+ case E_BLOCK_REDSTONE_ORE_GLOWING:
+ case E_BLOCK_REPEATING_COMMAND_BLOCK:
+ case E_BLOCK_SANDSTONE:
+ case E_BLOCK_SAND:
+ case E_BLOCK_SILVERFISH_EGG:
+ case E_BLOCK_SPONGE:
+ case E_BLOCK_STAINED_CLAY:
+ case E_BLOCK_STONE:
+ case E_BLOCK_STONE_BRICKS:
+ case E_BLOCK_STRUCTURE_BLOCK:
+ case E_BLOCK_WOOL: return true;
+ default: return false;
+ }
+}
+
+
+
+
+
+bool cBlockInfo::IsOneHitDig(const BLOCKTYPE Block)
+{
+ // One hit break blocks:
+ switch (Block)
+ {
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_BEETROOTS:
+ case E_BLOCK_BIG_FLOWER:
+ case E_BLOCK_BROWN_MUSHROOM:
+ case E_BLOCK_CARROTS:
+ case E_BLOCK_CROPS:
+ case E_BLOCK_DANDELION:
+ case E_BLOCK_DEAD_BUSH:
+ case E_BLOCK_END_ROD:
+ case E_BLOCK_FIRE:
+ case E_BLOCK_FLOWER:
+ case E_BLOCK_FLOWER_POT:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ case E_BLOCK_LILY_PAD:
+ case E_BLOCK_MELON_STEM:
+ case E_BLOCK_NETHER_WART:
+ case E_BLOCK_POTATOES:
+ case E_BLOCK_PUMPKIN_STEM:
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ case E_BLOCK_REDSTONE_REPEATER_ON:
+ case E_BLOCK_REDSTONE_TORCH_OFF:
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ case E_BLOCK_RED_MUSHROOM:
+ case E_BLOCK_REEDS:
+ case E_BLOCK_SAPLING:
+ case E_BLOCK_SLIME_BLOCK:
+ case E_BLOCK_TNT:
+ case E_BLOCK_TALL_GRASS:
+ case E_BLOCK_TORCH:
+ case E_BLOCK_TRIPWIRE_HOOK:
+ case E_BLOCK_TRIPWIRE: return true;
+ default: return false;
+ }
+}
+
+
+
+
+
+bool cBlockInfo::IsPistonBreakable(const BLOCKTYPE Block)
+{
+ // Blocks that break when pushed by piston:
+ switch (Block)
+ {
+ case E_BLOCK_ACACIA_DOOR:
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_AIR:
+ case E_BLOCK_BED:
+ case E_BLOCK_BEETROOTS:
+ case E_BLOCK_BIG_FLOWER:
+ case E_BLOCK_BIRCH_DOOR:
+ case E_BLOCK_BLACK_SHULKER_BOX:
+ case E_BLOCK_BLUE_SHULKER_BOX:
+ case E_BLOCK_BROWN_MUSHROOM:
+ case E_BLOCK_BROWN_SHULKER_BOX:
+ case E_BLOCK_CACTUS:
+ case E_BLOCK_CAKE:
+ case E_BLOCK_CARROTS:
+ case E_BLOCK_CHORUS_FLOWER:
+ case E_BLOCK_CHORUS_PLANT:
+ case E_BLOCK_COCOA_POD:
+ case E_BLOCK_COBWEB:
+ case E_BLOCK_CROPS:
+ case E_BLOCK_CYAN_SHULKER_BOX:
+ case E_BLOCK_DANDELION:
+ case E_BLOCK_DARK_OAK_DOOR:
+ case E_BLOCK_DEAD_BUSH:
+ case E_BLOCK_DRAGON_EGG:
+ case E_BLOCK_FIRE:
+ case E_BLOCK_FLOWER:
+ case E_BLOCK_FLOWER_POT:
+ case E_BLOCK_GRAY_SHULKER_BOX:
+ case E_BLOCK_GREEN_SHULKER_BOX:
+ case E_BLOCK_HEAD:
+ case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ case E_BLOCK_IRON_DOOR:
+ case E_BLOCK_IRON_TRAPDOOR:
+ case E_BLOCK_JACK_O_LANTERN:
+ case E_BLOCK_JUNGLE_DOOR:
+ case E_BLOCK_LIGHT_BLUE_SHULKER_BOX:
+ case E_BLOCK_LIGHT_GRAY_SHULKER_BOX:
+ case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_LILY_PAD:
+ case E_BLOCK_LIME_SHULKER_BOX:
+ case E_BLOCK_LADDER:
+ case E_BLOCK_LAVA:
+ case E_BLOCK_LEAVES:
+ case E_BLOCK_LEVER:
+ case E_BLOCK_MAGENTA_SHULKER_BOX:
+ case E_BLOCK_MELON:
+ case E_BLOCK_MELON_STEM:
+ case E_BLOCK_NETHER_WART:
+ case E_BLOCK_OAK_DOOR:
+ case E_BLOCK_ORANGE_SHULKER_BOX:
+ case E_BLOCK_PINK_SHULKER_BOX:
+ case E_BLOCK_POTATOES:
+ case E_BLOCK_PUMPKIN:
+ case E_BLOCK_PUMPKIN_STEM:
+ case E_BLOCK_PURPLE_SHULKER_BOX:
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ case E_BLOCK_REDSTONE_REPEATER_ON:
+ case E_BLOCK_REDSTONE_TORCH_OFF:
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ case E_BLOCK_RED_MUSHROOM:
+ case E_BLOCK_RED_SHULKER_BOX:
+ case E_BLOCK_REEDS:
+ case E_BLOCK_SAPLING:
+ case E_BLOCK_SIGN_POST:
+ case E_BLOCK_SNOW:
+ case E_BLOCK_SPRUCE_DOOR:
+ case E_BLOCK_STATIONARY_LAVA:
+ case E_BLOCK_STATIONARY_WATER:
+ case E_BLOCK_STONE_BUTTON:
+ case E_BLOCK_STONE_PRESSURE_PLATE:
+ case E_BLOCK_TALL_GRASS:
+ case E_BLOCK_TORCH:
+ case E_BLOCK_TRAPDOOR:
+ case E_BLOCK_TRIPWIRE:
+ case E_BLOCK_TRIPWIRE_HOOK:
+ case E_BLOCK_VINES:
+ case E_BLOCK_WALLSIGN:
+ case E_BLOCK_WATER:
+ case E_BLOCK_WHITE_SHULKER_BOX:
+ case E_BLOCK_WOODEN_BUTTON:
+ case E_BLOCK_WOODEN_PRESSURE_PLATE:
+ case E_BLOCK_YELLOW_SHULKER_BOX: return true;
+ default: return false;
+ }
+}
+
+
+
+
+
+bool cBlockInfo::IsRainBlocker(const BLOCKTYPE Block)
+{
+ // Blocks that block rain or snow's passage:
+ switch (Block)
+ {
+ case E_BLOCK_SIGN_POST:
+ case E_BLOCK_WALLSIGN:
+ case E_BLOCK_WALL_BANNER:
+ case E_BLOCK_STANDING_BANNER: return true;
+ default: return IsSolid(Block);
+ }
+}
+
+
+
+
+
+bool cBlockInfo::IsSkylightDispersant(const BLOCKTYPE Block)
+{
+ // Skylight dispersant blocks:
+ switch (Block)
+ {
+ case E_BLOCK_COBWEB:
+ case E_BLOCK_LEAVES: return true;
+ default: return GetSpreadLightFalloff(Block) > 1;
+ }
+}
+
+
+
+
+
bool cBlockInfo::IsSnowable(BLOCKTYPE a_BlockType)
{
return (
@@ -555,955 +1038,554 @@ bool cBlockInfo::IsSnowable(BLOCKTYPE a_BlockType)
-cBlockInfo::cBlockInfoArray::cBlockInfoArray()
+bool cBlockInfo::IsSolid(const BLOCKTYPE Block)
{
- cBlockInfoArray & Info = *this;
-
- for (size_t i = 0; i < Info.size(); ++i)
+ // Nonsolid blocks:
+ switch (Block)
{
- Info[i].m_BlockType = static_cast<BLOCKTYPE>(i);
+ case E_BLOCK_ACTIVATOR_RAIL:
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_AIR:
+ case E_BLOCK_BIG_FLOWER:
+ case E_BLOCK_BROWN_MUSHROOM:
+ case E_BLOCK_CARPET:
+ case E_BLOCK_CARROTS:
+ case E_BLOCK_CHORUS_FLOWER:
+ case E_BLOCK_CHORUS_PLANT:
+ case E_BLOCK_COBWEB:
+ case E_BLOCK_CROPS:
+ case E_BLOCK_DANDELION:
+ case E_BLOCK_DEAD_BUSH:
+ case E_BLOCK_DETECTOR_RAIL:
+ case E_BLOCK_END_GATEWAY:
+ case E_BLOCK_END_PORTAL:
+ case E_BLOCK_END_ROD:
+ case E_BLOCK_FIRE:
+ case E_BLOCK_FLOWER:
+ case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ case E_BLOCK_LADDER:
+ case E_BLOCK_LAVA:
+ case E_BLOCK_LEVER:
+ case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_MELON_STEM:
+ case E_BLOCK_NETHER_PORTAL:
+ case E_BLOCK_POTATOES:
+ case E_BLOCK_POWERED_RAIL:
+ case E_BLOCK_RAIL:
+ case E_BLOCK_RED_MUSHROOM:
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ case E_BLOCK_REDSTONE_REPEATER_ON:
+ case E_BLOCK_REDSTONE_TORCH_OFF:
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ case E_BLOCK_REEDS:
+ case E_BLOCK_SAPLING:
+ 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:
+ case E_BLOCK_STONE_PRESSURE_PLATE:
+ case E_BLOCK_TALL_GRASS:
+ case E_BLOCK_TORCH:
+ case E_BLOCK_TRIPWIRE:
+ case E_BLOCK_TRIPWIRE_HOOK:
+ case E_BLOCK_VINES:
+ case E_BLOCK_WALL_BANNER:
+ case E_BLOCK_WALLSIGN:
+ case E_BLOCK_WATER:
+ case E_BLOCK_WOODEN_BUTTON:
+ case E_BLOCK_WOODEN_PRESSURE_PLATE: return false;
+ default: return true;
}
+}
- // Emissive blocks
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_LightValue = 9;
- Info[E_BLOCK_BEACON ].m_LightValue = 15;
- Info[E_BLOCK_BREWING_STAND ].m_LightValue = 1;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_LightValue = 1;
- Info[E_BLOCK_BURNING_FURNACE ].m_LightValue = 13;
- Info[E_BLOCK_DRAGON_EGG ].m_LightValue = 1;
- Info[E_BLOCK_END_PORTAL ].m_LightValue = 15;
- Info[E_BLOCK_END_PORTAL_FRAME ].m_LightValue = 1;
- Info[E_BLOCK_END_ROD ].m_LightValue = 14;
- Info[E_BLOCK_ENDER_CHEST ].m_LightValue = 7;
- Info[E_BLOCK_FIRE ].m_LightValue = 15;
- Info[E_BLOCK_GLOWSTONE ].m_LightValue = 15;
- Info[E_BLOCK_JACK_O_LANTERN ].m_LightValue = 15;
- Info[E_BLOCK_LAVA ].m_LightValue = 15;
- Info[E_BLOCK_MAGMA ].m_LightValue = 3;
- Info[E_BLOCK_NETHER_PORTAL ].m_LightValue = 11;
- Info[E_BLOCK_REDSTONE_LAMP_ON ].m_LightValue = 15;
- Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_LightValue = 9;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_LightValue = 9;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_LightValue = 7;
- Info[E_BLOCK_SEA_LANTERN ].m_LightValue = 15;
- Info[E_BLOCK_STATIONARY_LAVA ].m_LightValue = 15;
- Info[E_BLOCK_TORCH ].m_LightValue = 14;
-
-
- // Spread blocks
- Info[E_BLOCK_ACACIA_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ACACIA_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ACACIA_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ACTIVATOR_RAIL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_AIR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ANVIL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BARRIER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BEACON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BED ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BEETROOTS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BIG_FLOWER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BIRCH_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BIRCH_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BIRCH_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_BREWING_STAND ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CACTUS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CAKE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CARPET ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CARROTS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CAULDRON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CHORUS_FLOWER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CHORUS_PLANT ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CHEST ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_COBBLESTONE_WALL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_COCOA_POD ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_COBWEB ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_CROPS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DANDELION ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DARK_OAK_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DARK_OAK_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DARK_OAK_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DAYLIGHT_SENSOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DEAD_BUSH ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DETECTOR_RAIL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_DRAGON_EGG ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ENCHANTMENT_TABLE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_ENDER_CHEST ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_END_PORTAL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_END_PORTAL_FRAME ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_END_ROD ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_FARMLAND ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_OAK_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_FIRE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_FLOWER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_FLOWER_POT ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_GLASS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_GLASS_PANE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_HEAD ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_HOPPER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_INVERTED_DAYLIGHT_SENSOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_IRON_BARS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_IRON_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_IRON_TRAPDOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_JUNGLE_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_JUNGLE_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_JUNGLE_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_LADDER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_LEAVES ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_LEVER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_LILY_PAD ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_MELON_STEM ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_MOB_SPAWNER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_NETHER_PORTAL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_NETHER_WART ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_NEW_LEAVES ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_PISTON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_PISTON_EXTENSION ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_PISTON_MOVED_BLOCK ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_POTATOES ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_POWERED_RAIL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_PUMPKIN_STEM ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_RAIL ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_RED_MUSHROOM ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_REDSTONE_WIRE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SAPLING ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SIGN_POST ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SNOW ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SPRUCE_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SPRUCE_FENCE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SPRUCE_FENCE_GATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STAINED_GLASS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STAINED_GLASS_PANE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STANDING_BANNER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STICKY_PISTON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STONE_BUTTON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_STONE_SLAB ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_SUGARCANE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TALL_GRASS ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TORCH ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TRAPDOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TRAPPED_CHEST ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TRIPWIRE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_VINES ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_WALL_BANNER ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_WALLSIGN ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_WOODEN_BUTTON ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_OAK_DOOR ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_SpreadLightFalloff = 1;
- Info[E_BLOCK_WOODEN_SLAB ].m_SpreadLightFalloff = 1;
-
- // Light in ice and water dissapears faster:
- Info[E_BLOCK_ICE ].m_SpreadLightFalloff = 3;
- Info[E_BLOCK_STATIONARY_WATER ].m_SpreadLightFalloff = 3;
- Info[E_BLOCK_WATER ].m_SpreadLightFalloff = 3;
-
- // Light does not pass through these blocks at all:
- Info[E_BLOCK_ACACIA_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_BIRCH_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_BRICK_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_COBBLESTONE_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_DARK_OAK_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_FARMLAND ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_JUNGLE_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_NETHER_BRICK_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_OAK_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_PURPUR_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_PURPUR_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_QUARTZ_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_RED_SANDSTONE_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_SANDSTONE_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_SPRUCE_WOOD_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_STONE_BRICK_STAIRS ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_STONE_SLAB ].m_SpreadLightFalloff = 15;
- Info[E_BLOCK_WOODEN_SLAB ].m_SpreadLightFalloff = 15;
-
- // Transparent blocks
-
- Info[E_BLOCK_ACACIA_DOOR ].m_Transparent = true;
- Info[E_BLOCK_ACACIA_FENCE ].m_Transparent = true;
- Info[E_BLOCK_ACACIA_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_ACACIA_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_ACTIVATOR_RAIL ].m_Transparent = true;
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_Transparent = true;
- Info[E_BLOCK_AIR ].m_Transparent = true;
- Info[E_BLOCK_ANVIL ].m_Transparent = true;
- Info[E_BLOCK_BARRIER ].m_Transparent = true;
- Info[E_BLOCK_BEACON ].m_Transparent = true;
- Info[E_BLOCK_BED ].m_Transparent = true;
- Info[E_BLOCK_BIG_FLOWER ].m_Transparent = true;
- Info[E_BLOCK_BIRCH_DOOR ].m_Transparent = true;
- Info[E_BLOCK_BIRCH_FENCE ].m_Transparent = true;
- Info[E_BLOCK_BIRCH_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_BIRCH_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_BLACK_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_Transparent = true;
- Info[E_BLOCK_BLUE_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_BREWING_STAND ].m_Transparent = true;
- Info[E_BLOCK_BRICK_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_Transparent = true;
- Info[E_BLOCK_BROWN_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_CACTUS ].m_Transparent = true;
- Info[E_BLOCK_CAKE ].m_Transparent = true;
- Info[E_BLOCK_CARPET ].m_Transparent = true;
- Info[E_BLOCK_CARROTS ].m_Transparent = true;
- Info[E_BLOCK_CAULDRON ].m_Transparent = true;
- Info[E_BLOCK_CHEST ].m_Transparent = true;
- Info[E_BLOCK_COBBLESTONE_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_COBBLESTONE_WALL ].m_Transparent = true;
- Info[E_BLOCK_COBWEB ].m_Transparent = true;
- Info[E_BLOCK_COCOA_POD ].m_Transparent = true;
- Info[E_BLOCK_CROPS ].m_Transparent = true;
- Info[E_BLOCK_CYAN_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_DANDELION ].m_Transparent = true;
- Info[E_BLOCK_DARK_OAK_DOOR ].m_Transparent = true;
- Info[E_BLOCK_DARK_OAK_FENCE ].m_Transparent = true;
- Info[E_BLOCK_DARK_OAK_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_DARK_OAK_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_DAYLIGHT_SENSOR ].m_Transparent = true;
- Info[E_BLOCK_DEAD_BUSH ].m_Transparent = true;
- Info[E_BLOCK_DETECTOR_RAIL ].m_Transparent = true;
- Info[E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB ].m_Transparent = true;
- Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_Transparent = true;
- Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_Transparent = true;
- Info[E_BLOCK_DRAGON_EGG ].m_Transparent = true;
- Info[E_BLOCK_ENCHANTMENT_TABLE ].m_Transparent = true;
- Info[E_BLOCK_END_PORTAL ].m_Transparent = true;
- Info[E_BLOCK_END_PORTAL_FRAME ].m_Transparent = true;
- Info[E_BLOCK_END_ROD ].m_Transparent = true;
- Info[E_BLOCK_ENDER_CHEST ].m_Transparent = true;
- Info[E_BLOCK_FARMLAND ].m_Transparent = true;
- Info[E_BLOCK_FENCE ].m_Transparent = true;
- Info[E_BLOCK_FIRE ].m_Transparent = true;
- Info[E_BLOCK_FLOWER ].m_Transparent = true;
- Info[E_BLOCK_FLOWER_POT ].m_Transparent = true;
- Info[E_BLOCK_GLASS ].m_Transparent = true;
- Info[E_BLOCK_GLASS_PANE ].m_Transparent = true;
- Info[E_BLOCK_GLOWSTONE ].m_Transparent = true;
- Info[E_BLOCK_GRAY_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_GREEN_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_HEAD ].m_Transparent = true;
- Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_Transparent = true;
- Info[E_BLOCK_HOPPER ].m_Transparent = true;
- Info[E_BLOCK_ICE ].m_Transparent = true;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_Transparent = true;
- Info[E_BLOCK_INVERTED_DAYLIGHT_SENSOR ].m_Transparent = true;
- Info[E_BLOCK_IRON_BARS ].m_Transparent = true;
- Info[E_BLOCK_IRON_DOOR ].m_Transparent = true;
- Info[E_BLOCK_IRON_TRAPDOOR ].m_Transparent = true;
- Info[E_BLOCK_JACK_O_LANTERN ].m_Transparent = true;
- Info[E_BLOCK_JUNGLE_DOOR ].m_Transparent = true;
- Info[E_BLOCK_JUNGLE_FENCE ].m_Transparent = true;
- Info[E_BLOCK_JUNGLE_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_JUNGLE_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_LADDER ].m_Transparent = true;
- Info[E_BLOCK_LAVA ].m_Transparent = true;
- Info[E_BLOCK_LEAVES ].m_Transparent = true;
- Info[E_BLOCK_LEVER ].m_Transparent = true;
- Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_Transparent = true;
- Info[E_BLOCK_LILY_PAD ].m_Transparent = true;
- Info[E_BLOCK_LIME_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_LIT_FURNACE ].m_Transparent = true;
- Info[E_BLOCK_MAGENTA_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_MELON_STEM ].m_Transparent = true;
- Info[E_BLOCK_MOB_SPAWNER ].m_Transparent = true;
- Info[E_BLOCK_NETHER_BRICK_FENCE ].m_Transparent = true;
- Info[E_BLOCK_NETHER_BRICK_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_NETHER_PORTAL ].m_Transparent = true;
- Info[E_BLOCK_NETHER_WART ].m_Transparent = true;
- Info[E_BLOCK_NEW_LEAVES ].m_Transparent = true;
- Info[E_BLOCK_OAK_DOOR ].m_Transparent = true;
- Info[E_BLOCK_OAK_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_OAK_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_PINK_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_PISTON ].m_Transparent = true;
- Info[E_BLOCK_PISTON_EXTENSION ].m_Transparent = true;
- Info[E_BLOCK_PISTON_MOVED_BLOCK ].m_Transparent = true;
- Info[E_BLOCK_POTATOES ].m_Transparent = true;
- Info[E_BLOCK_POWERED_RAIL ].m_Transparent = true;
- Info[E_BLOCK_PUMPKIN_STEM ].m_Transparent = true;
- Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_Transparent = true;
- Info[E_BLOCK_PURPUR_SLAB ].m_Transparent = true;
- Info[E_BLOCK_PURPUR_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_QUARTZ_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_RAIL ].m_Transparent = true;
- Info[E_BLOCK_RED_MUSHROOM ].m_Transparent = true;
- Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_Transparent = true;
- Info[E_BLOCK_RED_SANDSTONE_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_RED_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_Transparent = true;
- Info[E_BLOCK_REDSTONE_WIRE ].m_Transparent = true;
- Info[E_BLOCK_SANDSTONE_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_SAPLING ].m_Transparent = true;
- Info[E_BLOCK_SEA_LANTERN ].m_Transparent = true;
- Info[E_BLOCK_SIGN_POST ].m_Transparent = true;
- Info[E_BLOCK_SNOW ].m_Transparent = true;
- Info[E_BLOCK_SPRUCE_DOOR ].m_Transparent = true;
- Info[E_BLOCK_SPRUCE_FENCE ].m_Transparent = true;
- Info[E_BLOCK_SPRUCE_FENCE_GATE ].m_Transparent = true;
- Info[E_BLOCK_SPRUCE_WOOD_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_STAINED_GLASS ].m_Transparent = true;
- Info[E_BLOCK_STAINED_GLASS_PANE ].m_Transparent = true;
- Info[E_BLOCK_STANDING_BANNER ].m_Transparent = true;
- Info[E_BLOCK_STATIONARY_LAVA ].m_Transparent = true;
- Info[E_BLOCK_STATIONARY_WATER ].m_Transparent = true;
- Info[E_BLOCK_STICKY_PISTON ].m_Transparent = true;
- Info[E_BLOCK_STONE_BRICK_STAIRS ].m_Transparent = true;
- Info[E_BLOCK_STONE_BUTTON ].m_Transparent = true;
- Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_Transparent = true;
- Info[E_BLOCK_STONE_SLAB ].m_Transparent = true;
- Info[E_BLOCK_SUGARCANE ].m_Transparent = true;
- Info[E_BLOCK_TALL_GRASS ].m_Transparent = true;
- Info[E_BLOCK_TORCH ].m_Transparent = true;
- Info[E_BLOCK_TRAPDOOR ].m_Transparent = true;
- Info[E_BLOCK_TRAPPED_CHEST ].m_Transparent = true;
- Info[E_BLOCK_TRIPWIRE ].m_Transparent = true;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_Transparent = true;
- Info[E_BLOCK_VINES ].m_Transparent = true;
- Info[E_BLOCK_WALL_BANNER ].m_Transparent = true;
- Info[E_BLOCK_WALLSIGN ].m_Transparent = true;
- Info[E_BLOCK_WATER ].m_Transparent = true;
- Info[E_BLOCK_WHITE_SHULKER_BOX ].m_Transparent = true;
- Info[E_BLOCK_WOODEN_BUTTON ].m_Transparent = true;
- Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_Transparent = true;
- Info[E_BLOCK_WOODEN_SLAB ].m_Transparent = true;
- Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_Transparent = true;
- // Skylight dispersant blocks:
- Info[E_BLOCK_COBWEB ].m_IsSkylightDispersant = true;
- Info[E_BLOCK_LEAVES ].m_IsSkylightDispersant = true;
- // One hit break blocks:
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_OneHitDig = true;
- Info[E_BLOCK_BEETROOTS ].m_OneHitDig = true;
- Info[E_BLOCK_BIG_FLOWER ].m_OneHitDig = true;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_OneHitDig = true;
- Info[E_BLOCK_CARROTS ].m_OneHitDig = true;
- Info[E_BLOCK_CROPS ].m_OneHitDig = true;
- Info[E_BLOCK_DANDELION ].m_OneHitDig = true;
- Info[E_BLOCK_DEAD_BUSH ].m_OneHitDig = true;
- Info[E_BLOCK_END_ROD ].m_OneHitDig = true;
- Info[E_BLOCK_FIRE ].m_OneHitDig = true;
- Info[E_BLOCK_FLOWER ].m_OneHitDig = true;
- Info[E_BLOCK_FLOWER_POT ].m_OneHitDig = true;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_OneHitDig = true;
- Info[E_BLOCK_LILY_PAD ].m_OneHitDig = true;
- Info[E_BLOCK_MELON_STEM ].m_OneHitDig = true;
- Info[E_BLOCK_NETHER_WART ].m_OneHitDig = true;
- Info[E_BLOCK_POTATOES ].m_OneHitDig = true;
- Info[E_BLOCK_PUMPKIN_STEM ].m_OneHitDig = true;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_OneHitDig = true;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_OneHitDig = true;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_OneHitDig = true;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_OneHitDig = true;
- Info[E_BLOCK_REDSTONE_WIRE ].m_OneHitDig = true;
- Info[E_BLOCK_RED_MUSHROOM ].m_OneHitDig = true;
- Info[E_BLOCK_REEDS ].m_OneHitDig = true;
- Info[E_BLOCK_SAPLING ].m_OneHitDig = true;
- Info[E_BLOCK_SLIME_BLOCK ].m_OneHitDig = true;
- Info[E_BLOCK_TNT ].m_OneHitDig = true;
- Info[E_BLOCK_TALL_GRASS ].m_OneHitDig = true;
- Info[E_BLOCK_TORCH ].m_OneHitDig = true;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_OneHitDig = true;
- Info[E_BLOCK_TRIPWIRE ].m_OneHitDig = true;
+bool cBlockInfo::IsTransparent(const BLOCKTYPE Block)
+{
+ // Transparent blocks:
+ switch (Block)
+ {
+ 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_ACTIVATOR_RAIL:
+ case E_BLOCK_ACTIVE_COMPARATOR:
+ case E_BLOCK_AIR:
+ case E_BLOCK_ANVIL:
+ case E_BLOCK_BARRIER:
+ case E_BLOCK_BEACON:
+ case E_BLOCK_BED:
+ case E_BLOCK_BIG_FLOWER:
+ 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_BLACK_SHULKER_BOX:
+ case E_BLOCK_BLOCK_OF_REDSTONE:
+ case E_BLOCK_BLUE_SHULKER_BOX:
+ case E_BLOCK_BREWING_STAND:
+ case E_BLOCK_BRICK_STAIRS:
+ case E_BLOCK_BROWN_MUSHROOM:
+ case E_BLOCK_BROWN_SHULKER_BOX:
+ case E_BLOCK_CACTUS:
+ case E_BLOCK_CAKE:
+ case E_BLOCK_CARPET:
+ case E_BLOCK_CARROTS:
+ case E_BLOCK_CAULDRON:
+ case E_BLOCK_CHEST:
+ case E_BLOCK_COBBLESTONE_STAIRS:
+ case E_BLOCK_COBBLESTONE_WALL:
+ case E_BLOCK_COBWEB:
+ case E_BLOCK_COCOA_POD:
+ case E_BLOCK_CROPS:
+ case E_BLOCK_CYAN_SHULKER_BOX:
+ case E_BLOCK_DANDELION:
+ 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_DEAD_BUSH:
+ case E_BLOCK_DETECTOR_RAIL:
+ case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB:
+ case E_BLOCK_DOUBLE_STONE_SLAB:
+ case E_BLOCK_DOUBLE_WOODEN_SLAB:
+ case E_BLOCK_DRAGON_EGG:
+ case E_BLOCK_ENCHANTMENT_TABLE:
+ case E_BLOCK_END_PORTAL:
+ case E_BLOCK_END_PORTAL_FRAME:
+ case E_BLOCK_END_ROD:
+ case E_BLOCK_ENDER_CHEST:
+ case E_BLOCK_FARMLAND:
+ case E_BLOCK_FENCE:
+ case E_BLOCK_FIRE:
+ case E_BLOCK_FLOWER:
+ case E_BLOCK_FLOWER_POT:
+ case E_BLOCK_GLASS:
+ case E_BLOCK_GLASS_PANE:
+ case E_BLOCK_GLOWSTONE:
+ case E_BLOCK_GRAY_SHULKER_BOX:
+ case E_BLOCK_GREEN_SHULKER_BOX:
+ case E_BLOCK_HEAD:
+ case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_HOPPER:
+ case E_BLOCK_ICE:
+ case E_BLOCK_INACTIVE_COMPARATOR:
+ case E_BLOCK_INVERTED_DAYLIGHT_SENSOR:
+ case E_BLOCK_IRON_BARS:
+ case E_BLOCK_IRON_DOOR:
+ case E_BLOCK_IRON_TRAPDOOR:
+ case E_BLOCK_JACK_O_LANTERN:
+ 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_LADDER:
+ case E_BLOCK_LAVA:
+ case E_BLOCK_LEAVES:
+ case E_BLOCK_LEVER:
+ case E_BLOCK_LIGHT_BLUE_SHULKER_BOX:
+ case E_BLOCK_LIGHT_GRAY_SHULKER_BOX:
+ case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE:
+ case E_BLOCK_LILY_PAD:
+ case E_BLOCK_LIME_SHULKER_BOX:
+ case E_BLOCK_LIT_FURNACE:
+ case E_BLOCK_MAGENTA_SHULKER_BOX:
+ case E_BLOCK_MELON_STEM:
+ case E_BLOCK_MOB_SPAWNER:
+ case E_BLOCK_NETHER_BRICK_FENCE:
+ case E_BLOCK_NETHER_BRICK_STAIRS:
+ case E_BLOCK_NETHER_PORTAL:
+ case E_BLOCK_NETHER_WART:
+ case E_BLOCK_NEW_LEAVES:
+ case E_BLOCK_OAK_DOOR:
+ case E_BLOCK_OAK_FENCE_GATE:
+ case E_BLOCK_OAK_WOOD_STAIRS:
+ case E_BLOCK_ORANGE_SHULKER_BOX:
+ case E_BLOCK_PINK_SHULKER_BOX:
+ case E_BLOCK_PISTON:
+ case E_BLOCK_PISTON_EXTENSION:
+ case E_BLOCK_PISTON_MOVED_BLOCK:
+ case E_BLOCK_POTATOES:
+ case E_BLOCK_POWERED_RAIL:
+ case E_BLOCK_PUMPKIN_STEM:
+ case E_BLOCK_PURPLE_SHULKER_BOX:
+ case E_BLOCK_PURPUR_DOUBLE_SLAB:
+ case E_BLOCK_PURPUR_SLAB:
+ case E_BLOCK_PURPUR_STAIRS:
+ case E_BLOCK_QUARTZ_STAIRS:
+ case E_BLOCK_RAIL:
+ case E_BLOCK_RED_MUSHROOM:
+ case E_BLOCK_RED_SANDSTONE_SLAB:
+ case E_BLOCK_RED_SANDSTONE_STAIRS:
+ case E_BLOCK_RED_SHULKER_BOX:
+ case E_BLOCK_REDSTONE_ORE_GLOWING:
+ case E_BLOCK_REDSTONE_REPEATER_OFF:
+ case E_BLOCK_REDSTONE_REPEATER_ON:
+ case E_BLOCK_REDSTONE_TORCH_OFF:
+ case E_BLOCK_REDSTONE_TORCH_ON:
+ case E_BLOCK_REDSTONE_WIRE:
+ case E_BLOCK_SANDSTONE_STAIRS:
+ case E_BLOCK_SAPLING:
+ case E_BLOCK_SEA_LANTERN:
+ case E_BLOCK_SIGN_POST:
+ case E_BLOCK_SNOW:
+ 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_STAINED_GLASS:
+ case E_BLOCK_STAINED_GLASS_PANE:
+ case E_BLOCK_STANDING_BANNER:
+ case E_BLOCK_STATIONARY_LAVA:
+ case E_BLOCK_STATIONARY_WATER:
+ case E_BLOCK_STICKY_PISTON:
+ case E_BLOCK_STONE_BRICK_STAIRS:
+ case E_BLOCK_STONE_BUTTON:
+ case E_BLOCK_STONE_PRESSURE_PLATE:
+ case E_BLOCK_STONE_SLAB:
+ case E_BLOCK_SUGARCANE:
+ case E_BLOCK_TALL_GRASS:
+ case E_BLOCK_TORCH:
+ case E_BLOCK_TRAPDOOR:
+ case E_BLOCK_TRAPPED_CHEST:
+ case E_BLOCK_TRIPWIRE:
+ case E_BLOCK_TRIPWIRE_HOOK:
+ case E_BLOCK_VINES:
+ case E_BLOCK_WALL_BANNER:
+ case E_BLOCK_WALLSIGN:
+ case E_BLOCK_WATER:
+ case E_BLOCK_WHITE_SHULKER_BOX:
+ case E_BLOCK_WOODEN_BUTTON:
+ case E_BLOCK_WOODEN_PRESSURE_PLATE:
+ case E_BLOCK_WOODEN_SLAB:
+ case E_BLOCK_YELLOW_SHULKER_BOX: return true;
+ default: return false;
+ }
+}
- // Blocks that break when pushed by piston:
- Info[E_BLOCK_ACACIA_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_PistonBreakable = true;
- Info[E_BLOCK_AIR ].m_PistonBreakable = true;
- Info[E_BLOCK_BED ].m_PistonBreakable = true;
- Info[E_BLOCK_BEETROOTS ].m_PistonBreakable = true;
- Info[E_BLOCK_BIG_FLOWER ].m_PistonBreakable = true;
- Info[E_BLOCK_BIRCH_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_BLACK_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_BLUE_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_PistonBreakable = true;
- Info[E_BLOCK_BROWN_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_CACTUS ].m_PistonBreakable = true;
- Info[E_BLOCK_CAKE ].m_PistonBreakable = true;
- Info[E_BLOCK_CARROTS ].m_PistonBreakable = true;
- Info[E_BLOCK_CHORUS_FLOWER ].m_PistonBreakable = true;
- Info[E_BLOCK_CHORUS_PLANT ].m_PistonBreakable = true;
- Info[E_BLOCK_COCOA_POD ].m_PistonBreakable = true;
- Info[E_BLOCK_COBWEB ].m_PistonBreakable = true;
- Info[E_BLOCK_CROPS ].m_PistonBreakable = true;
- Info[E_BLOCK_CYAN_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_DANDELION ].m_PistonBreakable = true;
- Info[E_BLOCK_DARK_OAK_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_DEAD_BUSH ].m_PistonBreakable = true;
- Info[E_BLOCK_DRAGON_EGG ].m_PistonBreakable = true;
- Info[E_BLOCK_FIRE ].m_PistonBreakable = true;
- Info[E_BLOCK_FLOWER ].m_PistonBreakable = true;
- Info[E_BLOCK_FLOWER_POT ].m_PistonBreakable = true;
- Info[E_BLOCK_GRAY_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_GREEN_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_HEAD ].m_PistonBreakable = true;
- Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_PistonBreakable = true;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_PistonBreakable = true;
- Info[E_BLOCK_IRON_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_IRON_TRAPDOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_JACK_O_LANTERN ].m_PistonBreakable = true;
- Info[E_BLOCK_JUNGLE_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_PistonBreakable = true;
- Info[E_BLOCK_LILY_PAD ].m_PistonBreakable = true;
- Info[E_BLOCK_LIME_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_LADDER ].m_PistonBreakable = true;
- Info[E_BLOCK_LAVA ].m_PistonBreakable = true;
- Info[E_BLOCK_LEAVES ].m_PistonBreakable = true;
- Info[E_BLOCK_LEVER ].m_PistonBreakable = true;
- Info[E_BLOCK_MAGENTA_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_MELON ].m_PistonBreakable = true;
- Info[E_BLOCK_MELON_STEM ].m_PistonBreakable = true;
- Info[E_BLOCK_NETHER_WART ].m_PistonBreakable = true;
- Info[E_BLOCK_OAK_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_PINK_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_POTATOES ].m_PistonBreakable = true;
- Info[E_BLOCK_PUMPKIN ].m_PistonBreakable = true;
- Info[E_BLOCK_PUMPKIN_STEM ].m_PistonBreakable = true;
- Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_PistonBreakable = true;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_PistonBreakable = true;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_PistonBreakable = true;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_PistonBreakable = true;
- Info[E_BLOCK_REDSTONE_WIRE ].m_PistonBreakable = true;
- Info[E_BLOCK_RED_MUSHROOM ].m_PistonBreakable = true;
- Info[E_BLOCK_RED_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_REEDS ].m_PistonBreakable = true;
- Info[E_BLOCK_SAPLING ].m_PistonBreakable = true;
- Info[E_BLOCK_SIGN_POST ].m_PistonBreakable = true;
- Info[E_BLOCK_SNOW ].m_PistonBreakable = true;
- Info[E_BLOCK_SPRUCE_DOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_STATIONARY_LAVA ].m_PistonBreakable = true;
- Info[E_BLOCK_STATIONARY_WATER ].m_PistonBreakable = true;
- Info[E_BLOCK_STONE_BUTTON ].m_PistonBreakable = true;
- Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_PistonBreakable = true;
- Info[E_BLOCK_TALL_GRASS ].m_PistonBreakable = true;
- Info[E_BLOCK_TORCH ].m_PistonBreakable = true;
- Info[E_BLOCK_TRAPDOOR ].m_PistonBreakable = true;
- Info[E_BLOCK_TRIPWIRE ].m_PistonBreakable = true;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_PistonBreakable = true;
- Info[E_BLOCK_VINES ].m_PistonBreakable = true;
- Info[E_BLOCK_WALLSIGN ].m_PistonBreakable = true;
- Info[E_BLOCK_WATER ].m_PistonBreakable = true;
- Info[E_BLOCK_WHEAT ].m_PistonBreakable = true;
- Info[E_BLOCK_WHITE_SHULKER_BOX ].m_PistonBreakable = true;
- Info[E_BLOCK_WOODEN_BUTTON ].m_PistonBreakable = true;
- Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_PistonBreakable = true;
- Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_PistonBreakable = true;
-
-
- /* Blocks that block rain or snow's passage:
- * All solid blocks are also rain blockers, and they are set automatically
- * at the end of this function.
- */
- Info[E_BLOCK_SIGN_POST ].m_IsRainBlocker = true;
- Info[E_BLOCK_WALLSIGN ].m_IsRainBlocker = true;
- Info[E_BLOCK_WALL_BANNER ].m_IsRainBlocker = true;
- Info[E_BLOCK_STANDING_BANNER ].m_IsRainBlocker = true;
- // Nonsolid blocks:
- Info[E_BLOCK_ACTIVATOR_RAIL ].m_IsSolid = false;
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_IsSolid = false;
- Info[E_BLOCK_AIR ].m_IsSolid = false;
- Info[E_BLOCK_BIG_FLOWER ].m_IsSolid = false;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_IsSolid = false;
- Info[E_BLOCK_CARPET ].m_IsSolid = false;
- Info[E_BLOCK_CARROTS ].m_IsSolid = false;
- Info[E_BLOCK_CHORUS_FLOWER ].m_IsSolid = false;
- Info[E_BLOCK_CHORUS_PLANT ].m_IsSolid = false;
- Info[E_BLOCK_COBWEB ].m_IsSolid = false;
- Info[E_BLOCK_CROPS ].m_IsSolid = false;
- Info[E_BLOCK_DANDELION ].m_IsSolid = false;
- Info[E_BLOCK_DEAD_BUSH ].m_IsSolid = false;
- Info[E_BLOCK_DETECTOR_RAIL ].m_IsSolid = false;
- Info[E_BLOCK_END_GATEWAY ].m_IsSolid = false;
- Info[E_BLOCK_END_PORTAL ].m_IsSolid = false;
- Info[E_BLOCK_END_ROD ].m_IsSolid = false;
- Info[E_BLOCK_FIRE ].m_IsSolid = false;
- Info[E_BLOCK_FLOWER ].m_IsSolid = false;
- Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_IsSolid = false;
- Info[E_BLOCK_LADDER ].m_IsSolid = false;
- Info[E_BLOCK_LAVA ].m_IsSolid = false;
- Info[E_BLOCK_LEVER ].m_IsSolid = false;
- Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_IsSolid = false;
- Info[E_BLOCK_MELON_STEM ].m_IsSolid = false;
- Info[E_BLOCK_NETHER_PORTAL ].m_IsSolid = false;
- Info[E_BLOCK_POTATOES ].m_IsSolid = false;
- Info[E_BLOCK_POWERED_RAIL ].m_IsSolid = false;
- Info[E_BLOCK_RAIL ].m_IsSolid = false;
- Info[E_BLOCK_RED_MUSHROOM ].m_IsSolid = false;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_IsSolid = false;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_IsSolid = false;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_IsSolid = false;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_IsSolid = false;
- Info[E_BLOCK_REDSTONE_WIRE ].m_IsSolid = false;
- Info[E_BLOCK_REEDS ].m_IsSolid = false;
- Info[E_BLOCK_SAPLING ].m_IsSolid = false;
- Info[E_BLOCK_SIGN_POST ].m_IsSolid = false;
- Info[E_BLOCK_SNOW ].m_IsSolid = false;
- Info[E_BLOCK_STANDING_BANNER ].m_IsSolid = false;
- Info[E_BLOCK_STATIONARY_LAVA ].m_IsSolid = false;
- Info[E_BLOCK_STATIONARY_WATER ].m_IsSolid = false;
- Info[E_BLOCK_STONE_BUTTON ].m_IsSolid = false;
- Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_IsSolid = false;
- Info[E_BLOCK_TALL_GRASS ].m_IsSolid = false;
- Info[E_BLOCK_TORCH ].m_IsSolid = false;
- Info[E_BLOCK_TRIPWIRE ].m_IsSolid = false;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_IsSolid = false;
- Info[E_BLOCK_VINES ].m_IsSolid = false;
- Info[E_BLOCK_WALL_BANNER ].m_IsSolid = false;
- Info[E_BLOCK_WALLSIGN ].m_IsSolid = false;
- Info[E_BLOCK_WATER ].m_IsSolid = false;
- Info[E_BLOCK_WOODEN_BUTTON ].m_IsSolid = false;
- Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_IsSolid = false;
-
-
- // Blocks, which a spectator is allowed to interact with
- Info[E_BLOCK_BEACON ].m_UseableBySpectator = true;
- Info[E_BLOCK_BREWING_STAND ].m_UseableBySpectator = true;
- Info[E_BLOCK_CHEST ].m_UseableBySpectator = true;
- Info[E_BLOCK_DISPENSER ].m_UseableBySpectator = true;
- Info[E_BLOCK_DROPPER ].m_UseableBySpectator = true;
- Info[E_BLOCK_HOPPER ].m_UseableBySpectator = true;
+
+bool cBlockInfo::IsUseableBySpectator(const BLOCKTYPE Block)
+{
+ // Blocks, which a spectator is allowed to interact with:
+ switch (Block)
+ {
+ case E_BLOCK_BEACON:
+ case E_BLOCK_BREWING_STAND:
+ case E_BLOCK_CHEST:
+ case E_BLOCK_DISPENSER:
+ case E_BLOCK_DROPPER:
+ case E_BLOCK_HOPPER: return true;
+ default: return false;
+ }
+}
+
- // Blocks that fully occupy their voxel - used as a guide for torch placeable blocks, amongst other things:
- Info[E_BLOCK_BARRIER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BEDROCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BLOCK_OF_COAL ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BONE_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BOOKCASE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BRICK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CHAIN_COMMAND_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CLAY ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_COAL_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_COBBLESTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_COMMAND_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CONCRETE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CONCRETE_POWDER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CRAFTING_TABLE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DIAMOND_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DIAMOND_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DIRT ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DISPENSER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_DROPPER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_EMERALD_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_EMERALD_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_END_BRICKS ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_END_STONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_FROSTED_ICE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_FURNACE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GLOWSTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GOLD_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GOLD_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_WHITE_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_ORANGE_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MAGENTA_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_YELLOW_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LIME_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PINK_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GRAY_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_CYAN_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PURPLE_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BLUE_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BROWN_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GREEN_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_BLACK_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_RED_GLAZED_TERRACOTTA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GRASS ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_GRAVEL ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_HARDENED_CLAY ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_HAY_BALE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_HUGE_BROWN_MUSHROOM ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_HUGE_RED_MUSHROOM ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_ICE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_IRON_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_IRON_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_JACK_O_LANTERN ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_JUKEBOX ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LAPIS_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LAPIS_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_LOG ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MAGMA ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MELON ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MOB_SPAWNER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MOSSY_COBBLESTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_MYCELIUM ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NETHERRACK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NETHER_BRICK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NETHER_QUARTZ_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NETHER_WART_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NEW_LOG ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_NOTE_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_OBSERVER ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_OBSIDIAN ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PACKED_ICE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PLANKS ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PRISMARINE_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PUMPKIN ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PURPUR_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PURPUR_PILLAR ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_QUARTZ_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_RED_NETHER_BRICK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_RED_SANDSTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_REDSTONE_LAMP_OFF ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_REDSTONE_LAMP_ON ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_REDSTONE_ORE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_REPEATING_COMMAND_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_SANDSTONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_SAND ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_SILVERFISH_EGG ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_SPONGE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_STAINED_CLAY ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_STONE ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_STONE_BRICKS ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_STRUCTURE_BLOCK ].m_FullyOccupiesVoxel = true;
- Info[E_BLOCK_WOOL ].m_FullyOccupiesVoxel = true;
-
-
- // Blocks that can be terraformed
- Info[E_BLOCK_COAL_ORE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_COBBLESTONE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_DIAMOND_ORE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_DIRT ].m_CanBeTerraformed = true;
- Info[E_BLOCK_GOLD_ORE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_GRASS ].m_CanBeTerraformed = true;
- Info[E_BLOCK_GRAVEL ].m_CanBeTerraformed = true;
- Info[E_BLOCK_HARDENED_CLAY ].m_CanBeTerraformed = true;
- Info[E_BLOCK_IRON_ORE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_MYCELIUM ].m_CanBeTerraformed = true;
- Info[E_BLOCK_NETHERRACK ].m_CanBeTerraformed = true;
- Info[E_BLOCK_REDSTONE_ORE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_CanBeTerraformed = true;
- Info[E_BLOCK_SAND ].m_CanBeTerraformed = true;
- Info[E_BLOCK_SANDSTONE ].m_CanBeTerraformed = true;
- Info[E_BLOCK_SOULSAND ].m_CanBeTerraformed = true;
- Info[E_BLOCK_STAINED_CLAY ].m_CanBeTerraformed = true;
- Info[E_BLOCK_STONE ].m_CanBeTerraformed = true;
+float cBlockInfo::GetBlockHeight(const BLOCKTYPE Block)
+{
// Block heights:
- Info[E_BLOCK_BED ].m_BlockHeight = 0.5625; // 9 pixels
- Info[E_BLOCK_CAKE ].m_BlockHeight = 0.5; // 8 pixels
- Info[E_BLOCK_ENCHANTMENT_TABLE ].m_BlockHeight = 0.75; // 12 pixels
- Info[E_BLOCK_PURPUR_SLAB ].m_BlockHeight = 0.5;
- Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_BlockHeight = 0.5;
- Info[E_BLOCK_STONE_SLAB ].m_BlockHeight = 0.5;
- Info[E_BLOCK_WOODEN_SLAB ].m_BlockHeight = 0.5;
- Info[E_BLOCK_SNOW ].m_BlockHeight = 0.125; // one layer is 1 / 8 (2 pixels) tall
- Info[E_BLOCK_ACACIA_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_ACACIA_FENCE_GATE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_BIRCH_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_BIRCH_FENCE_GATE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_DARK_OAK_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_DARK_OAK_FENCE_GATE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_OAK_FENCE_GATE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_JUNGLE_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_JUNGLE_FENCE_GATE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_SPRUCE_FENCE ].m_BlockHeight = 1.5;
- Info[E_BLOCK_SPRUCE_FENCE_GATE ].m_BlockHeight = 1.5;
+ switch (Block)
+ {
+ case E_BLOCK_ACACIA_FENCE: return 1.5;
+ case E_BLOCK_ACACIA_FENCE_GATE: return 1.5;
+ case E_BLOCK_BED: return 0.5625; // 9 pixels
+ case E_BLOCK_BIRCH_FENCE: return 1.5;
+ case E_BLOCK_BIRCH_FENCE_GATE: return 1.5;
+ case E_BLOCK_CAKE: return 0.5; // 8 pixels
+ case E_BLOCK_DARK_OAK_FENCE: return 1.5;
+ case E_BLOCK_DARK_OAK_FENCE_GATE: return 1.5;
+ case E_BLOCK_ENCHANTMENT_TABLE: return 0.75; // 12 pixels
+ case E_BLOCK_FENCE: return 1.5;
+ case E_BLOCK_JUNGLE_FENCE: return 1.5;
+ case E_BLOCK_JUNGLE_FENCE_GATE: return 1.5;
+ case E_BLOCK_OAK_FENCE_GATE: return 1.5;
+ case E_BLOCK_PURPUR_SLAB: return 0.5;
+ case E_BLOCK_RED_SANDSTONE_SLAB: return 0.5;
+ case E_BLOCK_SNOW: return 0.125; // one layer is 1 / 8 (2 pixels) tall
+ case E_BLOCK_SPRUCE_FENCE: return 1.5;
+ case E_BLOCK_SPRUCE_FENCE_GATE: return 1.5;
+ case E_BLOCK_STONE_SLAB: return 0.5;
+ case E_BLOCK_WOODEN_SLAB: return 0.5;
+ default: return 1;
+ }
+}
+
+
+
+float cBlockInfo::GetHardness(const BLOCKTYPE Block)
+{
// Block hardness:
- Info[E_BLOCK_AIR ].m_Hardness = 0.0f;
- Info[E_BLOCK_STONE ].m_Hardness = 1.5f;
- Info[E_BLOCK_GRASS ].m_Hardness = 0.6f;
- Info[E_BLOCK_DIRT ].m_Hardness = 0.5f;
- Info[E_BLOCK_COBBLESTONE ].m_Hardness = 2.0f;
- Info[E_BLOCK_PLANKS ].m_Hardness = 2.0f;
- Info[E_BLOCK_SAPLING ].m_Hardness = 0.0f;
- Info[E_BLOCK_BEDROCK ].m_Hardness = -1.0f;
- Info[E_BLOCK_WATER ].m_Hardness = 100.0f;
- Info[E_BLOCK_STATIONARY_WATER ].m_Hardness = 100.0f;
- Info[E_BLOCK_LAVA ].m_Hardness = 100.0f;
- Info[E_BLOCK_STATIONARY_LAVA ].m_Hardness = 100.0f;
- Info[E_BLOCK_SAND ].m_Hardness = 0.5f;
- Info[E_BLOCK_GRAVEL ].m_Hardness = 0.6f;
- Info[E_BLOCK_GOLD_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_IRON_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_COAL_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_LOG ].m_Hardness = 2.0f;
- Info[E_BLOCK_LEAVES ].m_Hardness = 0.2f;
- Info[E_BLOCK_SPONGE ].m_Hardness = 0.6f;
- Info[E_BLOCK_GLASS ].m_Hardness = 0.3f;
- Info[E_BLOCK_LAPIS_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_LAPIS_BLOCK ].m_Hardness = 3.0f;
- Info[E_BLOCK_DISPENSER ].m_Hardness = 3.5f;
- Info[E_BLOCK_SANDSTONE ].m_Hardness = 0.8f;
- Info[E_BLOCK_NOTE_BLOCK ].m_Hardness = 0.8f;
- Info[E_BLOCK_BED ].m_Hardness = 0.2f;
- Info[E_BLOCK_POWERED_RAIL ].m_Hardness = 0.7f;
- Info[E_BLOCK_DETECTOR_RAIL ].m_Hardness = 0.7f;
- Info[E_BLOCK_STICKY_PISTON ].m_Hardness = 0.5f;
- Info[E_BLOCK_COBWEB ].m_Hardness = 4.0f;
- Info[E_BLOCK_TALL_GRASS ].m_Hardness = 0.0f;
- Info[E_BLOCK_DEAD_BUSH ].m_Hardness = 0.0f;
- Info[E_BLOCK_PISTON ].m_Hardness = 0.5f;
- Info[E_BLOCK_PISTON_EXTENSION ].m_Hardness = 0.5f;
- Info[E_BLOCK_WOOL ].m_Hardness = 0.8f;
- Info[E_BLOCK_PISTON_MOVED_BLOCK ].m_Hardness = -1.0f;
- Info[E_BLOCK_DANDELION ].m_Hardness = 0.0f;
- Info[E_BLOCK_FLOWER ].m_Hardness = 0.0f;
- Info[E_BLOCK_BROWN_MUSHROOM ].m_Hardness = 0.0f;
- Info[E_BLOCK_RED_MUSHROOM ].m_Hardness = 0.0f;
- Info[E_BLOCK_GOLD_BLOCK ].m_Hardness = 3.0f;
- Info[E_BLOCK_IRON_BLOCK ].m_Hardness = 5.0f;
- Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_STONE_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_BRICK ].m_Hardness = 2.0f;
- Info[E_BLOCK_TNT ].m_Hardness = 0.0f;
- Info[E_BLOCK_BOOKCASE ].m_Hardness = 1.5f;
- Info[E_BLOCK_MOSSY_COBBLESTONE ].m_Hardness = 2.0f;
- Info[E_BLOCK_OBSIDIAN ].m_Hardness = 50.0f;
- Info[E_BLOCK_TORCH ].m_Hardness = 0.0f;
- Info[E_BLOCK_FIRE ].m_Hardness = 0.0f;
- Info[E_BLOCK_MOB_SPAWNER ].m_Hardness = 5.0f;
- Info[E_BLOCK_OAK_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_CHEST ].m_Hardness = 2.5f;
- Info[E_BLOCK_REDSTONE_WIRE ].m_Hardness = 0.0f;
- Info[E_BLOCK_DIAMOND_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_DIAMOND_BLOCK ].m_Hardness = 5.0f;
- Info[E_BLOCK_CRAFTING_TABLE ].m_Hardness = 2.5f;
- Info[E_BLOCK_CROPS ].m_Hardness = 0.0f;
- Info[E_BLOCK_FARMLAND ].m_Hardness = 0.6f;
- Info[E_BLOCK_FURNACE ].m_Hardness = 3.5f;
- Info[E_BLOCK_LIT_FURNACE ].m_Hardness = 3.5f;
- Info[E_BLOCK_SIGN_POST ].m_Hardness = 1.0f;
- Info[E_BLOCK_OAK_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_LADDER ].m_Hardness = 0.4f;
- Info[E_BLOCK_RAIL ].m_Hardness = 0.7f;
- Info[E_BLOCK_COBBLESTONE_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_WALLSIGN ].m_Hardness = 1.0f;
- Info[E_BLOCK_LEVER ].m_Hardness = 0.5f;
- Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_Hardness = 0.5f;
- Info[E_BLOCK_IRON_DOOR ].m_Hardness = 5.0f;
- Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_Hardness = 0.5f;
- Info[E_BLOCK_REDSTONE_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_Hardness = 0.625f;
- Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_Hardness = 0.0f;
- Info[E_BLOCK_REDSTONE_TORCH_ON ].m_Hardness = 0.0f;
- Info[E_BLOCK_STONE_BUTTON ].m_Hardness = 0.5f;
- Info[E_BLOCK_SNOW ].m_Hardness = 0.1f;
- Info[E_BLOCK_ICE ].m_Hardness = 0.5f;
- Info[E_BLOCK_SNOW_BLOCK ].m_Hardness = 0.2f;
- Info[E_BLOCK_CACTUS ].m_Hardness = 0.4f;
- Info[E_BLOCK_CLAY ].m_Hardness = 0.6f;
- Info[E_BLOCK_SUGARCANE ].m_Hardness = 0.0f;
- Info[E_BLOCK_JUKEBOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_PUMPKIN ].m_Hardness = 1.0f;
- Info[E_BLOCK_NETHERRACK ].m_Hardness = 0.4f;
- Info[E_BLOCK_SOULSAND ].m_Hardness = 0.5f;
- Info[E_BLOCK_GLOWSTONE ].m_Hardness = 0.3f;
- Info[E_BLOCK_NETHER_PORTAL ].m_Hardness = -1.0f;
- Info[E_BLOCK_JACK_O_LANTERN ].m_Hardness = 1.0f;
- Info[E_BLOCK_CAKE ].m_Hardness = 0.5f;
- Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_Hardness = 0.0f;
- Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_Hardness = 0.0f;
- Info[E_BLOCK_STAINED_GLASS ].m_Hardness = 0.3f;
- Info[E_BLOCK_TRAPDOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_SILVERFISH_EGG ].m_Hardness = 0.75f;
- Info[E_BLOCK_STONE_BRICKS ].m_Hardness = 1.5f;
- Info[E_BLOCK_HUGE_BROWN_MUSHROOM ].m_Hardness = 0.2f;
- Info[E_BLOCK_HUGE_RED_MUSHROOM ].m_Hardness = 0.2f;
- Info[E_BLOCK_IRON_BARS ].m_Hardness = 5.0f;
- Info[E_BLOCK_GLASS_PANE ].m_Hardness = 0.3f;
- Info[E_BLOCK_MELON ].m_Hardness = 1.0f;
- Info[E_BLOCK_PUMPKIN_STEM ].m_Hardness = 0.0f;
- Info[E_BLOCK_MELON_STEM ].m_Hardness = 0.0f;
- Info[E_BLOCK_VINES ].m_Hardness = 0.2f;
- Info[E_BLOCK_OAK_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_BRICK_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_STONE_BRICK_STAIRS ].m_Hardness = 1.5f;
- Info[E_BLOCK_MYCELIUM ].m_Hardness = 0.6f;
- Info[E_BLOCK_LILY_PAD ].m_Hardness = 0.0f;
- Info[E_BLOCK_NETHER_BRICK ].m_Hardness = 2.0f;
- Info[E_BLOCK_NETHER_BRICK_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_NETHER_BRICK_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_NETHER_WART ].m_Hardness = 0.0f;
- Info[E_BLOCK_ENCHANTMENT_TABLE ].m_Hardness = 5.0f;
- Info[E_BLOCK_BREWING_STAND ].m_Hardness = 0.5f;
- Info[E_BLOCK_CAULDRON ].m_Hardness = 2.0f;
- Info[E_BLOCK_END_PORTAL ].m_Hardness = -1.0f;
- Info[E_BLOCK_END_PORTAL_FRAME ].m_Hardness = -1.0f;
- Info[E_BLOCK_END_STONE ].m_Hardness = 3.0f;
- Info[E_BLOCK_DRAGON_EGG ].m_Hardness = 3.0f;
- Info[E_BLOCK_REDSTONE_LAMP_OFF ].m_Hardness = 0.3f;
- Info[E_BLOCK_REDSTONE_LAMP_ON ].m_Hardness = 0.3f;
- Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_WOODEN_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_COCOA_POD ].m_Hardness = 0.2f;
- Info[E_BLOCK_SANDSTONE_STAIRS ].m_Hardness = 0.8f;
- Info[E_BLOCK_EMERALD_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_ENDER_CHEST ].m_Hardness = 22.5f;
- Info[E_BLOCK_TRIPWIRE_HOOK ].m_Hardness = 0.0f;
- Info[E_BLOCK_TRIPWIRE ].m_Hardness = 0.0f;
- Info[E_BLOCK_EMERALD_BLOCK ].m_Hardness = 5.0f;
- Info[E_BLOCK_SPRUCE_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_BIRCH_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_JUNGLE_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_COMMAND_BLOCK ].m_Hardness = -1.0f;
- Info[E_BLOCK_BEACON ].m_Hardness = 3.0f;
- Info[E_BLOCK_COBBLESTONE_WALL ].m_Hardness = 2.0f;
- Info[E_BLOCK_FLOWER_POT ].m_Hardness = 0.0f;
- Info[E_BLOCK_CARROTS ].m_Hardness = 0.0f;
- Info[E_BLOCK_POTATOES ].m_Hardness = 0.0f;
- Info[E_BLOCK_WOODEN_BUTTON ].m_Hardness = 0.5f;
- Info[E_BLOCK_HEAD ].m_Hardness = 1.0f;
- Info[E_BLOCK_ANVIL ].m_Hardness = 5.0f;
- Info[E_BLOCK_TRAPPED_CHEST ].m_Hardness = 2.5f;
- Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE].m_Hardness = 0.5f;
- Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE].m_Hardness = 0.5f;
- Info[E_BLOCK_INACTIVE_COMPARATOR ].m_Hardness = 0.0f;
- Info[E_BLOCK_ACTIVE_COMPARATOR ].m_Hardness = 0.0f;
- Info[E_BLOCK_DAYLIGHT_SENSOR ].m_Hardness = 0.2f;
- Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_Hardness = 5.0f;
- Info[E_BLOCK_NETHER_QUARTZ_ORE ].m_Hardness = 3.0f;
- Info[E_BLOCK_HOPPER ].m_Hardness = 3.0f;
- Info[E_BLOCK_QUARTZ_BLOCK ].m_Hardness = 0.8f;
- Info[E_BLOCK_QUARTZ_STAIRS ].m_Hardness = 0.8f;
- Info[E_BLOCK_ACTIVATOR_RAIL ].m_Hardness = 0.7f;
- Info[E_BLOCK_DROPPER ].m_Hardness = 3.5f;
- Info[E_BLOCK_STAINED_CLAY ].m_Hardness = 4.2f;
- Info[E_BLOCK_STAINED_GLASS_PANE ].m_Hardness = 0.3f;
- Info[E_BLOCK_NEW_LEAVES ].m_Hardness = 0.2f;
- Info[E_BLOCK_NEW_LOG ].m_Hardness = 2.0f;
- Info[E_BLOCK_ACACIA_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_DARK_OAK_WOOD_STAIRS ].m_Hardness = 2.0f;
- Info[E_BLOCK_SLIME_BLOCK ].m_Hardness = 0.0f;
- Info[E_BLOCK_BARRIER ].m_Hardness = -1.0f;
- Info[E_BLOCK_IRON_TRAPDOOR ].m_Hardness = 5.0f;
- Info[E_BLOCK_PRISMARINE_BLOCK ].m_Hardness = 1.5f;
- Info[E_BLOCK_SEA_LANTERN ].m_Hardness = 0.3f;
- Info[E_BLOCK_HAY_BALE ].m_Hardness = 0.5f;
- Info[E_BLOCK_CARPET ].m_Hardness = 0.1f;
- Info[E_BLOCK_HARDENED_CLAY ].m_Hardness = 1.25f;
- Info[E_BLOCK_BLOCK_OF_COAL ].m_Hardness = 5.0f;
- Info[E_BLOCK_PACKED_ICE ].m_Hardness = 0.5f;
- Info[E_BLOCK_BIG_FLOWER ].m_Hardness = 0.0f;
- Info[E_BLOCK_STANDING_BANNER ].m_Hardness = 1.0f;
- Info[E_BLOCK_WALL_BANNER ].m_Hardness = 1.0f;
- Info[E_BLOCK_INVERTED_DAYLIGHT_SENSOR ].m_Hardness = 0.2f;
- Info[E_BLOCK_RED_SANDSTONE ].m_Hardness = 0.8f;
- Info[E_BLOCK_RED_SANDSTONE_STAIRS ].m_Hardness = 0.8f;
- Info[E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_RED_SANDSTONE_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_SPRUCE_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_BIRCH_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_JUNGLE_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_DARK_OAK_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_ACACIA_FENCE_GATE ].m_Hardness = 2.0f;
- Info[E_BLOCK_SPRUCE_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_BIRCH_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_JUNGLE_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_DARK_OAK_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_ACACIA_FENCE ].m_Hardness = 2.0f;
- Info[E_BLOCK_SPRUCE_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_BIRCH_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_JUNGLE_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_ACACIA_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_DARK_OAK_DOOR ].m_Hardness = 3.0f;
- Info[E_BLOCK_END_ROD ].m_Hardness = 0.0f;
- Info[E_BLOCK_CHORUS_PLANT ].m_Hardness = 0.4f;
- Info[E_BLOCK_CHORUS_FLOWER ].m_Hardness = 0.4f;
- Info[E_BLOCK_PURPUR_BLOCK ].m_Hardness = 1.5f;
- Info[E_BLOCK_PURPUR_DOUBLE_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_PURPUR_PILLAR ].m_Hardness = 1.5f;
- Info[E_BLOCK_PURPUR_SLAB ].m_Hardness = 2.0f;
- Info[E_BLOCK_PURPUR_STAIRS ].m_Hardness = 1.5f;
- Info[E_BLOCK_END_BRICKS ].m_Hardness = 0.8f;
- Info[E_BLOCK_BEETROOTS ].m_Hardness = 0.0f;
- Info[E_BLOCK_GRASS_PATH ].m_Hardness = 0.6f;
- Info[E_BLOCK_END_GATEWAY ].m_Hardness = -1.0f;
- Info[E_BLOCK_REPEATING_COMMAND_BLOCK ].m_Hardness = -1.0f;
- Info[E_BLOCK_CHAIN_COMMAND_BLOCK ].m_Hardness = -1.0f;
- Info[E_BLOCK_FROSTED_ICE ].m_Hardness = 0.5f;
- Info[E_BLOCK_MAGMA ].m_Hardness = 0.5f;
- Info[E_BLOCK_NETHER_WART_BLOCK ].m_Hardness = 1.0f;
- Info[E_BLOCK_RED_NETHER_BRICK ].m_Hardness = 2.0f;
- Info[E_BLOCK_BONE_BLOCK ].m_Hardness = 2.0f;
- Info[E_BLOCK_END_BRICKS ].m_Hardness = 0.8f;
- Info[E_BLOCK_STRUCTURE_VOID ].m_Hardness = 0.0f;
- Info[E_BLOCK_OBSERVER ].m_Hardness = 3.5f;
- Info[E_BLOCK_WHITE_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_ORANGE_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_MAGENTA_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_LIGHT_BLUE_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_YELLOW_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_LIME_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_PINK_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_GRAY_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_LIGHT_GRAY_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_CYAN_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_PURPLE_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_BLUE_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_BROWN_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_GREEN_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_RED_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_BLACK_SHULKER_BOX ].m_Hardness = 2.0f;
- Info[E_BLOCK_WHITE_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_ORANGE_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_MAGENTA_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_YELLOW_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_LIME_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_PINK_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_GRAY_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_CYAN_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_PURPLE_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_BLUE_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_BROWN_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_GREEN_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_RED_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_BLACK_GLAZED_TERRACOTTA ].m_Hardness = 1.4f;
- Info[E_BLOCK_CONCRETE ].m_Hardness = 1.8f;
- Info[E_BLOCK_CONCRETE_POWDER ].m_Hardness = 0.5f;
- Info[E_BLOCK_STRUCTURE_BLOCK ].m_Hardness = -1.0f;
-
- for (size_t i = 0; i < Info.size(); ++i)
+ switch (Block)
{
- Info[i].m_IsRainBlocker |= Info[i].m_IsSolid;
+ case E_BLOCK_ACACIA_DOOR: return 3.0f;
+ case E_BLOCK_ACACIA_FENCE: return 2.0f;
+ case E_BLOCK_ACACIA_FENCE_GATE: return 2.0f;
+ case E_BLOCK_ACACIA_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_ACTIVATOR_RAIL: return 0.7f;
+ case E_BLOCK_ACTIVE_COMPARATOR: return 0.0f;
+ case E_BLOCK_AIR: return 0.0f;
+ case E_BLOCK_ANVIL: return 5.0f;
+ case E_BLOCK_BARRIER: return -1.0f;
+ case E_BLOCK_BEACON: return 3.0f;
+ case E_BLOCK_BED: return 0.2f;
+ case E_BLOCK_BEDROCK: return -1.0f;
+ case E_BLOCK_BEETROOTS: return 0.0f;
+ case E_BLOCK_BIG_FLOWER: return 0.0f;
+ case E_BLOCK_BIRCH_DOOR: return 3.0f;
+ case E_BLOCK_BIRCH_FENCE: return 2.0f;
+ case E_BLOCK_BIRCH_FENCE_GATE: return 2.0f;
+ case E_BLOCK_BIRCH_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_BLACK_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_BLACK_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_BLOCK_OF_COAL: return 5.0f;
+ case E_BLOCK_BLOCK_OF_REDSTONE: return 5.0f;
+ case E_BLOCK_BLUE_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_BLUE_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_BONE_BLOCK: return 2.0f;
+ case E_BLOCK_BOOKCASE: return 1.5f;
+ case E_BLOCK_BREWING_STAND: return 0.5f;
+ case E_BLOCK_BRICK: return 2.0f;
+ case E_BLOCK_BRICK_STAIRS: return 2.0f;
+ case E_BLOCK_BROWN_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_BROWN_MUSHROOM: return 0.0f;
+ case E_BLOCK_BROWN_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_CACTUS: return 0.4f;
+ case E_BLOCK_CAKE: return 0.5f;
+ case E_BLOCK_CARPET: return 0.1f;
+ case E_BLOCK_CARROTS: return 0.0f;
+ case E_BLOCK_CAULDRON: return 2.0f;
+ case E_BLOCK_CHAIN_COMMAND_BLOCK: return -1.0f;
+ case E_BLOCK_CHEST: return 2.5f;
+ case E_BLOCK_CHORUS_FLOWER: return 0.4f;
+ case E_BLOCK_CHORUS_PLANT: return 0.4f;
+ case E_BLOCK_CLAY: return 0.6f;
+ case E_BLOCK_COAL_ORE: return 3.0f;
+ case E_BLOCK_COBBLESTONE: return 2.0f;
+ case E_BLOCK_COBBLESTONE_STAIRS: return 2.0f;
+ case E_BLOCK_COBBLESTONE_WALL: return 2.0f;
+ case E_BLOCK_COBWEB: return 4.0f;
+ case E_BLOCK_COCOA_POD: return 0.2f;
+ case E_BLOCK_COMMAND_BLOCK: return -1.0f;
+ case E_BLOCK_CONCRETE: return 1.8f;
+ case E_BLOCK_CONCRETE_POWDER: return 0.5f;
+ case E_BLOCK_CRAFTING_TABLE: return 2.5f;
+ case E_BLOCK_CROPS: return 0.0f;
+ case E_BLOCK_CYAN_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_CYAN_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_DANDELION: return 0.0f;
+ case E_BLOCK_DARK_OAK_DOOR: return 3.0f;
+ case E_BLOCK_DARK_OAK_FENCE: return 2.0f;
+ case E_BLOCK_DARK_OAK_FENCE_GATE: return 2.0f;
+ case E_BLOCK_DARK_OAK_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_DAYLIGHT_SENSOR: return 0.2f;
+ case E_BLOCK_DEAD_BUSH: return 0.0f;
+ case E_BLOCK_DETECTOR_RAIL: return 0.7f;
+ case E_BLOCK_DIAMOND_BLOCK: return 5.0f;
+ case E_BLOCK_DIAMOND_ORE: return 3.0f;
+ case E_BLOCK_DIRT: return 0.5f;
+ case E_BLOCK_DISPENSER: return 3.5f;
+ case E_BLOCK_DOUBLE_RED_SANDSTONE_SLAB: return 2.0f;
+ case E_BLOCK_DOUBLE_STONE_SLAB: return 2.0f;
+ case E_BLOCK_DOUBLE_WOODEN_SLAB: return 2.0f;
+ case E_BLOCK_DRAGON_EGG: return 3.0f;
+ case E_BLOCK_DROPPER: return 3.5f;
+ case E_BLOCK_EMERALD_BLOCK: return 5.0f;
+ case E_BLOCK_EMERALD_ORE: return 3.0f;
+ case E_BLOCK_ENCHANTMENT_TABLE: return 5.0f;
+ case E_BLOCK_ENDER_CHEST: return 22.5f;
+ case E_BLOCK_END_BRICKS: return 0.8f;
+ case E_BLOCK_END_GATEWAY: return -1.0f;
+ case E_BLOCK_END_PORTAL: return -1.0f;
+ case E_BLOCK_END_PORTAL_FRAME: return -1.0f;
+ case E_BLOCK_END_ROD: return 0.0f;
+ case E_BLOCK_END_STONE: return 3.0f;
+ case E_BLOCK_FARMLAND: return 0.6f;
+ case E_BLOCK_FENCE: return 2.0f;
+ case E_BLOCK_FIRE: return 0.0f;
+ case E_BLOCK_FLOWER: return 0.0f;
+ case E_BLOCK_FLOWER_POT: return 0.0f;
+ case E_BLOCK_FROSTED_ICE: return 0.5f;
+ case E_BLOCK_FURNACE: return 3.5f;
+ case E_BLOCK_GLASS: return 0.3f;
+ case E_BLOCK_GLASS_PANE: return 0.3f;
+ case E_BLOCK_GLOWSTONE: return 0.3f;
+ case E_BLOCK_GOLD_BLOCK: return 3.0f;
+ case E_BLOCK_GOLD_ORE: return 3.0f;
+ case E_BLOCK_GRASS: return 0.6f;
+ case E_BLOCK_GRASS_PATH: return 0.6f;
+ case E_BLOCK_GRAVEL: return 0.6f;
+ case E_BLOCK_GRAY_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_GRAY_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_GREEN_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_GREEN_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_HARDENED_CLAY: return 1.25f;
+ case E_BLOCK_HAY_BALE: return 0.5f;
+ case E_BLOCK_HEAD: return 1.0f;
+ case E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE: return 0.5f;
+ case E_BLOCK_HOPPER: return 3.0f;
+ case E_BLOCK_HUGE_BROWN_MUSHROOM: return 0.2f;
+ case E_BLOCK_HUGE_RED_MUSHROOM: return 0.2f;
+ case E_BLOCK_ICE: return 0.5f;
+ case E_BLOCK_INACTIVE_COMPARATOR: return 0.0f;
+ case E_BLOCK_INVERTED_DAYLIGHT_SENSOR: return 0.2f;
+ case E_BLOCK_IRON_BARS: return 5.0f;
+ case E_BLOCK_IRON_BLOCK: return 5.0f;
+ case E_BLOCK_IRON_DOOR: return 5.0f;
+ case E_BLOCK_IRON_ORE: return 3.0f;
+ case E_BLOCK_IRON_TRAPDOOR: return 5.0f;
+ case E_BLOCK_JACK_O_LANTERN: return 1.0f;
+ case E_BLOCK_JUKEBOX: return 2.0f;
+ case E_BLOCK_JUNGLE_DOOR: return 3.0f;
+ case E_BLOCK_JUNGLE_FENCE: return 2.0f;
+ case E_BLOCK_JUNGLE_FENCE_GATE: return 2.0f;
+ case E_BLOCK_JUNGLE_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_LADDER: return 0.4f;
+ case E_BLOCK_LAPIS_BLOCK: return 3.0f;
+ case E_BLOCK_LAPIS_ORE: return 3.0f;
+ case E_BLOCK_LAVA: return 100.0f;
+ case E_BLOCK_LEAVES: return 0.2f;
+ case E_BLOCK_LEVER: return 0.5f;
+ case E_BLOCK_LIGHT_BLUE_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_LIGHT_BLUE_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_LIGHT_GRAY_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_LIGHT_GRAY_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE: return 0.5f;
+ case E_BLOCK_LILY_PAD: return 0.0f;
+ case E_BLOCK_LIME_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_LIME_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_LIT_FURNACE: return 3.5f;
+ case E_BLOCK_LOG: return 2.0f;
+ case E_BLOCK_MAGENTA_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_MAGENTA_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_MAGMA: return 0.5f;
+ case E_BLOCK_MELON: return 1.0f;
+ case E_BLOCK_MELON_STEM: return 0.0f;
+ case E_BLOCK_MOB_SPAWNER: return 5.0f;
+ case E_BLOCK_MOSSY_COBBLESTONE: return 2.0f;
+ case E_BLOCK_MYCELIUM: return 0.6f;
+ case E_BLOCK_NETHERRACK: return 0.4f;
+ case E_BLOCK_NETHER_BRICK: return 2.0f;
+ case E_BLOCK_NETHER_BRICK_FENCE: return 2.0f;
+ case E_BLOCK_NETHER_BRICK_STAIRS: return 2.0f;
+ case E_BLOCK_NETHER_PORTAL: return -1.0f;
+ case E_BLOCK_NETHER_QUARTZ_ORE: return 3.0f;
+ case E_BLOCK_NETHER_WART: return 0.0f;
+ case E_BLOCK_NETHER_WART_BLOCK: return 1.0f;
+ case E_BLOCK_NEW_LEAVES: return 0.2f;
+ case E_BLOCK_NEW_LOG: return 2.0f;
+ case E_BLOCK_NOTE_BLOCK: return 0.8f;
+ case E_BLOCK_OAK_DOOR: return 3.0f;
+ case E_BLOCK_OAK_FENCE_GATE: return 2.0f;
+ case E_BLOCK_OAK_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_OBSERVER: return 3.5f;
+ case E_BLOCK_OBSIDIAN: return 50.0f;
+ case E_BLOCK_ORANGE_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_ORANGE_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_PACKED_ICE: return 0.5f;
+ case E_BLOCK_PINK_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_PINK_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_PISTON: return 0.5f;
+ case E_BLOCK_PISTON_EXTENSION: return 0.5f;
+ case E_BLOCK_PISTON_MOVED_BLOCK: return -1.0f;
+ case E_BLOCK_PLANKS: return 2.0f;
+ case E_BLOCK_POTATOES: return 0.0f;
+ case E_BLOCK_POWERED_RAIL: return 0.7f;
+ case E_BLOCK_PRISMARINE_BLOCK: return 1.5f;
+ case E_BLOCK_PUMPKIN: return 1.0f;
+ case E_BLOCK_PUMPKIN_STEM: return 0.0f;
+ case E_BLOCK_PURPLE_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_PURPLE_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_PURPUR_BLOCK: return 1.5f;
+ case E_BLOCK_PURPUR_DOUBLE_SLAB: return 2.0f;
+ case E_BLOCK_PURPUR_PILLAR: return 1.5f;
+ case E_BLOCK_PURPUR_SLAB: return 2.0f;
+ case E_BLOCK_PURPUR_STAIRS: return 1.5f;
+ case E_BLOCK_QUARTZ_BLOCK: return 0.8f;
+ case E_BLOCK_QUARTZ_STAIRS: return 0.8f;
+ case E_BLOCK_RAIL: return 0.7f;
+ case E_BLOCK_REDSTONE_LAMP_OFF: return 0.3f;
+ case E_BLOCK_REDSTONE_LAMP_ON: return 0.3f;
+ case E_BLOCK_REDSTONE_ORE: return 3.0f;
+ case E_BLOCK_REDSTONE_ORE_GLOWING: return 0.625f;
+ case E_BLOCK_REDSTONE_REPEATER_OFF: return 0.0f;
+ case E_BLOCK_REDSTONE_REPEATER_ON: return 0.0f;
+ case E_BLOCK_REDSTONE_TORCH_OFF: return 0.0f;
+ case E_BLOCK_REDSTONE_TORCH_ON: return 0.0f;
+ case E_BLOCK_REDSTONE_WIRE: return 0.0f;
+ case E_BLOCK_RED_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_RED_MUSHROOM: return 0.0f;
+ case E_BLOCK_RED_NETHER_BRICK: return 2.0f;
+ case E_BLOCK_RED_SANDSTONE: return 0.8f;
+ case E_BLOCK_RED_SANDSTONE_SLAB: return 2.0f;
+ case E_BLOCK_RED_SANDSTONE_STAIRS: return 0.8f;
+ case E_BLOCK_RED_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_REPEATING_COMMAND_BLOCK: return -1.0f;
+ case E_BLOCK_SAND: return 0.5f;
+ case E_BLOCK_SANDSTONE: return 0.8f;
+ case E_BLOCK_SANDSTONE_STAIRS: return 0.8f;
+ case E_BLOCK_SAPLING: return 0.0f;
+ case E_BLOCK_SEA_LANTERN: return 0.3f;
+ case E_BLOCK_SIGN_POST: return 1.0f;
+ case E_BLOCK_SILVERFISH_EGG: return 0.75f;
+ case E_BLOCK_SLIME_BLOCK: return 0.0f;
+ case E_BLOCK_SNOW: return 0.1f;
+ case E_BLOCK_SNOW_BLOCK: return 0.2f;
+ case E_BLOCK_SOULSAND: return 0.5f;
+ case E_BLOCK_SPONGE: return 0.6f;
+ case E_BLOCK_SPRUCE_DOOR: return 3.0f;
+ case E_BLOCK_SPRUCE_FENCE: return 2.0f;
+ case E_BLOCK_SPRUCE_FENCE_GATE: return 2.0f;
+ case E_BLOCK_SPRUCE_WOOD_STAIRS: return 2.0f;
+ case E_BLOCK_STAINED_CLAY: return 4.2f;
+ case E_BLOCK_STAINED_GLASS: return 0.3f;
+ case E_BLOCK_STAINED_GLASS_PANE: return 0.3f;
+ case E_BLOCK_STANDING_BANNER: return 1.0f;
+ case E_BLOCK_STATIONARY_LAVA: return 100.0f;
+ case E_BLOCK_STATIONARY_WATER: return 100.0f;
+ case E_BLOCK_STICKY_PISTON: return 0.5f;
+ case E_BLOCK_STONE: return 1.5f;
+ case E_BLOCK_STONE_BRICKS: return 1.5f;
+ case E_BLOCK_STONE_BRICK_STAIRS: return 1.5f;
+ case E_BLOCK_STONE_BUTTON: return 0.5f;
+ case E_BLOCK_STONE_PRESSURE_PLATE: return 0.5f;
+ case E_BLOCK_STONE_SLAB: return 2.0f;
+ case E_BLOCK_STRUCTURE_BLOCK: return -1.0f;
+ case E_BLOCK_STRUCTURE_VOID: return 0.0f;
+ case E_BLOCK_SUGARCANE: return 0.0f;
+ case E_BLOCK_TALL_GRASS: return 0.0f;
+ case E_BLOCK_TNT: return 0.0f;
+ case E_BLOCK_TORCH: return 0.0f;
+ case E_BLOCK_TRAPDOOR: return 3.0f;
+ case E_BLOCK_TRAPPED_CHEST: return 2.5f;
+ case E_BLOCK_TRIPWIRE: return 0.0f;
+ case E_BLOCK_TRIPWIRE_HOOK: return 0.0f;
+ case E_BLOCK_VINES: return 0.2f;
+ case E_BLOCK_WALLSIGN: return 1.0f;
+ case E_BLOCK_WALL_BANNER: return 1.0f;
+ case E_BLOCK_WATER: return 100.0f;
+ case E_BLOCK_WHITE_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_WHITE_SHULKER_BOX: return 2.0f;
+ case E_BLOCK_WOODEN_BUTTON: return 0.5f;
+ case E_BLOCK_WOODEN_PRESSURE_PLATE: return 0.5f;
+ case E_BLOCK_WOODEN_SLAB: return 2.0f;
+ case E_BLOCK_WOOL: return 0.8f;
+ case E_BLOCK_YELLOW_GLAZED_TERRACOTTA: return 1.4f;
+ case E_BLOCK_YELLOW_SHULKER_BOX: return 2.0f;
+ default: return 0;
}
}
diff --git a/src/BlockInfo.h b/src/BlockInfo.h
index 8962f6328..7a25e6760 100644
--- a/src/BlockInfo.h
+++ b/src/BlockInfo.h
@@ -6,42 +6,11 @@
+
// tolua_begin
class cBlockInfo
{
public:
- // tolua_end
-
- /** The block type associated with this cBlockInfo. Needed for DeprecatedBindings.cpp */
- BLOCKTYPE m_BlockType;
-
- /** Returns the associated BlockInfo structure for the specified block type.
- This accessor makes sure that the cBlockInfo structures are properly initialized exactly once.
- It does so by using the C++ singleton approximation - storing the actual singleton as the function's static variable. */
- inline static const cBlockInfo & Get(BLOCKTYPE a_Type);
-
- // tolua_begin
-
- inline static NIBBLETYPE GetLightValue (BLOCKTYPE a_Type) { return Get(a_Type).m_LightValue; }
- inline static NIBBLETYPE GetSpreadLightFalloff(BLOCKTYPE a_Type) { return Get(a_Type).m_SpreadLightFalloff; }
- inline static bool IsTransparent (BLOCKTYPE a_Type) { return Get(a_Type).m_Transparent; }
- /** Warning: IsOneHitDig does not take into account enchantments / status effects / swim state / floating state
- and therefore may be incorrect. Only use to check if hardness is 0
- If you want to check if a player would instantly mine a_Block use cPlayer::CanInstantlyMine(a_Block) */
- inline static bool IsOneHitDig (BLOCKTYPE a_Type) { return Get(a_Type).m_OneHitDig; }
- inline static bool IsPistonBreakable (BLOCKTYPE a_Type) { return Get(a_Type).m_PistonBreakable; }
- inline static bool IsRainBlocker (BLOCKTYPE a_Type) { return Get(a_Type).m_IsRainBlocker; }
- inline static bool IsSkylightDispersant (BLOCKTYPE a_Type)
- {
- return ((Get(a_Type).m_IsSkylightDispersant) || (Get(a_Type).m_SpreadLightFalloff > 1));
- }
- static bool IsSnowable(BLOCKTYPE a_Type);
- inline static bool IsSolid (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSolid; }
- inline static bool IsUseableBySpectator (BLOCKTYPE a_Type) { return Get(a_Type).m_UseableBySpectator; }
- inline static bool FullyOccupiesVoxel (BLOCKTYPE a_Type) { return Get(a_Type).m_FullyOccupiesVoxel; }
- inline static bool CanBeTerraformed (BLOCKTYPE a_Type) { return Get(a_Type).m_CanBeTerraformed; }
- inline static float GetBlockHeight (BLOCKTYPE a_Type) { return Get(a_Type).m_BlockHeight; }
- inline static float GetHardness (BLOCKTYPE a_Type) { return Get(a_Type).m_Hardness; }
// tolua_end
@@ -49,53 +18,53 @@ public:
See Physics\Explodinator.cpp for details of explosion block destruction. */
static float GetExplosionAbsorption(BLOCKTYPE Block);
- /** Creates a default BlockInfo structure, initializes all values to their defaults */
- cBlockInfo();
-
-private:
-
- /** Storage for all the BlockInfo structures. */
- class cBlockInfoArray;
+ // tolua_begin
/** How much light do the blocks emit on their own? */
- NIBBLETYPE m_LightValue;
+ static NIBBLETYPE GetLightValue(BLOCKTYPE Block);
/** How much light do the blocks consume? */
- NIBBLETYPE m_SpreadLightFalloff;
+ static NIBBLETYPE GetSpreadLightFalloff(BLOCKTYPE Block);
- /** Is a block transparent? (https://minecraft.gamepedia.com/Opacity) */
- bool m_Transparent;
+ /** Can a finisher change it? */
+ static bool CanBeTerraformed(BLOCKTYPE Block);
- /** Is a block destroyed after a single hit? */
- bool m_OneHitDig;
+ /** Does this block fully occupy its voxel - is it a 'full' block? */
+ static bool FullyOccupiesVoxel(BLOCKTYPE Block);
+
+ /** Is a block destroyed after a single hit?
+ Warning: IsOneHitDig does not take into account enchantments / status effects / swim state / floating state
+ and therefore may be incorrect. Only use to check if hardness is 0.
+ If you want to check if a player would instantly mine a_Block use cPlayer::CanInstantlyMine(a_Block) */
+ static bool IsOneHitDig(BLOCKTYPE Block);
/** Can a piston break this block? */
- bool m_PistonBreakable;
+ static bool IsPistonBreakable(BLOCKTYPE Block);
/** Does this block block the passage of rain? */
- bool m_IsRainBlocker;
+ static bool IsRainBlocker(BLOCKTYPE Block);
/** Does this block disperse sky light? (only relevant for transparent blocks) */
- bool m_IsSkylightDispersant;
+ static bool IsSkylightDispersant(BLOCKTYPE Block);
- /** Is this block solid (player cannot walk through)? */
- bool m_IsSolid;
+ static bool IsSnowable(BLOCKTYPE Block);
- /** Can a spectator interact with this block */
- bool m_UseableBySpectator;
+ /** Is this block solid (player cannot walk through)? */
+ static bool IsSolid(BLOCKTYPE Block);
- /** Does this block fully occupy its voxel - is it a 'full' block? */
- bool m_FullyOccupiesVoxel;
+ /** Is a block transparent? (https://minecraft.gamepedia.com/Opacity) */
+ static bool IsTransparent(BLOCKTYPE Block);
- /** Can a finisher change it? */
- bool m_CanBeTerraformed;
+ /** Can a spectator interact with this block? */
+ static bool IsUseableBySpectator(BLOCKTYPE Block);
- /** Block height */
- float m_BlockHeight;
+ /** Block's height. */
+ static float GetBlockHeight(BLOCKTYPE Block);
/** Block's hardness. The greater the value the longer the player needs to break the block. */
- float m_Hardness;
-}; // tolua_export
+ static float GetHardness(BLOCKTYPE Block);
+};
+// tolua_end
@@ -130,25 +99,3 @@ bool IsBlockMaterialLeaves(BLOCKTYPE a_BlockType);
bool IsBlockMaterialGourd(BLOCKTYPE a_BlockType);
bool IsBlockMaterialRock(BLOCKTYPE a_BlockType);
-
-
-
-
-
-class cBlockInfo::cBlockInfoArray:
- public std::array<cBlockInfo, 256>
-{
-public:
- /** Initializes the contained BlockInfo structures with block-specific values. */
- cBlockInfoArray();
-};
-
-
-
-
-
-inline const cBlockInfo & cBlockInfo::Get(BLOCKTYPE a_Type)
-{
- static const cBlockInfoArray ms_Info;
- return ms_Info[a_Type];
-}
diff --git a/tests/LuaThreadStress/Stubs.cpp b/tests/LuaThreadStress/Stubs.cpp
index fe2687ef4..4b347b895 100644
--- a/tests/LuaThreadStress/Stubs.cpp
+++ b/tests/LuaThreadStress/Stubs.cpp
@@ -86,16 +86,9 @@ extern "C" int luaopen_lxp(lua_State * a_LuaState)
-cBlockInfo::cBlockInfo()
-{
-}
-
-
-
-
-
-cBlockInfo::cBlockInfoArray::cBlockInfoArray()
+bool cBlockInfo::IsSolid(BLOCKTYPE)
{
+ return false;
}
diff --git a/tests/SchematicFileSerializer/Stubs.cpp b/tests/SchematicFileSerializer/Stubs.cpp
index 96b8f9a8c..67ecde7cd 100644
--- a/tests/SchematicFileSerializer/Stubs.cpp
+++ b/tests/SchematicFileSerializer/Stubs.cpp
@@ -13,22 +13,6 @@
-cBlockInfo::cBlockInfo()
-{
-}
-
-
-
-
-
-cBlockInfo::cBlockInfoArray::cBlockInfoArray()
-{
-}
-
-
-
-
-
cBoundingBox::cBoundingBox(double, double, double, double, double, double)
{
}