mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Add block material database
Taken from Bukkit's Material class, with credits. Allows to know types and properties of blocks. + Use database for "is solid" checks + Add "can harm players" method + Faster movements, falling seems natural now + Shorter error message when ping failed
This commit is contained in:
parent
5d8d42e3d1
commit
49702e30b8
6 changed files with 367 additions and 30 deletions
|
|
@ -46,13 +46,13 @@ namespace MinecraftClient.Mapping
|
|||
}
|
||||
|
||||
/// <summary>
|
||||
/// Check if the block can be passed through or not
|
||||
/// Material of the block
|
||||
/// </summary>
|
||||
public bool Solid
|
||||
public Material Type
|
||||
{
|
||||
get
|
||||
{
|
||||
return BlockId != 0;
|
||||
return (Material)BlockId;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -71,22 +71,18 @@ namespace MinecraftClient.Mapping
|
|||
/// <summary>
|
||||
/// Get a block of the specified type and metadata
|
||||
/// </summary>
|
||||
/// <param name="typeAndMeta"></param>
|
||||
/// <param name="typeAndMeta">Type and metadata packed in the same value</param>
|
||||
public Block(ushort typeAndMeta)
|
||||
{
|
||||
this.blockIdAndMeta = typeAndMeta;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Represents an empty block
|
||||
/// Get a block of the specified type and metadata
|
||||
/// </summary>
|
||||
public static Block Air
|
||||
{
|
||||
get
|
||||
{
|
||||
return new Block(0);
|
||||
}
|
||||
}
|
||||
/// <param name="type">Block type</param>
|
||||
public Block(Material type, byte metadata = 0)
|
||||
: this((short)type, metadata) { }
|
||||
|
||||
/// <summary>
|
||||
/// String representation of the block
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue