Fixed IceBlock and implemented more drops

Replaced the fully qualified names in IceBlock.cs with using directives.
Added the proper drops to more blocks.
This commit is contained in:
Daniel Vidmar 2015-02-04 12:58:52 -05:00
parent 6380aef536
commit b01322d3bc
10 changed files with 70 additions and 1 deletions

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -21,5 +23,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(2, 2);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(CoalItem.ItemID, 1, descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -25,5 +27,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(11, 0);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(StringItem.ItemID, 1, descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -21,5 +23,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(2, 3);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(DiamondItem.ItemID, 1, descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -23,5 +25,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(9, 6);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(GlowstoneDustItem.ItemID, (sbyte)new Random().Next(2, 4), descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -21,5 +23,14 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(3, 1);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
//Gravel has a 10% chance of dropping flint.
if (MathHelper.Random.Next(10) == 0)
return new[] { new ItemStack(FlintItem.ItemID, 1, descriptor.Metadata) };
else
return new ItemStack[0];
}
}
}

View File

@ -1,5 +1,8 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.API.World;
using TrueCraft.API.Networking;
namespace TrueCraft.Core.Logic.Blocks
{
@ -26,7 +29,7 @@ namespace TrueCraft.Core.Logic.Blocks
return new Tuple<int, int>(3, 4);
}
public override void BlockMined(BlockDescriptor descriptor, API.BlockFace face, API.World.IWorld world, API.Networking.IRemoteClient user)
public override void BlockMined(BlockDescriptor descriptor, BlockFace face, IWorld world, IRemoteClient user)
{
world.SetBlockID(descriptor.Coordinates, WaterBlock.BlockID);
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.Core.Logic.Items;
using TrueCraft.API;
namespace TrueCraft.Core.Logic.Blocks
{
@ -23,5 +25,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(4, 10);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(RedstoneItem.ItemID, 1, descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
namespace TrueCraft.Core.Logic.Blocks
{
@ -21,6 +23,11 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(3, 3);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(RedstoneItem.ItemID, (sbyte)new Random().Next(4, 5), descriptor.Metadata) };
}
}
public class GlowingRedstoneOreBlock : RedstoneOreBlock

View File

@ -1,5 +1,6 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
namespace TrueCraft.Core.Logic.Blocks
{
@ -21,5 +22,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(1, 0);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(CobblestoneBlock.BlockID, 1, descriptor.Metadata) };
}
}
}

View File

@ -1,5 +1,7 @@
using System;
using TrueCraft.API.Logic;
using TrueCraft.Core.Logic.Items;
using TrueCraft.API;
namespace TrueCraft.Core.Logic.Blocks
{
@ -23,5 +25,10 @@ namespace TrueCraft.Core.Logic.Blocks
{
return new Tuple<int, int>(7, 2);
}
protected override ItemStack[] GetDrop(BlockDescriptor descriptor)
{
return new[] { new ItemStack(SeedsItem.ItemID, (sbyte)new Random().Next(0, 1), descriptor.Metadata) };
}
}
}