Created
July 6, 2016 19:57
-
-
Save Brian1KB/9629d20dfbbfb3423dc765b019865302 to your computer and use it in GitHub Desktop.
Falling Block Entity
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using MiNET.Entities; | |
using MiNET.Utils; | |
using MiNET.Worlds; | |
namespace LEETGames.Utils | |
{ | |
public class FallingBlock : Mob | |
{ | |
public int BlockId { get; set; } | |
public FallingBlock(Level level, int blockId = 22) : base(EntityType.FallingBlock, level) | |
{ | |
BlockId = blockId; | |
} | |
public override MetadataDictionary GetMetadata() | |
{ | |
var metadata = base.GetMetadata(); | |
metadata[20] = new MetadataInt(BlockId); | |
return metadata; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment