Merge branch 'client-audio'
This commit is contained in:
commit
de880f2f8c
@ -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; }
|
||||
|
17
TrueCraft.API/Logic/SoundEffectClass.cs
Normal file
17
TrueCraft.API/Logic/SoundEffectClass.cs
Normal file
@ -0,0 +1,17 @@
|
||||
using System;
|
||||
|
||||
namespace TrueCraft.API.Logic
|
||||
{
|
||||
public enum SoundEffectClass
|
||||
{
|
||||
None,
|
||||
Cloth,
|
||||
Grass,
|
||||
Gravel,
|
||||
Sand,
|
||||
Snow,
|
||||
Stone,
|
||||
Wood,
|
||||
Glass
|
||||
}
|
||||
}
|
@ -40,7 +40,7 @@
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="YamlDotNet">
|
||||
<HintPath>..\packages\YamlDotNet.3.6.1\lib\net35\YamlDotNet.dll</HintPath>
|
||||
<HintPath>..\packages\YamlDotNet.3.7.0\lib\net35\YamlDotNet.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
@ -124,6 +124,7 @@
|
||||
<Compile Include="Physics\IAABBEntity.cs" />
|
||||
<Compile Include="Logic\ISmeltableItem.cs" />
|
||||
<Compile Include="Logic\IBurnableItem.cs" />
|
||||
<Compile Include="Logic\SoundEffectClass.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup />
|
||||
@ -133,11 +134,11 @@
|
||||
<Name>fNbt</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="AI\" />
|
||||
<Folder Include="Physics\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="YamlDotNet" version="3.6.1" targetFramework="net45" />
|
||||
<package id="YamlDotNet" version="3.7.0" targetFramework="net45" />
|
||||
</packages>
|
120
TrueCraft.Client/AudioManager.cs
Normal file
120
TrueCraft.Client/AudioManager.cs
Normal file
@ -0,0 +1,120 @@
|
||||
using System;
|
||||
using Microsoft.Xna.Framework.Audio;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using TrueCraft.Core;
|
||||
using Microsoft.Xna.Framework.Content;
|
||||
using NVorbis;
|
||||
|
||||
namespace TrueCraft.Client
|
||||
{
|
||||
public class AudioManager
|
||||
{
|
||||
private Dictionary<string, SoundEffect[]> AudioPacks { get; set; }
|
||||
|
||||
public float EffectVolume { get; set; }
|
||||
public float MusicVolume { get; set; }
|
||||
|
||||
public AudioManager()
|
||||
{
|
||||
AudioPacks = new Dictionary<string, SoundEffect[]>();
|
||||
EffectVolume = MusicVolume = 1;
|
||||
}
|
||||
|
||||
public void LoadDefaultPacks(ContentManager content)
|
||||
{
|
||||
string[][] packs = new[]
|
||||
{
|
||||
new[]
|
||||
{
|
||||
"footstep.cloth",
|
||||
"default_sand_footstep.1.ogg", "default_sand_footstep.2.ogg" // TODO: Cloth sound effects
|
||||
},
|
||||
new[]
|
||||
{
|
||||
"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)
|
||||
{
|
||||
var name = pack[0];
|
||||
LoadAudioPack(name, pack.Skip(1).ToArray());
|
||||
}
|
||||
}
|
||||
|
||||
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])))
|
||||
{
|
||||
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, float volume = 1.0f)
|
||||
{
|
||||
var i = MathHelper.Random.Next(0, AudioPacks[pack].Length);
|
||||
var instance = AudioPacks[pack][i].CreateInstance();
|
||||
instance.Volume = volume * EffectVolume;
|
||||
instance.Play();
|
||||
}
|
||||
}
|
||||
}
|
1
TrueCraft.Client/Content/Audio/credits.txt
Normal file
1
TrueCraft.Client/Content/Audio/credits.txt
Normal file
@ -0,0 +1 @@
|
||||
The footstep and mining/placement sound effects were sourced from Minetest under CC-BY-SA: https://github.com/minetest/minetest_game
|
BIN
TrueCraft.Client/Content/Audio/default_break_glass.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_break_glass.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_break_glass.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_break_glass.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_break_glass.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_break_glass.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_cool_lava.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dig_choppy.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dig_choppy.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dig_cracky.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dig_cracky.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dig_crumbly.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dig_crumbly.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dig_dig_immediate.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dig_dig_immediate.ogg
Normal file
Binary file not shown.
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dirt_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dirt_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dirt_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dirt_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dug_node.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dug_node.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_dug_node.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_dug_node.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_glass_footstep.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_glass_footstep.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_grass_footstep.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.4.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_gravel_footstep.4.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_hard_footstep.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_place_node.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_place_node.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_place_node.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_place_node.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_place_node.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_place_node.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_place_node_hard.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_place_node_hard.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_place_node_hard.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_place_node_hard.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_sand_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_sand_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_sand_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_sand_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.2.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.3.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_snow_footstep.3.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_wood_footstep.1.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_wood_footstep.1.ogg
Normal file
Binary file not shown.
BIN
TrueCraft.Client/Content/Audio/default_wood_footstep.2.ogg
Normal file
BIN
TrueCraft.Client/Content/Audio/default_wood_footstep.2.ogg
Normal file
Binary file not shown.
@ -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,9 +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)bobbing % 2 == 0 && (int)Game.Bobbing % 2 != 0)
|
||||
PlayFootstep();
|
||||
}
|
||||
else
|
||||
Game.Client.Velocity *= new TVector3(0, 1, 0);
|
||||
|
@ -76,6 +76,9 @@
|
||||
<Reference Include="MonoGame.Framework">
|
||||
<HintPath>..\packages\MonoGame.Framework.Linux.3.4.0.459\lib\net40\MonoGame.Framework.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NVorbis">
|
||||
<HintPath>..\packages\NVorbis.0.8.4.0\lib\NVorbis.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Input\KeyboardEventArgs.cs" />
|
||||
@ -141,6 +144,7 @@
|
||||
<Compile Include="Input\GamePadHandler.cs" />
|
||||
<Compile Include="Input\GamePadEventArgs.cs" />
|
||||
<Compile Include="Input\GamePadButtonEventArgs.cs" />
|
||||
<Compile Include="AudioManager.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
@ -242,8 +246,126 @@
|
||||
<Content Include="Content\icons.png">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\credits.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_break_glass.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_break_glass.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_break_glass.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_cool_lava.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_cool_lava.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_cool_lava.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dig_choppy.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dig_cracky.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dig_crumbly.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dig_dig_immediate.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dig_oddly_breakable_by_hand.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dirt_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dirt_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dug_node.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_dug_node.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_glass_footstep.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_grass_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_grass_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_grass_footstep.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_gravel_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_gravel_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_gravel_footstep.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_gravel_footstep.4.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_hard_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_hard_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_hard_footstep.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_place_node.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_place_node.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_place_node.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_place_node_hard.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_place_node_hard.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_sand_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_sand_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_snow_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_snow_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_snow_footstep.3.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_wood_footstep.1.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="Content\Audio\default_wood_footstep.2.ogg">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Modules\" />
|
||||
<Folder Include="Content\Audio\" />
|
||||
</ItemGroup>
|
||||
</Project>
|
@ -38,6 +38,7 @@ namespace TrueCraft.Client
|
||||
public DateTime StartDigging { get; set; }
|
||||
public DateTime EndDigging { get; set; }
|
||||
public Coordinates3D TargetBlock { get; set; }
|
||||
public AudioManager Audio { get; set; }
|
||||
|
||||
private List<IGameplayModule> Modules { get; set; }
|
||||
private SpriteBatch SpriteBatch { get; set; }
|
||||
@ -115,6 +116,9 @@ namespace TrueCraft.Client
|
||||
|
||||
base.Initialize(); // (calls LoadContent)
|
||||
|
||||
Audio = new AudioManager();
|
||||
Audio.LoadDefaultPacks(Content);
|
||||
|
||||
ChunkModule = new ChunkModule(this);
|
||||
DebugInfoModule = new DebugInfoModule(this, Pixel);
|
||||
|
||||
@ -354,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;
|
||||
|
@ -1,6 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MonoGame.Framework.Linux" version="3.4.0.459" targetFramework="net45" userInstalled="true" />
|
||||
<package id="MonoGame.Framework.WindowsGL" version="3.4.0.459" targetFramework="net45" userInstalled="true" />
|
||||
<package id="MonoGame.Framework.MacOS" version="3.4.0.459" targetFramework="net45" userInstalled="true" />
|
||||
</packages>
|
||||
<package id="MonoGame.Framework.WindowsGL" version="3.4.0.459" targetFramework="net45" userInstalled="true" />
|
||||
<package id="NVorbis" version="0.8.4.0" targetFramework="net45" />
|
||||
</packages>
|
@ -205,6 +205,8 @@ namespace TrueCraft.Core.Logic
|
||||
return Coordinates3D.Zero;
|
||||
}
|
||||
|
||||
public virtual SoundEffectClass SoundEffect { get { return SoundEffectClass.Stone; } }
|
||||
|
||||
/// <summary>
|
||||
/// The maximum amount that can be in a single stack of this block.
|
||||
/// </summary>
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(0, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 8);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 4);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(9, 7);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(10, 1);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(8, 4);
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(2, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(1, 6);
|
||||
|
@ -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) };
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(4, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(15, 1);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(1, 3);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(9, 6);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(0, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(3, 1);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(3, 4);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 6);
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(4, 3);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(0, 6);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(10, 1);
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(14, 0);
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 6);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(3, 6);
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(2, 1);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(6, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(8, 6);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(0, 3);
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(8, 0);
|
||||
|
@ -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; } }
|
||||
|
@ -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)
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(4, 5);
|
||||
|
@ -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
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(4, 1);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(4, 0);
|
||||
|
@ -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<int, int> GetTextureMap(byte metadata)
|
||||
{
|
||||
return new Tuple<int, int>(0, 4);
|
||||
|
Reference in New Issue
Block a user