diff --git a/SubstrateCS/Properties/AssemblyInfo.cs b/SubstrateCS/Properties/AssemblyInfo.cs index e9a8290..4358d79 100644 --- a/SubstrateCS/Properties/AssemblyInfo.cs +++ b/SubstrateCS/Properties/AssemblyInfo.cs @@ -30,8 +30,8 @@ using System.Runtime.InteropServices; // Build Number // Revision // -[assembly: AssemblyVersion("1.3.5.0")] -[assembly: AssemblyFileVersion("1.3.5.0")] +[assembly: AssemblyVersion("1.3.6.0")] +[assembly: AssemblyFileVersion("1.3.6.0")] // This library is compatible with all CLS-compliant .NET programming languages. [assembly: CLSCompliant(true)] \ No newline at end of file diff --git a/SubstrateCS/Source/BlockInfo.cs b/SubstrateCS/Source/BlockInfo.cs index 2bcdfea..88b4b9a 100644 --- a/SubstrateCS/Source/BlockInfo.cs +++ b/SubstrateCS/Source/BlockInfo.cs @@ -154,6 +154,14 @@ namespace Substrate public const int SPRUCE_WOOD_STAIRS = 134; public const int BIRCH_WOOD_STAIRS = 135; public const int JUNGLE_WOOD_STAIRS = 136; + public const int COMMAND_BLOCK = 137; + public const int BEACON_BLOCK = 138; + public const int COBBLESTONE_WALL = 139; + public const int FLOWER_POT = 140; + public const int CARROTS = 141; + public const int POTATOES = 142; + public const int WOOD_BUTTON = 143; + public const int HEADS = 144; } /// @@ -661,6 +669,14 @@ namespace Substrate public static BlockInfo SpruceWoodStairs; public static BlockInfo BirchWoodStairs; public static BlockInfo JungleWoodStairs; + public static BlockInfoEx CommandBlock; + public static BlockInfoEx BeaconBlock; + public static BlockInfo CobblestoneWall; + public static BlockInfo FlowerPot; + public static BlockInfo Carrots; + public static BlockInfo Potatoes; + public static BlockInfo WoodButton; + public static BlockInfo Heads; static BlockInfo () { @@ -809,6 +825,14 @@ namespace Substrate SpruceWoodStairs = new BlockInfo(134, "Sprice Wood Stairs").SetOpacity(0); BirchWoodStairs = new BlockInfo(135, "Birch Wood Stairs").SetOpacity(0); JungleWoodStairs = new BlockInfo(136, "Jungle Wood Stairs").SetOpacity(0); + CommandBlock = (BlockInfoEx)new BlockInfoEx(137, "Command Block"); + BeaconBlock = (BlockInfoEx)new BlockInfoEx(138, "Beacon Block").SetOpacity(0).SetLuminance(MAX_LUMINANCE); + CobblestoneWall = new BlockInfo(139, "Cobblestone Wall").SetOpacity(0); + FlowerPot = new BlockInfo(140, "Flower Pot").SetOpacity(0); + Carrots = new BlockInfo(141, "Carrots").SetOpacity(0).SetState(BlockState.NONSOLID).SetTick(10); + Potatoes = new BlockInfo(142, "Potatoes").SetOpacity(0).SetState(BlockState.NONSOLID).SetTick(10); + WoodButton = new BlockInfo(143, "Wooden Button").SetOpacity(0).SetState(BlockState.NONSOLID); + Heads = new BlockInfo(144, "Heads").SetOpacity(0); for (int i = 0; i < MAX_BLOCKS; i++) { if (_blockTable[i] == null) { @@ -854,6 +878,8 @@ namespace Substrate BrewingStand.SetTileEntity("Cauldron"); EndPortal.SetTileEntity("Airportal"); EnderChest.SetTileEntity("EnderChest"); + CommandBlock.SetTileEntity("Control"); + BeaconBlock.SetTileEntity("Beacon"); // Set Data Limits diff --git a/SubstrateCS/Source/Data.cs b/SubstrateCS/Source/Data.cs index f4f9aad..4314a47 100644 --- a/SubstrateCS/Source/Data.cs +++ b/SubstrateCS/Source/Data.cs @@ -414,6 +414,21 @@ namespace Substrate EYE_OF_ENDER = 0x4, } + public enum CocoaPlantSize + { + SMALL = 0x0, + MEDIUM = 0x4, + LARGE = 0x8, + } + + public enum CocoaPlantDirection + { + NORTH = 0, + EAST = 1, + SOUTH = 2, + WEST = 3, + } + public enum TripwireHookDirection { SOUTH = 0, @@ -436,6 +451,37 @@ namespace Substrate ACTIVATED = 0x04, } + public enum CobblestoneWallType + { + COBBLESTONE = 0, + MOSS_STONE = 1, + } + + public enum FlowerPotType + { + EMPTY = 0, + ROSE = 1, + DANDELION = 2, + OAK_SAPLING = 3, + SPRUCE_SAPLING = 4, + BIRCH_SAPLING = 5, + JUNGLE_SAPLING = 6, + RED_MUSHROOM = 7, + BROWN_MUSHROOM = 8, + CACTUS = 9, + DEAD_BUSH = 10, + FERN = 11, + } + + public enum HeadType + { + SKELETON = 0, + WITHER_SKELETON = 1, + ZOMBIE = 2, + HUMAN = 3, + CREEPER = 4, + } + // Item Data public enum CoalType diff --git a/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs b/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs new file mode 100644 index 0000000..cf5ea7b --- /dev/null +++ b/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs @@ -0,0 +1,111 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Substrate.TileEntities +{ + using Substrate.Nbt; + + public class TileEntityBeacon : TileEntity + { + public static readonly SchemaNodeCompound BeaconSchema = TileEntity.Schema.MergeInto(new SchemaNodeCompound("") + { + new SchemaNodeString("id", TypeId), + new SchemaNodeScaler("Levels", TagType.TAG_INT), + new SchemaNodeScaler("Primary", TagType.TAG_INT), + new SchemaNodeScaler("Secondary", TagType.TAG_INT), + }); + + public static string TypeId + { + get { return "Beacon"; } + } + + private int _levels; + private int _primary; + private int _secondary; + + public int Levels + { + get { return _levels; } + set { _levels = value; } + } + + public int Primary + { + get { return _primary; } + set { _primary = value; } + } + + public int Secondary + { + get { return _secondary; } + set { _secondary = value; } + } + + protected TileEntityBeacon (string id) + : base(id) + { + } + + public TileEntityBeacon () + : this(TypeId) + { + } + + public TileEntityBeacon (TileEntity te) + : base(te) + { + TileEntityBeacon tes = te as TileEntityBeacon; + if (tes != null) { + _levels = tes._levels; + _primary = tes._primary; + _secondary = tes._secondary; + } + } + + + #region ICopyable Members + + public override TileEntity Copy () + { + return new TileEntityMusic(this); + } + + #endregion + + + #region INBTObject Members + + public override TileEntity LoadTree (TagNode tree) + { + TagNodeCompound ctree = tree as TagNodeCompound; + if (ctree == null || base.LoadTree(tree) == null) { + return null; + } + + _levels = ctree["Levels"].ToTagInt(); + _primary = ctree["Primary"].ToTagInt(); + _secondary = ctree["Secondary"].ToTagInt(); + + return this; + } + + public override TagNode BuildTree () + { + TagNodeCompound tree = base.BuildTree() as TagNodeCompound; + tree["Levels"] = new TagNodeInt(_levels); + tree["Primary"] = new TagNodeInt(_primary); + tree["Secondary"] = new TagNodeInt(_secondary); + + return tree; + } + + public override bool ValidateTree (TagNode tree) + { + return new NbtVerifier(tree, BeaconSchema).Verify(); + } + + #endregion + } +} diff --git a/SubstrateCS/Source/TileEntities/TileEntityControl.cs b/SubstrateCS/Source/TileEntities/TileEntityControl.cs new file mode 100644 index 0000000..4945b8e --- /dev/null +++ b/SubstrateCS/Source/TileEntities/TileEntityControl.cs @@ -0,0 +1,89 @@ +using System; +using System.Collections.Generic; +using System.Text; + +namespace Substrate.TileEntities +{ + using Substrate.Nbt; + + public class TileEntityControl : TileEntity + { + public static readonly SchemaNodeCompound ControlSchema = TileEntity.Schema.MergeInto(new SchemaNodeCompound("") + { + new SchemaNodeString("id", TypeId), + new SchemaNodeScaler("Command", TagType.TAG_STRING), + }); + + public static string TypeId + { + get { return "Control"; } + } + + private string _command; + + public string Command + { + get { return _command; } + set { _command = value; } + } + + protected TileEntityControl (string id) + : base(id) + { + } + + public TileEntityControl () + : this(TypeId) + { + } + + public TileEntityControl (TileEntity te) + : base(te) + { + TileEntityControl tes = te as TileEntityControl; + if (tes != null) { + _command = tes._command; + } + } + + + #region ICopyable Members + + public override TileEntity Copy () + { + return new TileEntityMusic(this); + } + + #endregion + + + #region INBTObject Members + + public override TileEntity LoadTree (TagNode tree) + { + TagNodeCompound ctree = tree as TagNodeCompound; + if (ctree == null || base.LoadTree(tree) == null) { + return null; + } + + _command = ctree["Command"].ToTagString(); + + return this; + } + + public override TagNode BuildTree () + { + TagNodeCompound tree = base.BuildTree() as TagNodeCompound; + tree["Command"] = new TagNodeString(_command); + + return tree; + } + + public override bool ValidateTree (TagNode tree) + { + return new NbtVerifier(tree, ControlSchema).Verify(); + } + + #endregion + } +} diff --git a/SubstrateCS/Source/TileEntityFactory.cs b/SubstrateCS/Source/TileEntityFactory.cs index 48bd00e..cb2f033 100644 --- a/SubstrateCS/Source/TileEntityFactory.cs +++ b/SubstrateCS/Source/TileEntityFactory.cs @@ -91,8 +91,10 @@ namespace Substrate static TileEntityFactory () { _registry[TileEntityEndPortal.TypeId] = typeof(TileEntityEndPortal); + _registry[TileEntityBeacon.TypeId] = typeof(TileEntityBeacon); _registry[TileEntityBrewingStand.TypeId] = typeof(TileEntityBrewingStand); _registry[TileEntityChest.TypeId] = typeof(TileEntityChest); + _registry[TileEntityControl.TypeId] = typeof(TileEntityControl); _registry[TileEntityEnchantmentTable.TypeId] = typeof(TileEntityEnchantmentTable); _registry[TileEntityFurnace.TypeId] = typeof(TileEntityFurnace); _registry[TileEntityMobSpawner.TypeId] = typeof(TileEntityMobSpawner); diff --git a/SubstrateCS/Substrate (NET2).csproj b/SubstrateCS/Substrate (NET2).csproj index 78d3b48..b0e4030 100644 --- a/SubstrateCS/Substrate (NET2).csproj +++ b/SubstrateCS/Substrate (NET2).csproj @@ -206,8 +206,10 @@ + + diff --git a/SubstrateCS/Substrate (NET4).csproj b/SubstrateCS/Substrate (NET4).csproj index 5b4c800..125169f 100644 --- a/SubstrateCS/Substrate (NET4).csproj +++ b/SubstrateCS/Substrate (NET4).csproj @@ -163,7 +163,6 @@ - @@ -207,8 +206,10 @@ + +