Added info for 1.4 block types

This commit is contained in:
Justin Aquadro 2012-09-09 16:01:30 -04:00
parent 81920ef73d
commit d4651bfdf6
8 changed files with 280 additions and 3 deletions

View file

@ -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)]

View file

@ -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;
}
/// <summary>
@ -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

View file

@ -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

View file

@ -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<TileEntity> Members
public override TileEntity Copy ()
{
return new TileEntityMusic(this);
}
#endregion
#region INBTObject<TileEntity> 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
}
}

View file

@ -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<TileEntity> Members
public override TileEntity Copy ()
{
return new TileEntityMusic(this);
}
#endregion
#region INBTObject<TileEntity> 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
}
}

View file

@ -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);

View file

@ -206,8 +206,10 @@
<Compile Include="Source\Core\RegionManager.cs" />
<Compile Include="Source\SpawnPoint.cs" />
<Compile Include="Source\SubstrateException.cs" />
<Compile Include="Source\TileEntities\TileEntityBeacon.cs" />
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
<Compile Include="Source\TileEntities\TileEntityChest.cs" />
<Compile Include="Source\TileEntities\TileEntityControl.cs" />
<Compile Include="Source\TileEntities\TileEntityEnchantmentTable.cs" />
<Compile Include="Source\TileEntities\TileEntityEndPortal.cs" />
<Compile Include="Source\TileEntities\TileEntityFurnace.cs" />

View file

@ -163,7 +163,6 @@
<Compile Include="Source\Core\BlockInterface.cs" />
<Compile Include="Source\Core\BlockKey.cs" />
<Compile Include="Source\BlockManager.cs" />
<None Include="Source\Chunk.cs" />
<Compile Include="Source\Core\ChunkFile.cs" />
<Compile Include="Source\AlphaChunkManager.cs" />
<Compile Include="Source\Core\ChunkInterface.cs" />
@ -207,8 +206,10 @@
<Compile Include="Source\RegionChunkManager.cs" />
<Compile Include="Source\SpawnPoint.cs" />
<Compile Include="Source\SubstrateException.cs" />
<Compile Include="Source\TileEntities\TileEntityBeacon.cs" />
<Compile Include="Source\TileEntities\TileEntityBrewingStand.cs" />
<Compile Include="Source\TileEntities\TileEntityChest.cs" />
<Compile Include="Source\TileEntities\TileEntityControl.cs" />
<Compile Include="Source\TileEntities\TileEntityEnchantmentTable.cs" />
<Compile Include="Source\TileEntities\TileEntityEndPortal.cs" />
<Compile Include="Source\TileEntities\TileEntityFurnace.cs" />