2011-04-06 22:01:22 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Text;
|
|
|
|
|
|
|
|
|
|
namespace Substrate.Entities
|
|
|
|
|
{
|
|
|
|
|
using Substrate.NBT;
|
|
|
|
|
|
|
|
|
|
public class EntityMinecartFurnace : EntityMinecart
|
|
|
|
|
{
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public static readonly SchemaNodeCompound MinecartFurnaceSchema = MinecartSchema.MergeInto(new SchemaNodeCompound("")
|
2011-04-06 22:01:22 +00:00
|
|
|
|
{
|
2011-06-20 03:51:40 +00:00
|
|
|
|
new SchemaNodeScaler("PushX", TagType.TAG_DOUBLE),
|
|
|
|
|
new SchemaNodeScaler("PushZ", TagType.TAG_DOUBLE),
|
|
|
|
|
new SchemaNodeScaler("Fuel", TagType.TAG_SHORT),
|
2011-04-06 22:01:22 +00:00
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
private double _pushX;
|
|
|
|
|
private double _pushZ;
|
|
|
|
|
private short _fuel;
|
|
|
|
|
|
|
|
|
|
public double PushX
|
|
|
|
|
{
|
|
|
|
|
get { return _pushX; }
|
|
|
|
|
set { _pushX = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public double PushZ
|
|
|
|
|
{
|
|
|
|
|
get { return _pushZ; }
|
|
|
|
|
set { _pushZ = value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public int Fuel
|
|
|
|
|
{
|
|
|
|
|
get { return _fuel; }
|
|
|
|
|
set { _fuel = (short)value; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntityMinecartFurnace ()
|
|
|
|
|
: base()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public EntityMinecartFurnace (Entity e)
|
|
|
|
|
: base(e)
|
|
|
|
|
{
|
|
|
|
|
EntityMinecartFurnace e2 = e as EntityMinecartFurnace;
|
|
|
|
|
if (e2 != null) {
|
|
|
|
|
_pushX = e2._pushX;
|
|
|
|
|
_pushZ = e2._pushZ;
|
|
|
|
|
_fuel = e2._fuel;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region INBTObject<Entity> Members
|
|
|
|
|
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public override Entity LoadTree (TagNode tree)
|
2011-04-06 22:01:22 +00:00
|
|
|
|
{
|
2011-06-20 03:51:40 +00:00
|
|
|
|
TagNodeCompound ctree = tree as TagNodeCompound;
|
2011-04-06 22:01:22 +00:00
|
|
|
|
if (ctree == null || base.LoadTree(tree) == null) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
2011-04-09 02:50:42 +00:00
|
|
|
|
_pushX = ctree["PushX"].ToTagDouble();
|
|
|
|
|
_pushZ = ctree["PushZ"].ToTagDouble();
|
|
|
|
|
_fuel = ctree["Fuel"].ToTagShort();
|
2011-04-06 22:01:22 +00:00
|
|
|
|
|
|
|
|
|
return this;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public override TagNode BuildTree ()
|
2011-04-06 22:01:22 +00:00
|
|
|
|
{
|
2011-06-20 03:51:40 +00:00
|
|
|
|
TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
|
|
|
|
|
tree["PushX"] = new TagNodeDouble(_pushX);
|
|
|
|
|
tree["PushZ"] = new TagNodeDouble(_pushZ);
|
|
|
|
|
tree["Fuel"] = new TagNodeShort(_fuel);
|
2011-04-06 22:01:22 +00:00
|
|
|
|
|
|
|
|
|
return tree;
|
|
|
|
|
}
|
|
|
|
|
|
2011-06-20 03:51:40 +00:00
|
|
|
|
public override bool ValidateTree (TagNode tree)
|
2011-04-06 22:01:22 +00:00
|
|
|
|
{
|
|
|
|
|
return new NBTVerifier(tree, MinecartFurnaceSchema).Verify();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#region ICopyable<Entity> Members
|
|
|
|
|
|
|
|
|
|
public override Entity Copy ()
|
|
|
|
|
{
|
|
|
|
|
return new EntityMinecartFurnace(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endregion
|
|
|
|
|
}
|
|
|
|
|
}
|