From 40478ea46fcf583c46432356a3bcb8f4f48f81be Mon Sep 17 00:00:00 2001 From: timeDev Date: Sun, 16 Sep 2012 13:00:07 +0200 Subject: [PATCH 1/3] Fixes Copy returning wrong type --- SubstrateCS/Source/TileEntities/TileEntityBeacon.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs b/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs index cf5ea7b..369d996 100644 --- a/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs +++ b/SubstrateCS/Source/TileEntities/TileEntityBeacon.cs @@ -69,7 +69,7 @@ namespace Substrate.TileEntities public override TileEntity Copy () { - return new TileEntityMusic(this); + return new TileEntityBeacon(this); } #endregion From 2b8c40f9c35da850ad85330924227274a05c3ab9 Mon Sep 17 00:00:00 2001 From: timeDev Date: Sat, 22 Sep 2012 17:03:52 +0200 Subject: [PATCH 2/3] Fixed the same issue again, just for TileEntityControl *Fixed TileEntityControl.Copy() returning a TileEntityMusic --- SubstrateCS/Source/TileEntities/TileEntityControl.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SubstrateCS/Source/TileEntities/TileEntityControl.cs b/SubstrateCS/Source/TileEntities/TileEntityControl.cs index 4945b8e..d9d6a5d 100644 --- a/SubstrateCS/Source/TileEntities/TileEntityControl.cs +++ b/SubstrateCS/Source/TileEntities/TileEntityControl.cs @@ -51,7 +51,7 @@ namespace Substrate.TileEntities public override TileEntity Copy () { - return new TileEntityMusic(this); + return new TileEntityControl(this); } #endregion From 0109e90475cd5bfa672a73f01e10563289334431 Mon Sep 17 00:00:00 2001 From: timeDev Date: Sat, 22 Sep 2012 17:43:07 +0200 Subject: [PATCH 3/3] Added Minecraft 1.3 Monster Spawner Functionality Signed-off-by: timeDev --- .../TileEntities/TileEntityMobSpawner.cs | 41 ++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/SubstrateCS/Source/TileEntities/TileEntityMobSpawner.cs b/SubstrateCS/Source/TileEntities/TileEntityMobSpawner.cs index b301b8f..4464a80 100644 --- a/SubstrateCS/Source/TileEntities/TileEntityMobSpawner.cs +++ b/SubstrateCS/Source/TileEntities/TileEntityMobSpawner.cs @@ -13,6 +13,10 @@ namespace Substrate.TileEntities new SchemaNodeString("id", TypeId), new SchemaNodeScaler("EntityId", TagType.TAG_STRING), new SchemaNodeScaler("Delay", TagType.TAG_SHORT), + new SchemaNodeScaler("MaxSpawnDelay", TagType.TAG_SHORT, SchemaOptions.CREATE_ON_MISSING), + new SchemaNodeScaler("MinSpawnDelay", TagType.TAG_SHORT, SchemaOptions.CREATE_ON_MISSING), + new SchemaNodeScaler("SpawnCount", TagType.TAG_SHORT), + Entity.Schema.MergeInto(new SchemaNodeCompound("SpawnData", SchemaOptions.OPTIONAL)) }); public static string TypeId @@ -22,6 +26,10 @@ namespace Substrate.TileEntities private short _delay; private string _entityID; + private short _maxDelay; + private short _minDelay; + private short _spawnCount; + private Entity _spawnData; public int Delay { @@ -29,12 +37,36 @@ namespace Substrate.TileEntities set { _delay = (short)value; } } + public Entity SpawnData + { + get { return _spawnData; } + set { _spawnData = value; } + } + public string EntityID { get { return _entityID; } set { _entityID = value; } } + public short MaxSpawnDelay + { + get { return _maxDelay; } + set { _maxDelay = value; } + } + + public short MinSpawnDelay + { + get { return _minDelay; } + set { _minDelay = value; } + } + + public short SpawnCount + { + get { return _spawnCount; } + set { _spawnCount = value; } + } + protected TileEntityMobSpawner (string id) : base(id) { @@ -77,6 +109,10 @@ namespace Substrate.TileEntities _delay = ctree["Delay"].ToTagShort(); _entityID = ctree["EntityId"].ToTagString(); + _maxDelay = ctree["MaxSpawnDelay"].ToTagShort(); + _minDelay = ctree["MinSpawnDelay"].ToTagShort(); + _spawnCount = ctree["SpawnCount"].ToTagShort(); + _spawnData = new Entity().LoadTree(ctree["SpawnData"].ToTagCompound()); return this; } @@ -86,7 +122,10 @@ namespace Substrate.TileEntities TagNodeCompound tree = base.BuildTree() as TagNodeCompound; tree["EntityId"] = new TagNodeString(_entityID); tree["Delay"] = new TagNodeShort(_delay); - + tree["MaxSpawnDelay"] = new TagNodeShort(_maxDelay); + tree["MinSpawnDelay"] = new TagNodeShort(_minDelay); + tree["SpawnCount"] = new TagNodeShort(_spawnCount); + tree["SpawnData"] = _spawnData.BuildTree(); return tree; }