145 lines
4.3 KiB
C#
Raw Normal View History

2014-12-28 18:55:46 -07:00
using System;
using TrueCraft.API.Logic;
using TrueCraft.API;
using TrueCraft.Core.Logic.Items;
2014-12-28 18:55:46 -07:00
namespace TrueCraft.Core.Logic.Blocks
{
public class RailBlock : BlockProvider, ICraftingRecipe
2014-12-28 18:55:46 -07:00
{
public static readonly byte BlockID = 0x42;
public override byte ID { get { return 0x42; } }
2015-01-22 00:49:50 -05:00
public override double BlastResistance { get { return 3.5; } }
2014-12-28 18:55:46 -07:00
public override double Hardness { get { return 0.7; } }
2015-01-22 00:49:50 -05:00
public override byte Luminance { get { return 0; } }
public override bool Opaque { get { return false; } }
2015-01-22 00:49:50 -05:00
2014-12-28 18:55:46 -07:00
public override string DisplayName { get { return "Rail"; } }
2015-01-22 00:49:50 -05:00
public override Tuple<int, int> GetTextureMap(byte metadata)
{
return new Tuple<int, int>(0, 8);
}
public virtual ItemStack[,] Pattern
{
get
{
return new[,]
{
{
new ItemStack(IronIngotItem.ItemID),
ItemStack.EmptyStack,
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
new ItemStack(StickItem.ItemID),
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
ItemStack.EmptyStack,
new ItemStack(IronIngotItem.ItemID),
}
};
}
}
public ItemStack Output
{
get
{
return new ItemStack(BlockID);
}
}
public bool SignificantMetadata
{
get { return false; }
}
2014-12-28 18:55:46 -07:00
}
public class PoweredRailBlock : RailBlock
{
public static readonly new byte BlockID = 0x1B;
public override byte ID { get { return 0x1B; } }
public override string DisplayName { get { return "Powered Rail"; } }
public override Tuple<int, int> GetTextureMap(byte metadata)
{
return new Tuple<int, int>(3, 11);
}
public override ItemStack[,] Pattern
{
get
{
return new[,]
{
{
new ItemStack(IronIngotItem.ItemID),
ItemStack.EmptyStack,
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
new ItemStack(StickItem.ItemID),
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
new ItemStack(RedstoneDustBlock.BlockID),
new ItemStack(IronIngotItem.ItemID),
}
};
}
}
}
public class DetectorRailBlock : RailBlock
{
public static readonly new byte BlockID = 0x1C;
public override byte ID { get { return 0x1C; } }
public override string DisplayName { get { return "Detector Rail"; } }
public override Tuple<int, int> GetTextureMap(byte metadata)
{
return new Tuple<int, int>(3, 12);
}
public override ItemStack[,] Pattern
{
get
{
return new[,]
{
{
new ItemStack(IronIngotItem.ItemID),
ItemStack.EmptyStack,
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
new ItemStack(StonePressurePlateBlock.BlockID),
new ItemStack(IronIngotItem.ItemID),
},
{
new ItemStack(IronIngotItem.ItemID),
new ItemStack(RedstoneDustBlock.BlockID),
new ItemStack(IronIngotItem.ItemID),
}
};
}
}
}
2014-12-28 18:55:46 -07:00
}