diff --git a/TrueCraft.API/Logic/IBlockProvider.cs b/TrueCraft.API/Logic/IBlockProvider.cs index ed2d0fd..bba2fcf 100644 --- a/TrueCraft.API/Logic/IBlockProvider.cs +++ b/TrueCraft.API/Logic/IBlockProvider.cs @@ -17,6 +17,7 @@ namespace TrueCraft.API.Logic byte LightOpacity { get; } bool DiffuseSkyLight { get; } bool Flammable { get; } + SoundEffectClass SoundEffect { get; } ToolMaterial EffectiveToolMaterials { get; } ToolType EffectiveTools { get; } string DisplayName { get; } diff --git a/TrueCraft.API/Logic/SoundEffectClass.cs b/TrueCraft.API/Logic/SoundEffectClass.cs new file mode 100644 index 0000000..c2190b6 --- /dev/null +++ b/TrueCraft.API/Logic/SoundEffectClass.cs @@ -0,0 +1,17 @@ +using System; + +namespace TrueCraft.API.Logic +{ + public enum SoundEffectClass + { + None, + Cloth, + Grass, + Gravel, + Sand, + Snow, + Stone, + Wood, + Glass + } +} \ No newline at end of file diff --git a/TrueCraft.API/TrueCraft.API.csproj b/TrueCraft.API/TrueCraft.API.csproj index df50c42..5a8c719 100644 --- a/TrueCraft.API/TrueCraft.API.csproj +++ b/TrueCraft.API/TrueCraft.API.csproj @@ -40,7 +40,7 @@ - ..\packages\YamlDotNet.3.6.1\lib\net35\YamlDotNet.dll + ..\packages\YamlDotNet.3.7.0\lib\net35\YamlDotNet.dll @@ -122,6 +122,7 @@ + @@ -131,11 +132,11 @@ fNbt - - - + + + diff --git a/TrueCraft.API/packages.config b/TrueCraft.API/packages.config index a044efe..0a615c3 100644 --- a/TrueCraft.API/packages.config +++ b/TrueCraft.API/packages.config @@ -1,4 +1,4 @@  - + \ No newline at end of file diff --git a/TrueCraft.Client/AudioManager.cs b/TrueCraft.Client/AudioManager.cs index cecfe5d..59f1f55 100644 --- a/TrueCraft.Client/AudioManager.cs +++ b/TrueCraft.Client/AudioManager.cs @@ -5,6 +5,7 @@ using System.Collections.Generic; using System.Linq; using TrueCraft.Core; using Microsoft.Xna.Framework.Content; +using NVorbis; namespace TrueCraft.Client { @@ -25,21 +26,47 @@ namespace TrueCraft.Client { string[][] packs = new[] { - // TODO: step sound effects for cloth, sand, gravel, snow, wood new[] { - "grass", - "footstep_dirt_0.wav", - "footstep_dirt_1.wav", - "footstep_dirt_2.wav", + "footstep.cloth", + "default_sand_footstep.1.ogg", "default_sand_footstep.2.ogg" // TODO: Cloth sound effects }, new[] { - "stone", - "footstep_stone_0.wav", - "footstep_stone_1.wav", - "footstep_stone_2.wav", + "footstep.grass", + "default_grass_footstep.1.ogg", "default_grass_footstep.2.ogg", "default_grass_footstep.3.ogg" }, + new[] + { + "footstep.gravel", + "default_gravel_footstep.1.ogg", "default_gravel_footstep.2.ogg", "default_gravel_footstep.3.ogg", + "default_gravel_footstep.4.ogg" + }, + new[] + { + "footstep.sand", + "default_sand_footstep.1.ogg", "default_sand_footstep.2.ogg" + }, + new[] + { + "footstep.snow", + "default_snow_footstep.1.ogg", "default_snow_footstep.2.ogg", "default_snow_footstep.3.ogg" + }, + new[] + { + "footstep.stone", + "default_hard_footstep.1.ogg", "default_hard_footstep.2.ogg", "default_hard_footstep.3.ogg" + }, + new[] + { + "footstep.wood", + "default_wood_footstep.1.ogg", "default_wood_footstep.2.ogg" + }, + new[] + { + "footstep.glass", + "default_glass_footstep.ogg" + } }; foreach (var pack in packs) { @@ -48,22 +75,46 @@ namespace TrueCraft.Client } } + private SoundEffect LoadOgg(Stream stream) + { + using (var reader = new VorbisReader(stream, false)) + { + float[] _buffer = new float[reader.TotalSamples]; + byte[] buffer = new byte[reader.TotalSamples * 2]; + reader.ReadSamples(_buffer, 0, _buffer.Length); + for (int i = 0; i < _buffer.Length; i++) + { + short val = (short)Math.Max(Math.Min(short.MaxValue * _buffer[i], short.MaxValue), short.MinValue); + var decoded = BitConverter.GetBytes(val); + buffer[i * 2] = decoded[0]; + buffer[i * 2 + 1] = decoded[1]; + } + return new SoundEffect(buffer, reader.SampleRate, reader.Channels == 1 ? AudioChannels.Mono : AudioChannels.Stereo); + } + } + public void LoadAudioPack(string pack, string[] filenames) { var effects = new SoundEffect[filenames.Length]; for (int i = 0; i < filenames.Length; i++) { using (var f = File.OpenRead(Path.Combine("Content", "Audio", filenames[i]))) - effects[i] = SoundEffect.FromStream(f); + { + if (filenames[i].EndsWith(".wav")) + effects[i] = SoundEffect.FromStream(f); + else if (filenames[i].EndsWith(".ogg")) + effects[i] = LoadOgg(f); + } } AudioPacks[pack] = effects; } - public void PlayPack(string pack) + public void PlayPack(string pack, float volume = 1.0f) { var i = MathHelper.Random.Next(0, AudioPacks[pack].Length); - i = 0; - AudioPacks[pack][i].Play(); + var instance = AudioPacks[pack][i].CreateInstance(); + instance.Volume = volume * EffectVolume; + instance.Play(); } } -} \ No newline at end of file +} diff --git a/TrueCraft.Client/Content/Audio/credits.txt b/TrueCraft.Client/Content/Audio/credits.txt index e7f5994..44c418d 100644 --- a/TrueCraft.Client/Content/Audio/credits.txt +++ b/TrueCraft.Client/Content/Audio/credits.txt @@ -1,4 +1 @@ -Dirt and Stone footsteps CC-BY-SA from http://www.littlerobotsoundfactory.com/ -Snow footsteps CC-BY-SA & public domain from http://freesound.org/people/iujhu/ -Wood footsteps CC-BY-SA from http://www.ronaldvanwonderen.com/ and http://freesound.org/people/wildweasel/ -Cloth footsteps CC-0/public domain from http://freesound.org/people/Yuval/ \ No newline at end of file +The footstep and mining/placement sound effects were sourced from Minetest under CC-BY-SA: https://github.com/minetest/minetest_game \ No newline at end of file diff --git a/TrueCraft.Client/Content/Audio/default_break_glass.1.ogg b/TrueCraft.Client/Content/Audio/default_break_glass.1.ogg new file mode 100644 index 0000000..b1ccc5f Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_break_glass.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_break_glass.2.ogg b/TrueCraft.Client/Content/Audio/default_break_glass.2.ogg new file mode 100644 index 0000000..b6cc9e8 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_break_glass.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_break_glass.3.ogg b/TrueCraft.Client/Content/Audio/default_break_glass.3.ogg new file mode 100644 index 0000000..ae6a6bf Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_break_glass.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_cool_lava.1.ogg b/TrueCraft.Client/Content/Audio/default_cool_lava.1.ogg new file mode 100644 index 0000000..42506dd Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_cool_lava.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_cool_lava.2.ogg b/TrueCraft.Client/Content/Audio/default_cool_lava.2.ogg new file mode 100644 index 0000000..2747ab8 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_cool_lava.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_cool_lava.3.ogg b/TrueCraft.Client/Content/Audio/default_cool_lava.3.ogg new file mode 100644 index 0000000..8baeac3 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_cool_lava.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dig_choppy.ogg b/TrueCraft.Client/Content/Audio/default_dig_choppy.ogg new file mode 100644 index 0000000..e2ecd84 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dig_choppy.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dig_cracky.ogg b/TrueCraft.Client/Content/Audio/default_dig_cracky.ogg new file mode 100644 index 0000000..da11679 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dig_cracky.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dig_crumbly.ogg b/TrueCraft.Client/Content/Audio/default_dig_crumbly.ogg new file mode 100644 index 0000000..a0b2a1f Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dig_crumbly.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dig_dig_immediate.ogg b/TrueCraft.Client/Content/Audio/default_dig_dig_immediate.ogg new file mode 100644 index 0000000..e65d766 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dig_dig_immediate.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dig_oddly_breakable_by_hand.ogg b/TrueCraft.Client/Content/Audio/default_dig_oddly_breakable_by_hand.ogg new file mode 100644 index 0000000..ef4d7b1 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dig_oddly_breakable_by_hand.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dirt_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_dirt_footstep.1.ogg new file mode 100644 index 0000000..84a197d Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dirt_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dirt_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_dirt_footstep.2.ogg new file mode 100644 index 0000000..2e23b8a Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dirt_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dug_node.1.ogg b/TrueCraft.Client/Content/Audio/default_dug_node.1.ogg new file mode 100644 index 0000000..c04975d Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dug_node.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_dug_node.2.ogg b/TrueCraft.Client/Content/Audio/default_dug_node.2.ogg new file mode 100644 index 0000000..9f20926 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_dug_node.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_glass_footstep.ogg b/TrueCraft.Client/Content/Audio/default_glass_footstep.ogg new file mode 100644 index 0000000..191287a Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_glass_footstep.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_grass_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_grass_footstep.1.ogg new file mode 100644 index 0000000..22d1ad6 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_grass_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_grass_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_grass_footstep.2.ogg new file mode 100644 index 0000000..4ccd8a0 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_grass_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_grass_footstep.3.ogg b/TrueCraft.Client/Content/Audio/default_grass_footstep.3.ogg new file mode 100644 index 0000000..20db84e Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_grass_footstep.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_gravel_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_gravel_footstep.1.ogg new file mode 100644 index 0000000..8d260ce Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_gravel_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_gravel_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_gravel_footstep.2.ogg new file mode 100644 index 0000000..2aba2c6 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_gravel_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_gravel_footstep.3.ogg b/TrueCraft.Client/Content/Audio/default_gravel_footstep.3.ogg new file mode 100644 index 0000000..1bcd8a1 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_gravel_footstep.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_gravel_footstep.4.ogg b/TrueCraft.Client/Content/Audio/default_gravel_footstep.4.ogg new file mode 100644 index 0000000..696c9ff Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_gravel_footstep.4.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_hard_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_hard_footstep.1.ogg new file mode 100644 index 0000000..1748bc5 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_hard_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_hard_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_hard_footstep.2.ogg new file mode 100644 index 0000000..fe39fd7 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_hard_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_hard_footstep.3.ogg b/TrueCraft.Client/Content/Audio/default_hard_footstep.3.ogg new file mode 100644 index 0000000..5030e06 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_hard_footstep.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_place_node.1.ogg b/TrueCraft.Client/Content/Audio/default_place_node.1.ogg new file mode 100644 index 0000000..46b9756 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_place_node.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_place_node.2.ogg b/TrueCraft.Client/Content/Audio/default_place_node.2.ogg new file mode 100644 index 0000000..d34c01a Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_place_node.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_place_node.3.ogg b/TrueCraft.Client/Content/Audio/default_place_node.3.ogg new file mode 100644 index 0000000..fc29365 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_place_node.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_place_node_hard.1.ogg b/TrueCraft.Client/Content/Audio/default_place_node_hard.1.ogg new file mode 100644 index 0000000..9f97fac Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_place_node_hard.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_place_node_hard.2.ogg b/TrueCraft.Client/Content/Audio/default_place_node_hard.2.ogg new file mode 100644 index 0000000..1d3b3de Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_place_node_hard.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_sand_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_sand_footstep.1.ogg new file mode 100644 index 0000000..65b68c7 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_sand_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_sand_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_sand_footstep.2.ogg new file mode 100644 index 0000000..57f35f3 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_sand_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_snow_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_snow_footstep.1.ogg new file mode 100644 index 0000000..3260b91 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_snow_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_snow_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_snow_footstep.2.ogg new file mode 100644 index 0000000..4aac1e7 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_snow_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_snow_footstep.3.ogg b/TrueCraft.Client/Content/Audio/default_snow_footstep.3.ogg new file mode 100644 index 0000000..cf4235b Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_snow_footstep.3.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_wood_footstep.1.ogg b/TrueCraft.Client/Content/Audio/default_wood_footstep.1.ogg new file mode 100644 index 0000000..34f63a1 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_wood_footstep.1.ogg differ diff --git a/TrueCraft.Client/Content/Audio/default_wood_footstep.2.ogg b/TrueCraft.Client/Content/Audio/default_wood_footstep.2.ogg new file mode 100644 index 0000000..124fc29 Binary files /dev/null and b/TrueCraft.Client/Content/Audio/default_wood_footstep.2.ogg differ diff --git a/TrueCraft.Client/Content/Audio/footstep_dirt_0.wav b/TrueCraft.Client/Content/Audio/footstep_dirt_0.wav deleted file mode 100644 index 98f4736..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_dirt_0.wav and /dev/null differ diff --git a/TrueCraft.Client/Content/Audio/footstep_dirt_1.wav b/TrueCraft.Client/Content/Audio/footstep_dirt_1.wav deleted file mode 100644 index bd47ccf..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_dirt_1.wav and /dev/null differ diff --git a/TrueCraft.Client/Content/Audio/footstep_dirt_2.wav b/TrueCraft.Client/Content/Audio/footstep_dirt_2.wav deleted file mode 100644 index cb5c2b0..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_dirt_2.wav and /dev/null differ diff --git a/TrueCraft.Client/Content/Audio/footstep_stone_0.wav b/TrueCraft.Client/Content/Audio/footstep_stone_0.wav deleted file mode 100644 index cd897ae..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_stone_0.wav and /dev/null differ diff --git a/TrueCraft.Client/Content/Audio/footstep_stone_1.wav b/TrueCraft.Client/Content/Audio/footstep_stone_1.wav deleted file mode 100644 index cb5c2b0..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_stone_1.wav and /dev/null differ diff --git a/TrueCraft.Client/Content/Audio/footstep_stone_2.wav b/TrueCraft.Client/Content/Audio/footstep_stone_2.wav deleted file mode 100644 index 94f6637..0000000 Binary files a/TrueCraft.Client/Content/Audio/footstep_stone_2.wav and /dev/null differ diff --git a/TrueCraft.Client/Modules/PlayerControlModule.cs b/TrueCraft.Client/Modules/PlayerControlModule.cs index 2dd0bc5..5b985e9 100644 --- a/TrueCraft.Client/Modules/PlayerControlModule.cs +++ b/TrueCraft.Client/Modules/PlayerControlModule.cs @@ -8,6 +8,8 @@ using XVector3 = Microsoft.Xna.Framework.Vector3; using TrueCraft.API; using TrueCraft.Core.Logic; using TrueCraft.Core.Networking.Packets; +using TrueCraft.Core.Logic.Blocks; +using TrueCraft.API.Logic; namespace TrueCraft.Client.Modules { @@ -266,6 +268,19 @@ namespace TrueCraft.Client.Modules return false; } + private void PlayFootstep() + { + var coords = (Coordinates3D)Game.Client.BoundingBox.Min.Floor(); + var target = Game.Client.World.GetBlockID(coords); + if (target == AirBlock.BlockID) + target = Game.Client.World.GetBlockID(coords + Coordinates3D.Down); + var provider = Game.BlockRepository.GetBlockProvider(target); + if (provider.SoundEffect == SoundEffectClass.None) + return; + var effect = string.Format("footstep.{0}", Enum.GetName(typeof(SoundEffectClass), provider.SoundEffect).ToLower()); + Game.Audio.PlayPack(effect, 0.1f); + } + public override void Update(GameTime gameTime) { var delta = Delta; @@ -331,12 +346,13 @@ namespace TrueCraft.Client.Modules lookAt.X *= (float)(gameTime.ElapsedGameTime.TotalSeconds * 4.3717); lookAt.Z *= (float)(gameTime.ElapsedGameTime.TotalSeconds * 4.3717); + var bobbing = Game.Bobbing; Game.Bobbing += Math.Max(Math.Abs(lookAt.X), Math.Abs(lookAt.Z)); Game.Client.Velocity = new TVector3(lookAt.X, Game.Client.Velocity.Y, lookAt.Z); - if ((int)Game.Bobbing % 2 == 0) - Game.Audio.PlayPack("grass"); + if ((int)bobbing % 2 == 0 && (int)Game.Bobbing % 2 != 0) + PlayFootstep(); } else Game.Client.Velocity *= new TVector3(0, 1, 0); diff --git a/TrueCraft.Client/TrueCraft.Client.csproj b/TrueCraft.Client/TrueCraft.Client.csproj index b0ff619..368ed78 100644 --- a/TrueCraft.Client/TrueCraft.Client.csproj +++ b/TrueCraft.Client/TrueCraft.Client.csproj @@ -76,6 +76,9 @@ ..\packages\MonoGame.Framework.Linux.3.4.0.459\lib\net40\MonoGame.Framework.dll + + ..\packages\NVorbis.0.8.4.0\lib\NVorbis.dll + @@ -246,22 +249,118 @@ PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + PreserveNewest - + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + + PreserveNewest + + PreserveNewest diff --git a/TrueCraft.Client/TrueCraftGame.cs b/TrueCraft.Client/TrueCraftGame.cs index ba1a8ca..636265e 100644 --- a/TrueCraft.Client/TrueCraftGame.cs +++ b/TrueCraft.Client/TrueCraftGame.cs @@ -358,7 +358,7 @@ namespace TrueCraft.Client private void UpdateCamera() { - const double bobbingMultiplier = 0.015; + const double bobbingMultiplier = 0.05; var bobbing = Bobbing * 1.5; var xbob = Math.Cos(bobbing + Math.PI / 2) * bobbingMultiplier; diff --git a/TrueCraft.Client/packages.config b/TrueCraft.Client/packages.config index d31ee7f..8fa2b4e 100644 --- a/TrueCraft.Client/packages.config +++ b/TrueCraft.Client/packages.config @@ -1,6 +1,7 @@  - - + + + \ No newline at end of file diff --git a/TrueCraft.Core/Logic/BlockProvider.cs b/TrueCraft.Core/Logic/BlockProvider.cs index dff3f0f..727c27c 100644 --- a/TrueCraft.Core/Logic/BlockProvider.cs +++ b/TrueCraft.Core/Logic/BlockProvider.cs @@ -204,6 +204,8 @@ namespace TrueCraft.Core.Logic return Coordinates3D.Zero; } + public virtual SoundEffectClass SoundEffect { get { return SoundEffectClass.Stone; } } + /// /// The maximum amount that can be in a single stack of this block. /// diff --git a/TrueCraft.Core/Logic/Blocks/AirBlock.cs b/TrueCraft.Core/Logic/Blocks/AirBlock.cs index 649b204..c759334 100644 --- a/TrueCraft.Core/Logic/Blocks/AirBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/AirBlock.cs @@ -22,6 +22,14 @@ namespace TrueCraft.Core.Logic.Blocks public override BoundingBox? BoundingBox { get { return null; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.None; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(0, 0); diff --git a/TrueCraft.Core/Logic/Blocks/BedBlock.cs b/TrueCraft.Core/Logic/Blocks/BedBlock.cs index 4f74ac6..6062b9d 100644 --- a/TrueCraft.Core/Logic/Blocks/BedBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/BedBlock.cs @@ -39,6 +39,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Bed"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 8); diff --git a/TrueCraft.Core/Logic/Blocks/BookshelfBlock.cs b/TrueCraft.Core/Logic/Blocks/BookshelfBlock.cs index 74be2a5..6b10fe2 100644 --- a/TrueCraft.Core/Logic/Blocks/BookshelfBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/BookshelfBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Bookshelf"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override bool Flammable { get { return true; } } public override Tuple GetTextureMap(byte metadata) diff --git a/TrueCraft.Core/Logic/Blocks/CactusBlock.cs b/TrueCraft.Core/Logic/Blocks/CactusBlock.cs index f54221f..106fa44 100644 --- a/TrueCraft.Core/Logic/Blocks/CactusBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/CactusBlock.cs @@ -30,6 +30,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Cactus"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Cloth; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 4); diff --git a/TrueCraft.Core/Logic/Blocks/CakeBlock.cs b/TrueCraft.Core/Logic/Blocks/CakeBlock.cs index 0cdd132..8fd9f0b 100644 --- a/TrueCraft.Core/Logic/Blocks/CakeBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/CakeBlock.cs @@ -23,6 +23,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Cake"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Cloth; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(9, 7); diff --git a/TrueCraft.Core/Logic/Blocks/ChestBlock.cs b/TrueCraft.Core/Logic/Blocks/ChestBlock.cs index 544d335..72429df 100644 --- a/TrueCraft.Core/Logic/Blocks/ChestBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/ChestBlock.cs @@ -27,6 +27,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Chest"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(10, 1); diff --git a/TrueCraft.Core/Logic/Blocks/ClayBlock.cs b/TrueCraft.Core/Logic/Blocks/ClayBlock.cs index daf590d..e26ae6b 100644 --- a/TrueCraft.Core/Logic/Blocks/ClayBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/ClayBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Clay"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Gravel; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(8, 4); diff --git a/TrueCraft.Core/Logic/Blocks/CraftingTableBlock.cs b/TrueCraft.Core/Logic/Blocks/CraftingTableBlock.cs index 41f6e13..0901c16 100644 --- a/TrueCraft.Core/Logic/Blocks/CraftingTableBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/CraftingTableBlock.cs @@ -21,6 +21,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Crafting Table"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override bool BlockRightClicked(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user) { var window = new CraftingBenchWindow(user.Server.CraftingRepository, (InventoryWindow)user.Inventory); diff --git a/TrueCraft.Core/Logic/Blocks/CropsBlock.cs b/TrueCraft.Core/Logic/Blocks/CropsBlock.cs index 3e92c04..46c94d6 100644 --- a/TrueCraft.Core/Logic/Blocks/CropsBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/CropsBlock.cs @@ -24,6 +24,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Crops"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/DandelionBlock.cs b/TrueCraft.Core/Logic/Blocks/DandelionBlock.cs index 5908371..6e554ef 100644 --- a/TrueCraft.Core/Logic/Blocks/DandelionBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/DandelionBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Flower"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/DeadBushBlock.cs b/TrueCraft.Core/Logic/Blocks/DeadBushBlock.cs index 49dd479..8fa72b9 100644 --- a/TrueCraft.Core/Logic/Blocks/DeadBushBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/DeadBushBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Dead Bush"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/DirtBlock.cs b/TrueCraft.Core/Logic/Blocks/DirtBlock.cs index d5b52f4..4aa59ea 100644 --- a/TrueCraft.Core/Logic/Blocks/DirtBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/DirtBlock.cs @@ -17,6 +17,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Dirt"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Gravel; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(2, 0); diff --git a/TrueCraft.Core/Logic/Blocks/DoorBlock.cs b/TrueCraft.Core/Logic/Blocks/DoorBlock.cs index 8603696..136ca8e 100644 --- a/TrueCraft.Core/Logic/Blocks/DoorBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/DoorBlock.cs @@ -44,6 +44,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Wooden Door"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(1, 6); diff --git a/TrueCraft.Core/Logic/Blocks/FarmlandBlock.cs b/TrueCraft.Core/Logic/Blocks/FarmlandBlock.cs index fa42d2f..c5bf4ec 100644 --- a/TrueCraft.Core/Logic/Blocks/FarmlandBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/FarmlandBlock.cs @@ -30,12 +30,20 @@ namespace TrueCraft.Core.Logic.Blocks public override byte Luminance { get { return 0; } } - public override bool Opaque { get { return true; } } // TODO: Distinguish between opaque and instantly destroyable + public override bool Opaque { get { return true; } } public override byte LightOpacity { get { return 255; } } public override string DisplayName { get { return "Farmland"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Gravel; + } + } + protected override ItemStack[] GetDrop(BlockDescriptor descriptor, ItemStack item) { return new[] { new ItemStack(DirtBlock.BlockID) }; diff --git a/TrueCraft.Core/Logic/Blocks/FenceBlock.cs b/TrueCraft.Core/Logic/Blocks/FenceBlock.cs index 46d30dc..f168797 100644 --- a/TrueCraft.Core/Logic/Blocks/FenceBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/FenceBlock.cs @@ -23,6 +23,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Fence"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(4, 0); diff --git a/TrueCraft.Core/Logic/Blocks/FireBlock.cs b/TrueCraft.Core/Logic/Blocks/FireBlock.cs index c092388..5d4870b 100644 --- a/TrueCraft.Core/Logic/Blocks/FireBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/FireBlock.cs @@ -26,6 +26,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Fire"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; // Yeah, this is what Minecraft actually uses here + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(15, 1); diff --git a/TrueCraft.Core/Logic/Blocks/GlassBlock.cs b/TrueCraft.Core/Logic/Blocks/GlassBlock.cs index aced523..1d424d5 100644 --- a/TrueCraft.Core/Logic/Blocks/GlassBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/GlassBlock.cs @@ -22,6 +22,14 @@ namespace TrueCraft.Core.Logic.Blocks public override byte LightOpacity { get { return 0; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Glass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(1, 3); diff --git a/TrueCraft.Core/Logic/Blocks/GlowstoneBlock.cs b/TrueCraft.Core/Logic/Blocks/GlowstoneBlock.cs index 6bd5ee1..6e896ca 100644 --- a/TrueCraft.Core/Logic/Blocks/GlowstoneBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/GlowstoneBlock.cs @@ -21,6 +21,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Glowstone"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Glass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(9, 6); diff --git a/TrueCraft.Core/Logic/Blocks/GrassBlock.cs b/TrueCraft.Core/Logic/Blocks/GrassBlock.cs index 42db617..5c8fd3b 100644 --- a/TrueCraft.Core/Logic/Blocks/GrassBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/GrassBlock.cs @@ -46,6 +46,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Grass"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(0, 0); diff --git a/TrueCraft.Core/Logic/Blocks/GravelBlock.cs b/TrueCraft.Core/Logic/Blocks/GravelBlock.cs index 32152a3..9a47103 100644 --- a/TrueCraft.Core/Logic/Blocks/GravelBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/GravelBlock.cs @@ -23,6 +23,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Gravel"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Gravel; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(3, 1); diff --git a/TrueCraft.Core/Logic/Blocks/IceBlock.cs b/TrueCraft.Core/Logic/Blocks/IceBlock.cs index dfb6a69..85883e9 100644 --- a/TrueCraft.Core/Logic/Blocks/IceBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/IceBlock.cs @@ -24,6 +24,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Ice"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Glass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(3, 4); diff --git a/TrueCraft.Core/Logic/Blocks/JackoLanternBlock.cs b/TrueCraft.Core/Logic/Blocks/JackoLanternBlock.cs index aa785ba..4fca848 100644 --- a/TrueCraft.Core/Logic/Blocks/JackoLanternBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/JackoLanternBlock.cs @@ -24,6 +24,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Jack 'o' Lantern"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 6); diff --git a/TrueCraft.Core/Logic/Blocks/LadderBlock.cs b/TrueCraft.Core/Logic/Blocks/LadderBlock.cs index 0565000..3a52db0 100644 --- a/TrueCraft.Core/Logic/Blocks/LadderBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/LadderBlock.cs @@ -34,6 +34,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Ladder"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/LeavesBlock.cs b/TrueCraft.Core/Logic/Blocks/LeavesBlock.cs index 1bb052b..c3685d9 100644 --- a/TrueCraft.Core/Logic/Blocks/LeavesBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/LeavesBlock.cs @@ -28,6 +28,14 @@ namespace TrueCraft.Core.Logic.Blocks public override bool Flammable { get { return true; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(4, 3); diff --git a/TrueCraft.Core/Logic/Blocks/LeverBlock.cs b/TrueCraft.Core/Logic/Blocks/LeverBlock.cs index 4c8679b..650fb30 100644 --- a/TrueCraft.Core/Logic/Blocks/LeverBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/LeverBlock.cs @@ -21,6 +21,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Lever"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(0, 6); diff --git a/TrueCraft.Core/Logic/Blocks/LockedChestBlock.cs b/TrueCraft.Core/Logic/Blocks/LockedChestBlock.cs index bbb4a08..0d73c40 100644 --- a/TrueCraft.Core/Logic/Blocks/LockedChestBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/LockedChestBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Locked Chest"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(10, 1); diff --git a/TrueCraft.Core/Logic/Blocks/MushroomBlock.cs b/TrueCraft.Core/Logic/Blocks/MushroomBlock.cs index 16e8938..a4597d4 100644 --- a/TrueCraft.Core/Logic/Blocks/MushroomBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/MushroomBlock.cs @@ -9,6 +9,14 @@ namespace TrueCraft.Core.Logic.Blocks public override double BlastResistance { get { return 0; } } public override double Hardness { get { return 0; } } + + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } } public class BrownMushroomBlock : MushroomBlock diff --git a/TrueCraft.Core/Logic/Blocks/PortalBlock.cs b/TrueCraft.Core/Logic/Blocks/PortalBlock.cs index f3468f5..473246d 100644 --- a/TrueCraft.Core/Logic/Blocks/PortalBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/PortalBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Portal"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Glass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(14, 0); diff --git a/TrueCraft.Core/Logic/Blocks/PressurePlateBlock.cs b/TrueCraft.Core/Logic/Blocks/PressurePlateBlock.cs index 67315e8..b2e9b91 100644 --- a/TrueCraft.Core/Logic/Blocks/PressurePlateBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/PressurePlateBlock.cs @@ -23,6 +23,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Wooden Pressure Plate"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public ItemStack[,] Pattern { get diff --git a/TrueCraft.Core/Logic/Blocks/PumpkinBlock.cs b/TrueCraft.Core/Logic/Blocks/PumpkinBlock.cs index eb3e061..dd5f5da 100644 --- a/TrueCraft.Core/Logic/Blocks/PumpkinBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/PumpkinBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Pumpkin"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 6); diff --git a/TrueCraft.Core/Logic/Blocks/RedstoneRepeaterBlock.cs b/TrueCraft.Core/Logic/Blocks/RedstoneRepeaterBlock.cs index 015b86b..bae82bd 100644 --- a/TrueCraft.Core/Logic/Blocks/RedstoneRepeaterBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/RedstoneRepeaterBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Redstone Repeater"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 0); diff --git a/TrueCraft.Core/Logic/Blocks/RedstoneTorchBlock.cs b/TrueCraft.Core/Logic/Blocks/RedstoneTorchBlock.cs index fd460f2..56a980a 100644 --- a/TrueCraft.Core/Logic/Blocks/RedstoneTorchBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/RedstoneTorchBlock.cs @@ -21,6 +21,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Redstone Torch"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(3, 6); diff --git a/TrueCraft.Core/Logic/Blocks/RoseBlock.cs b/TrueCraft.Core/Logic/Blocks/RoseBlock.cs index 1a26d53..e7e2113 100644 --- a/TrueCraft.Core/Logic/Blocks/RoseBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/RoseBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Rose"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/SandBlock.cs b/TrueCraft.Core/Logic/Blocks/SandBlock.cs index b987e58..6f9e10d 100644 --- a/TrueCraft.Core/Logic/Blocks/SandBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SandBlock.cs @@ -22,6 +22,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Sand"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Sand; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(2, 1); diff --git a/TrueCraft.Core/Logic/Blocks/SlabBlock.cs b/TrueCraft.Core/Logic/Blocks/SlabBlock.cs index 16b18ed..8907e04 100644 --- a/TrueCraft.Core/Logic/Blocks/SlabBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SlabBlock.cs @@ -30,6 +30,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Stone Slab"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; // TODO: Deal with metadata god dammit + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 0); @@ -134,6 +142,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Double Stone Slab"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(6, 0); diff --git a/TrueCraft.Core/Logic/Blocks/SnowBlock.cs b/TrueCraft.Core/Logic/Blocks/SnowBlock.cs index ebf6fc5..da9693d 100644 --- a/TrueCraft.Core/Logic/Blocks/SnowBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SnowBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Snow Block"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Snow; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(2, 4); @@ -73,6 +81,14 @@ namespace TrueCraft.Core.Logic.Blocks public override BoundingBox? BoundingBox { get { return null; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Snow; + } + } + public override BoundingBox? InteractiveBoundingBox { get diff --git a/TrueCraft.Core/Logic/Blocks/SoulSandBlock.cs b/TrueCraft.Core/Logic/Blocks/SoulSandBlock.cs index 86d3cc6..b3bde6f 100644 --- a/TrueCraft.Core/Logic/Blocks/SoulSandBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SoulSandBlock.cs @@ -17,6 +17,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Soul Sand"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Sand; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(8, 6); diff --git a/TrueCraft.Core/Logic/Blocks/SpongeBlock.cs b/TrueCraft.Core/Logic/Blocks/SpongeBlock.cs index fb12ec4..22dcdbf 100644 --- a/TrueCraft.Core/Logic/Blocks/SpongeBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SpongeBlock.cs @@ -17,6 +17,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Sponge"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(0, 3); diff --git a/TrueCraft.Core/Logic/Blocks/StairsBlock.cs b/TrueCraft.Core/Logic/Blocks/StairsBlock.cs index 1cf5ebb..c291409 100644 --- a/TrueCraft.Core/Logic/Blocks/StairsBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/StairsBlock.cs @@ -69,6 +69,14 @@ namespace TrueCraft.Core.Logic.Blocks public override bool Flammable { get { return true; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public ItemStack[,] Pattern { get diff --git a/TrueCraft.Core/Logic/Blocks/SugarcaneBlock.cs b/TrueCraft.Core/Logic/Blocks/SugarcaneBlock.cs index e16857a..25c3333 100644 --- a/TrueCraft.Core/Logic/Blocks/SugarcaneBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/SugarcaneBlock.cs @@ -28,6 +28,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Sugar cane"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override BoundingBox? BoundingBox { get diff --git a/TrueCraft.Core/Logic/Blocks/TNTBlock.cs b/TrueCraft.Core/Logic/Blocks/TNTBlock.cs index 2b087f3..3133ccb 100644 --- a/TrueCraft.Core/Logic/Blocks/TNTBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/TNTBlock.cs @@ -19,6 +19,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "TNT"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(8, 0); diff --git a/TrueCraft.Core/Logic/Blocks/TallGrassBlock.cs b/TrueCraft.Core/Logic/Blocks/TallGrassBlock.cs index a2dec16..0b2ff7a 100644 --- a/TrueCraft.Core/Logic/Blocks/TallGrassBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/TallGrassBlock.cs @@ -28,6 +28,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Tall Grass"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Grass; + } + } + public override bool Flammable { get { return true; } } public override BoundingBox? BoundingBox { get { return null; } } diff --git a/TrueCraft.Core/Logic/Blocks/TorchBlock.cs b/TrueCraft.Core/Logic/Blocks/TorchBlock.cs index fa25dd8..d182ecc 100644 --- a/TrueCraft.Core/Logic/Blocks/TorchBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/TorchBlock.cs @@ -35,6 +35,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Torch"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override void BlockPlaced(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user) diff --git a/TrueCraft.Core/Logic/Blocks/TrapdoorBlock.cs b/TrueCraft.Core/Logic/Blocks/TrapdoorBlock.cs index c1e5da3..8d2d699 100644 --- a/TrueCraft.Core/Logic/Blocks/TrapdoorBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/TrapdoorBlock.cs @@ -37,6 +37,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Trapdoor"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(4, 5); diff --git a/TrueCraft.Core/Logic/Blocks/UprightSignBlock.cs b/TrueCraft.Core/Logic/Blocks/UprightSignBlock.cs index 97bba24..d7e35a8 100644 --- a/TrueCraft.Core/Logic/Blocks/UprightSignBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/UprightSignBlock.cs @@ -25,6 +25,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Sign"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override BoundingBox? InteractiveBoundingBox diff --git a/TrueCraft.Core/Logic/Blocks/WallSignBlock.cs b/TrueCraft.Core/Logic/Blocks/WallSignBlock.cs index 65e6080..f0cd9f0 100644 --- a/TrueCraft.Core/Logic/Blocks/WallSignBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/WallSignBlock.cs @@ -25,6 +25,14 @@ namespace TrueCraft.Core.Logic.Blocks public override string DisplayName { get { return "Sign"; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override BoundingBox? BoundingBox { get { return null; } } public override Tuple GetTextureMap(byte metadata) diff --git a/TrueCraft.Core/Logic/Blocks/WoodBlock.cs b/TrueCraft.Core/Logic/Blocks/WoodBlock.cs index f2fe161..38b2bee 100644 --- a/TrueCraft.Core/Logic/Blocks/WoodBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/WoodBlock.cs @@ -26,6 +26,14 @@ namespace TrueCraft.Core.Logic.Blocks public override bool Flammable { get { return true; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(4, 1); diff --git a/TrueCraft.Core/Logic/Blocks/WoodenPlanksBlock.cs b/TrueCraft.Core/Logic/Blocks/WoodenPlanksBlock.cs index 8f648c3..8d5cd7b 100644 --- a/TrueCraft.Core/Logic/Blocks/WoodenPlanksBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/WoodenPlanksBlock.cs @@ -20,6 +20,14 @@ namespace TrueCraft.Core.Logic.Blocks public override bool Flammable { get { return true; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Wood; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(4, 0); diff --git a/TrueCraft.Core/Logic/Blocks/WoolBlock.cs b/TrueCraft.Core/Logic/Blocks/WoolBlock.cs index ec7798f..8ba24b4 100644 --- a/TrueCraft.Core/Logic/Blocks/WoolBlock.cs +++ b/TrueCraft.Core/Logic/Blocks/WoolBlock.cs @@ -21,6 +21,14 @@ namespace TrueCraft.Core.Logic.Blocks public override bool Flammable { get { return true; } } + public override SoundEffectClass SoundEffect + { + get + { + return SoundEffectClass.Cloth; + } + } + public override Tuple GetTextureMap(byte metadata) { return new Tuple(0, 4);