From acae3c9c657e48d0dc8c4b2965e5b3d69c53b279 Mon Sep 17 00:00:00 2001 From: Masy98 Date: Tue, 9 Sep 2014 16:00:26 +0200 Subject: Moved sound-configs into BlockID.h and fixed/ added loads of sounds --- src/BlockInfo.cpp | 167 ++++++++++++++++++++++++++++++++++++++++ src/BlockInfo.h | 4 + src/Blocks/BlockBigFlower.h | 6 -- src/Blocks/BlockButton.h | 6 -- src/Blocks/BlockCactus.h | 6 -- src/Blocks/BlockCake.h | 5 -- src/Blocks/BlockCarpet.h | 6 -- src/Blocks/BlockChest.h | 6 -- src/Blocks/BlockCloth.h | 5 -- src/Blocks/BlockCommandBlock.h | 5 -- src/Blocks/BlockComparator.h | 6 -- src/Blocks/BlockCrops.h | 6 -- src/Blocks/BlockDirt.h | 6 -- src/Blocks/BlockEnderchest.h | 5 -- src/Blocks/BlockFire.h | 5 -- src/Blocks/BlockFlower.h | 6 -- src/Blocks/BlockGravel.h | 5 -- src/Blocks/BlockHandler.cpp | 9 --- src/Blocks/BlockHandler.h | 3 - src/Blocks/BlockHayBale.h | 6 -- src/Blocks/BlockLadder.h | 6 -- src/Blocks/BlockLeaves.h | 6 -- src/Blocks/BlockLever.h | 6 -- src/Blocks/BlockMelon.h | 6 -- src/Blocks/BlockMushroom.h | 6 -- src/Blocks/BlockMycelium.h | 5 -- src/Blocks/BlockPlanks.h | 6 -- src/Blocks/BlockRedstoneTorch.h | 6 -- src/Blocks/BlockSand.h | 6 -- src/Blocks/BlockSapling.h | 6 -- src/Blocks/BlockSideways.h | 6 -- src/Blocks/BlockSlab.h | 23 ------ src/Blocks/BlockSnow.h | 6 -- src/Blocks/BlockStairs.h | 18 ----- src/Blocks/BlockStems.h | 6 -- src/Blocks/BlockSugarcane.h | 6 -- src/Blocks/BlockTNT.h | 5 -- src/Blocks/BlockTallGrass.h | 6 -- src/Blocks/BlockTorch.h | 6 -- src/Blocks/BlockTripwire.h | 5 -- src/Blocks/BlockTripwireHook.h | 5 -- src/Blocks/BlockVine.h | 6 -- src/Blocks/BlockWallSign.h | 6 -- src/Blocks/BlockWorkbench.h | 6 -- src/ClientHandle.cpp | 2 +- 45 files changed, 172 insertions(+), 272 deletions(-) diff --git a/src/BlockInfo.cpp b/src/BlockInfo.cpp index a59229f87..9ac66d35d 100644 --- a/src/BlockInfo.cpp +++ b/src/BlockInfo.cpp @@ -18,6 +18,7 @@ cBlockInfo::cBlockInfo() , m_IsSolid(true) , m_FullyOccupiesVoxel(false) , m_CanBeTerraformed(false) + , m_PlaceSound("") , m_Handler(NULL) {} @@ -571,6 +572,172 @@ void cBlockInfo::Initialize(cBlockInfoArray & a_Info) a_Info[E_BLOCK_SOULSAND ].m_CanBeTerraformed = true; a_Info[E_BLOCK_STAINED_CLAY ].m_CanBeTerraformed = true; a_Info[E_BLOCK_STONE ].m_CanBeTerraformed = true; + + + // Block place sounds: + a_Info[E_BLOCK_STONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_GRASS ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_DIRT ].m_PlaceSound = "dig.gravel"; + a_Info[E_BLOCK_COBBLESTONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_PLANKS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_SAPLING ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_BEDROCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SAND ].m_PlaceSound = "dig.sand"; + a_Info[E_BLOCK_GRAVEL ].m_PlaceSound = "dig.gravel"; + a_Info[E_BLOCK_GOLD_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_IRON_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_COAL_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_LOG ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_LEAVES ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_SPONGE ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_GLASS ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_LAPIS_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_LAPIS_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_DISPENSER ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SANDSTONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_NOTE_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_POWERED_RAIL ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_DETECTOR_RAIL ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_STICKY_PISTON ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_COBWEB ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_TALL_GRASS ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_DEAD_BUSH ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_PISTON ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_PISTON_EXTENSION ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_WOOL ].m_PlaceSound = "dig.cloth"; + a_Info[E_BLOCK_PISTON_MOVED_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_DANDELION ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_FLOWER ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_BROWN_MUSHROOM ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_RED_MUSHROOM ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_GOLD_BLOCK ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_IRON_BLOCK ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_DOUBLE_STONE_SLAB ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_STONE_SLAB ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_BRICK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_TNT ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_BOOKCASE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_MOSSY_COBBLESTONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_OBSIDIAN ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_TORCH ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_FIRE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_MOB_SPAWNER ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_WOODEN_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_CHEST ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_REDSTONE_WIRE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_DIAMOND_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_DIAMOND_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_CRAFTING_TABLE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_FARMLAND ].m_PlaceSound = "dig.gravel"; + a_Info[E_BLOCK_FURNACE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_LIT_FURNACE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SIGN_POST ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_WOODEN_DOOR ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_LADDER ].m_PlaceSound = "dig.ladder"; + a_Info[E_BLOCK_RAIL ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_COBBLESTONE_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_WALLSIGN ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_LEVER ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_STONE_PRESSURE_PLATE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_IRON_DOOR ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_WOODEN_PRESSURE_PLATE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_REDSTONE_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_REDSTONE_ORE_GLOWING ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_REDSTONE_TORCH_OFF ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_REDSTONE_TORCH_ON ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_STONE_BUTTON ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SNOW ].m_PlaceSound = "dig.snow"; + a_Info[E_BLOCK_ICE ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_SNOW_BLOCK ].m_PlaceSound = "dig.snow"; + a_Info[E_BLOCK_CACTUS ].m_PlaceSound = "dig.cloth"; + a_Info[E_BLOCK_CLAY ].m_PlaceSound = "dig.gravel"; + a_Info[E_BLOCK_SUGARCANE ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_JUKEBOX ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_FENCE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_PUMPKIN ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_NETHERRACK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SOULSAND ].m_PlaceSound = "dig.sand"; + a_Info[E_BLOCK_GLOWSTONE ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_NETHER_PORTAL ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_JACK_O_LANTERN ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_CAKE ].m_PlaceSound = "dig.snow"; + a_Info[E_BLOCK_REDSTONE_REPEATER_OFF ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_REDSTONE_REPEATER_ON ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_STAINED_GLASS ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_TRAPDOOR ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_SILVERFISH_EGG ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_STONE_BRICKS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_HUGE_BROWN_MUSHROOM ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_HUGE_RED_MUSHROOM ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_IRON_BARS ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_GLASS_PANE ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_MELON ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_PUMPKIN_STEM ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_MELON_STEM ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_VINES ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_FENCE_GATE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_BRICK_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_STONE_BRICK_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_MYCELIUM ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_LILY_PAD ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_NETHER_BRICK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_NETHER_BRICK_FENCE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_NETHER_BRICK_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_NETHER_WART ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_ENCHANTMENT_TABLE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_BREWING_STAND ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_CAULDRON ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_END_PORTAL ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_END_PORTAL_FRAME ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_END_STONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_DRAGON_EGG ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_REDSTONE_LAMP_OFF ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_REDSTONE_LAMP_ON ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_DOUBLE_WOODEN_SLAB ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_WOODEN_SLAB ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_COCOA_POD ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_SANDSTONE_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_EMERALD_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_ENDER_CHEST ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_TRIPWIRE_HOOK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_TRIPWIRE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_EMERALD_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_SPRUCE_WOOD_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_BIRCH_WOOD_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_JUNGLE_WOOD_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_COMMAND_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_BEACON ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_COBBLESTONE_WALL ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_FLOWER_POT ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_CARROTS ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_POTATOES ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_HEAD ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_ANVIL ].m_PlaceSound = "dig.anvil"; + a_Info[E_BLOCK_TRAPPED_CHEST ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_LIGHT_WEIGHTED_PRESSURE_PLATE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_HEAVY_WEIGHTED_PRESSURE_PLATE ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_INACTIVE_COMPARATOR ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_ACTIVE_COMPARATOR ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_DAYLIGHT_SENSOR ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_BLOCK_OF_REDSTONE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_NETHER_QUARTZ_ORE ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_HOPPER ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_QUARTZ_BLOCK ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_QUARTZ_STAIRS ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_ACTIVATOR_RAIL ].m_PlaceSound = "dig.metal"; + a_Info[E_BLOCK_DROPPER ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_STAINED_CLAY ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_STAINED_GLASS_PANE ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_NEW_LEAVES ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_NEW_LOG ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_ACACIA_WOOD_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_DARK_OAK_WOOD_STAIRS ].m_PlaceSound = "dig.wood"; + a_Info[E_BLOCK_HAY_BALE ].m_PlaceSound = "dig.grass"; + a_Info[E_BLOCK_CARPET ].m_PlaceSound = "dig.cloth"; + a_Info[E_BLOCK_HARDENED_CLAY ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_BLOCK_OF_COAL ].m_PlaceSound = "dig.stone"; + a_Info[E_BLOCK_PACKED_ICE ].m_PlaceSound = "dig.glass"; + a_Info[E_BLOCK_BIG_FLOWER ].m_PlaceSound = "dig.grass"; } diff --git a/src/BlockInfo.h b/src/BlockInfo.h index 4c66c095a..567070a7f 100644 --- a/src/BlockInfo.h +++ b/src/BlockInfo.h @@ -48,6 +48,9 @@ public: /** Can a finisher change it? */ bool m_CanBeTerraformed; + /** Sound when placing this block */ + AString m_PlaceSound; + // tolua_end /** Associated block handler. */ @@ -64,6 +67,7 @@ public: inline static bool IsSolid (BLOCKTYPE a_Type) { return Get(a_Type).m_IsSolid; } 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 AString GetPlaceSound (BLOCKTYPE a_Type) { return Get(a_Type).m_PlaceSound; } // tolua_end diff --git a/src/Blocks/BlockBigFlower.h b/src/Blocks/BlockBigFlower.h index 72e552dee..646980634 100644 --- a/src/Blocks/BlockBigFlower.h +++ b/src/Blocks/BlockBigFlower.h @@ -118,12 +118,6 @@ public: } } } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockButton.h b/src/Blocks/BlockButton.h index 3b45afff8..8e4f04740 100644 --- a/src/Blocks/BlockButton.h +++ b/src/Blocks/BlockButton.h @@ -57,12 +57,6 @@ public: } - virtual const char * GetStepSound(void) override - { - return m_BlockType == E_BLOCK_WOODEN_BUTTON ? "step.wood" : "step.stone"; - } - - inline static NIBBLETYPE BlockFaceToMetaData(eBlockFace a_BlockFace) { switch (a_BlockFace) diff --git a/src/Blocks/BlockCactus.h b/src/Blocks/BlockCactus.h index ed441517d..910966c43 100644 --- a/src/Blocks/BlockCactus.h +++ b/src/Blocks/BlockCactus.h @@ -69,12 +69,6 @@ public: { a_Chunk.GetWorld()->GrowCactus(a_RelX + a_Chunk.GetPosX() * cChunkDef::Width, a_RelY, a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width, 1); } - - - virtual const char * GetStepSound(void) override - { - return "step.cloth"; - } } ; diff --git a/src/Blocks/BlockCake.h b/src/Blocks/BlockCake.h index f05f468e5..3a754ce18 100644 --- a/src/Blocks/BlockCake.h +++ b/src/Blocks/BlockCake.h @@ -43,11 +43,6 @@ public: { return true; } - - virtual const char * GetStepSound(void) override - { - return "step.cloth"; - } } ; diff --git a/src/Blocks/BlockCarpet.h b/src/Blocks/BlockCarpet.h index d1aa52687..4b287c664 100644 --- a/src/Blocks/BlockCarpet.h +++ b/src/Blocks/BlockCarpet.h @@ -22,12 +22,6 @@ public: cBlockHandler(a_BlockType) { } - - - virtual const char * GetStepSound(void) override - { - return "step.cloth"; - } virtual bool GetPlacementBlockTypeMeta( diff --git a/src/Blocks/BlockChest.h b/src/Blocks/BlockChest.h index 28adbed4f..201f2309b 100644 --- a/src/Blocks/BlockChest.h +++ b/src/Blocks/BlockChest.h @@ -106,12 +106,6 @@ public: // Single chest, no further processing needed } - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } - virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk) override { int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width; diff --git a/src/Blocks/BlockCloth.h b/src/Blocks/BlockCloth.h index 3c1ae7c25..525176725 100644 --- a/src/Blocks/BlockCloth.h +++ b/src/Blocks/BlockCloth.h @@ -15,11 +15,6 @@ public: : cBlockHandler(a_BlockType) { } - - virtual const char * GetStepSound(void) override - { - return "step.cloth"; - } } ; diff --git a/src/Blocks/BlockCommandBlock.h b/src/Blocks/BlockCommandBlock.h index cf0103765..b66def201 100644 --- a/src/Blocks/BlockCommandBlock.h +++ b/src/Blocks/BlockCommandBlock.h @@ -20,11 +20,6 @@ public: { a_Pickups.push_back(cItem(E_BLOCK_AIR, 8, 0)); } - - virtual const char * GetStepSound(void) override - { - return "step.stone"; - } } ; diff --git a/src/Blocks/BlockComparator.h b/src/Blocks/BlockComparator.h index 6caaaab13..3443fc69e 100644 --- a/src/Blocks/BlockComparator.h +++ b/src/Blocks/BlockComparator.h @@ -64,12 +64,6 @@ public: a_BlockMeta = cBlockRedstoneRepeaterHandler::RepeaterRotationToMetaData(a_Player->GetYaw()); return true; } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockCrops.h b/src/Blocks/BlockCrops.h index ae6e490e1..53e996683 100644 --- a/src/Blocks/BlockCrops.h +++ b/src/Blocks/BlockCrops.h @@ -100,12 +100,6 @@ public: { return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) == E_BLOCK_FARMLAND)); } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockDirt.h b/src/Blocks/BlockDirt.h index d458c6062..23e5a3cde 100644 --- a/src/Blocks/BlockDirt.h +++ b/src/Blocks/BlockDirt.h @@ -88,12 +88,6 @@ public: } } // for i - repeat twice } - - - virtual const char * GetStepSound(void) override - { - return "step.gravel"; - } } ; diff --git a/src/Blocks/BlockEnderchest.h b/src/Blocks/BlockEnderchest.h index 4672f1459..0bc67a8f5 100644 --- a/src/Blocks/BlockEnderchest.h +++ b/src/Blocks/BlockEnderchest.h @@ -33,11 +33,6 @@ public: a_BlockMeta = RotationToMetaData(a_Player->GetYaw()); return true; } - - virtual const char * GetStepSound(void) override - { - return "step.stone"; - } static NIBBLETYPE RotationToMetaData(double a_Rotation) { diff --git a/src/Blocks/BlockFire.h b/src/Blocks/BlockFire.h index b9f211042..b6d1d95f2 100644 --- a/src/Blocks/BlockFire.h +++ b/src/Blocks/BlockFire.h @@ -50,11 +50,6 @@ public: return true; } - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } - /** Traces along YP until it finds an obsidian block, returns Y difference or 0 if no portal, and -1 for border Takes the X, Y, and Z of the base block; with an optional MaxY for portal border finding */ int FindObsidianCeiling(int X, int Y, int Z, cChunkInterface & a_ChunkInterface, int MaxY = 0) diff --git a/src/Blocks/BlockFlower.h b/src/Blocks/BlockFlower.h index 6f64c062b..3eb8a0baa 100644 --- a/src/Blocks/BlockFlower.h +++ b/src/Blocks/BlockFlower.h @@ -28,12 +28,6 @@ public: { return (a_RelY > 0) && IsBlockTypeOfDirt(a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ)); } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockGravel.h b/src/Blocks/BlockGravel.h index e1c9ff390..717bd5f5f 100644 --- a/src/Blocks/BlockGravel.h +++ b/src/Blocks/BlockGravel.h @@ -15,11 +15,6 @@ public: : cBlockHandler(a_BlockType) { } - - virtual const char * GetStepSound(void) override - { - return "step.gravel"; - } } ; diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp index 6767d4de4..34925a252 100644 --- a/src/Blocks/BlockHandler.cpp +++ b/src/Blocks/BlockHandler.cpp @@ -495,15 +495,6 @@ void cBlockHandler::DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterfac -const char * cBlockHandler::GetStepSound() -{ - return "step.stone"; -} - - - - - bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk) { return true; diff --git a/src/Blocks/BlockHandler.h b/src/Blocks/BlockHandler.h index de90ce55b..b3ada279c 100644 --- a/src/Blocks/BlockHandler.h +++ b/src/Blocks/BlockHandler.h @@ -84,9 +84,6 @@ public: */ virtual void DropBlock(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cBlockPluginInterface & a_BlockPluginInterface, cEntity * a_Digger, int a_BlockX, int a_BlockY, int a_BlockZ, bool a_CanDrop = true, bool a_DropVerbatim = false); - /// Returns step sound name of block - virtual const char * GetStepSound(void); - /// Checks if the block can stay at the specified relative coords in the chunk virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk); diff --git a/src/Blocks/BlockHayBale.h b/src/Blocks/BlockHayBale.h index 3c6472adb..8150b10d3 100644 --- a/src/Blocks/BlockHayBale.h +++ b/src/Blocks/BlockHayBale.h @@ -15,12 +15,6 @@ public: : cBlockSidewaysHandler(a_BlockType) { } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockLadder.h b/src/Blocks/BlockLadder.h index 284d1d732..ab3f55439 100644 --- a/src/Blocks/BlockLadder.h +++ b/src/Blocks/BlockLadder.h @@ -111,12 +111,6 @@ public: int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width; return LadderCanBePlacedAt(a_ChunkInterface, BlockX, a_RelY, BlockZ, BlockFace); } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockLeaves.h b/src/Blocks/BlockLeaves.h index a8aa28a0f..add571675 100644 --- a/src/Blocks/BlockLeaves.h +++ b/src/Blocks/BlockLeaves.h @@ -112,12 +112,6 @@ public: DropBlock(a_ChunkInterface, a_WorldInterface, a_PluginInterface, NULL, BlockX, a_RelY, BlockZ); a_ChunkInterface.DigBlock(a_WorldInterface, BlockX, a_RelY, BlockZ); } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockLever.h b/src/Blocks/BlockLever.h index 4316fd06b..3b63b396c 100644 --- a/src/Blocks/BlockLever.h +++ b/src/Blocks/BlockLever.h @@ -70,12 +70,6 @@ public: } - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } - - inline static eBlockFace BlockMetaDataToBlockFace(NIBBLETYPE a_Meta) { switch (a_Meta & 0x7) diff --git a/src/Blocks/BlockMelon.h b/src/Blocks/BlockMelon.h index 60202d66e..22cdb4d29 100644 --- a/src/Blocks/BlockMelon.h +++ b/src/Blocks/BlockMelon.h @@ -22,12 +22,6 @@ public: cFastRandom Random; a_Pickups.push_back(cItem(E_ITEM_MELON_SLICE, (char)(3 + Random.NextInt(5)), 0)); } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockMushroom.h b/src/Blocks/BlockMushroom.h index 135d418d7..7c06fcc74 100644 --- a/src/Blocks/BlockMushroom.h +++ b/src/Blocks/BlockMushroom.h @@ -50,12 +50,6 @@ public: } return true; } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockMycelium.h b/src/Blocks/BlockMycelium.h index 2a8ef5fca..628e87181 100644 --- a/src/Blocks/BlockMycelium.h +++ b/src/Blocks/BlockMycelium.h @@ -22,11 +22,6 @@ public: { a_Pickups.push_back(cItem(E_BLOCK_DIRT, 1, 0)); } - - virtual const char * GetStepSound(void) override - { - return "step.gravel"; - } } ; diff --git a/src/Blocks/BlockPlanks.h b/src/Blocks/BlockPlanks.h index 4c5bb4860..3c243ebdc 100644 --- a/src/Blocks/BlockPlanks.h +++ b/src/Blocks/BlockPlanks.h @@ -27,12 +27,6 @@ public: a_BlockMeta = (NIBBLETYPE)(a_Player->GetEquippedItem().m_ItemDamage); return true; } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockRedstoneTorch.h b/src/Blocks/BlockRedstoneTorch.h index cb897ba3f..8416a415c 100644 --- a/src/Blocks/BlockRedstoneTorch.h +++ b/src/Blocks/BlockRedstoneTorch.h @@ -23,12 +23,6 @@ public: // Always drop the ON torch, meta 0 a_Pickups.push_back(cItem(E_BLOCK_REDSTONE_TORCH_ON, 1, 0)); } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockSand.h b/src/Blocks/BlockSand.h index 3fc271483..48beab138 100644 --- a/src/Blocks/BlockSand.h +++ b/src/Blocks/BlockSand.h @@ -15,12 +15,6 @@ public: : cBlockHandler(a_BlockType) { } - - virtual const char * GetStepSound(void) override - { - return "step.sand"; - } - }; diff --git a/src/Blocks/BlockSapling.h b/src/Blocks/BlockSapling.h index de28273d5..bec79c6f3 100644 --- a/src/Blocks/BlockSapling.h +++ b/src/Blocks/BlockSapling.h @@ -46,12 +46,6 @@ public: a_Chunk.SetMeta(a_RelX, a_RelY, a_RelZ, Meta | 0x08); } } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockSideways.h b/src/Blocks/BlockSideways.h index f5f10899d..4b1e38d6d 100644 --- a/src/Blocks/BlockSideways.h +++ b/src/Blocks/BlockSideways.h @@ -65,12 +65,6 @@ public: } } } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockSlab.h b/src/Blocks/BlockSlab.h index e67f0e8b3..0ad30bb2b 100644 --- a/src/Blocks/BlockSlab.h +++ b/src/Blocks/BlockSlab.h @@ -85,18 +85,6 @@ public: return true; } - - - virtual const char * GetStepSound(void) override - { - switch (m_BlockType) - { - case E_BLOCK_WOODEN_SLAB: return "step.wood"; - case E_BLOCK_STONE_SLAB: return "step.stone"; - } - ASSERT(!"Unhandled slab type!"); - return ""; - } virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override @@ -174,17 +162,6 @@ public: ASSERT(!"Unhandled double slab type!"); return a_BlockType; } - - virtual const char * GetStepSound(void) override - { - switch (m_BlockType) - { - case E_BLOCK_DOUBLE_STONE_SLAB: return "step.stone"; - case E_BLOCK_DOUBLE_WOODEN_SLAB: return "step.wood"; - } - ASSERT(!"Unhandled double slab type!"); - return ""; - } } ; diff --git a/src/Blocks/BlockSnow.h b/src/Blocks/BlockSnow.h index 977f19a16..7b6094c9f 100644 --- a/src/Blocks/BlockSnow.h +++ b/src/Blocks/BlockSnow.h @@ -87,12 +87,6 @@ public: { return false; } - - - virtual const char * GetStepSound(void) override - { - return "step.cloth"; - } } ; diff --git a/src/Blocks/BlockStairs.h b/src/Blocks/BlockStairs.h index 417969a82..d396204e0 100644 --- a/src/Blocks/BlockStairs.h +++ b/src/Blocks/BlockStairs.h @@ -55,24 +55,6 @@ public: } - virtual const char * GetStepSound(void) override - { - if ( - (m_BlockType == E_BLOCK_WOODEN_STAIRS) || - (m_BlockType == E_BLOCK_SPRUCE_WOOD_STAIRS) || - (m_BlockType == E_BLOCK_JUNGLE_WOOD_STAIRS) || - (m_BlockType == E_BLOCK_ACACIA_WOOD_STAIRS) || - (m_BlockType == E_BLOCK_BIRCH_WOOD_STAIRS) || - (m_BlockType == E_BLOCK_DARK_OAK_WOOD_STAIRS) - ) - { - return "step.wood"; - } - - return "step.stone"; - } - - virtual void ConvertToPickups(cItems & a_Pickups, NIBBLETYPE a_BlockMeta) override { // Reset meta to zero diff --git a/src/Blocks/BlockStems.h b/src/Blocks/BlockStems.h index b726a0901..860c7dd45 100644 --- a/src/Blocks/BlockStems.h +++ b/src/Blocks/BlockStems.h @@ -47,12 +47,6 @@ public: { return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) == E_BLOCK_FARMLAND)); } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockSugarcane.h b/src/Blocks/BlockSugarcane.h index 5902c791b..c832ff218 100644 --- a/src/Blocks/BlockSugarcane.h +++ b/src/Blocks/BlockSugarcane.h @@ -78,12 +78,6 @@ public: { a_Chunk.GetWorld()->GrowSugarcane(a_RelX + a_Chunk.GetPosX() * cChunkDef::Width, a_RelY, a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width, 1); } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockTNT.h b/src/Blocks/BlockTNT.h index 283a03730..3a573ae67 100644 --- a/src/Blocks/BlockTNT.h +++ b/src/Blocks/BlockTNT.h @@ -16,11 +16,6 @@ public: { } - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } - virtual void OnCancelRightClick(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace) override { a_WorldInterface.SendBlockTo(a_BlockX, a_BlockY, a_BlockZ, a_Player); diff --git a/src/Blocks/BlockTallGrass.h b/src/Blocks/BlockTallGrass.h index 9c008f793..f520414a7 100644 --- a/src/Blocks/BlockTallGrass.h +++ b/src/Blocks/BlockTallGrass.h @@ -53,12 +53,6 @@ public: { return ((a_RelY > 0) && (a_Chunk.GetBlock(a_RelX, a_RelY - 1, a_RelZ) != E_BLOCK_AIR)); } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } } ; diff --git a/src/Blocks/BlockTorch.h b/src/Blocks/BlockTorch.h index df5574d5d..fa46b37a8 100644 --- a/src/Blocks/BlockTorch.h +++ b/src/Blocks/BlockTorch.h @@ -184,12 +184,6 @@ public: // Always drop meta = 0 a_Pickups.push_back(cItem(m_BlockType, 1, 0)); } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/Blocks/BlockTripwire.h b/src/Blocks/BlockTripwire.h index 3ab17bf4a..d03f37537 100644 --- a/src/Blocks/BlockTripwire.h +++ b/src/Blocks/BlockTripwire.h @@ -20,11 +20,6 @@ public: { a_Pickups.push_back(cItem(E_ITEM_STRING, 1, 0)); } - - virtual const char * GetStepSound(void) override - { - return ""; - } }; diff --git a/src/Blocks/BlockTripwireHook.h b/src/Blocks/BlockTripwireHook.h index 4f9d79483..88d389711 100644 --- a/src/Blocks/BlockTripwireHook.h +++ b/src/Blocks/BlockTripwireHook.h @@ -70,11 +70,6 @@ public: return ((a_RelY > 0) && cBlockInfo::FullyOccupiesVoxel(BlockIsOn)); } - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } }; diff --git a/src/Blocks/BlockVine.h b/src/Blocks/BlockVine.h index 578224c61..b61673cc5 100644 --- a/src/Blocks/BlockVine.h +++ b/src/Blocks/BlockVine.h @@ -159,12 +159,6 @@ public: { return true; } - - - virtual const char * GetStepSound(void) override - { - return "step.grass"; - } virtual bool DoesDropOnUnsuitable(void) override diff --git a/src/Blocks/BlockWallSign.h b/src/Blocks/BlockWallSign.h index 47649379e..0abe9c52c 100644 --- a/src/Blocks/BlockWallSign.h +++ b/src/Blocks/BlockWallSign.h @@ -27,12 +27,6 @@ public: } - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } - - virtual void OnPlacedByPlayer( cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, cPlayer * a_Player, int a_BlockX, int a_BlockY, int a_BlockZ, eBlockFace a_BlockFace, diff --git a/src/Blocks/BlockWorkbench.h b/src/Blocks/BlockWorkbench.h index 70468369c..699badaf2 100644 --- a/src/Blocks/BlockWorkbench.h +++ b/src/Blocks/BlockWorkbench.h @@ -30,12 +30,6 @@ public: { return true; } - - - virtual const char * GetStepSound(void) override - { - return "step.wood"; - } } ; diff --git a/src/ClientHandle.cpp b/src/ClientHandle.cpp index 6b31bfa64..a6d7c3066 100644 --- a/src/ClientHandle.cpp +++ b/src/ClientHandle.cpp @@ -1448,7 +1448,7 @@ void cClientHandle::HandlePlaceBlock(int a_BlockX, int a_BlockY, int a_BlockZ, e NewBlock->OnPlacedByPlayer(ChunkInterface, *World, m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta); // Step sound with 0.8f pitch is used as block placement sound - World->BroadcastSoundEffect(NewBlock->GetStepSound(), (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, 1.0f, 0.8f); + World->BroadcastSoundEffect(cBlockInfo::GetPlaceSound(BlockType), (double)a_BlockX, (double)a_BlockY, (double)a_BlockZ, 1.0f, 0.8f); cRoot::Get()->GetPluginManager()->CallHookPlayerPlacedBlock(*m_Player, a_BlockX, a_BlockY, a_BlockZ, a_BlockFace, a_CursorX, a_CursorY, a_CursorZ, BlockType, BlockMeta); } -- cgit v1.2.3