Exemple #1
0
 /// <summary>
 /// Sets a block in the world.
 /// </summary>
 /// <param name="position">The position of the updated block.</param>
 /// <param name="value">The block to set.</param>
 /// <remarks>This will generate a new chunk for the requested block if one does not exist.
 /// This method also fires OnBlockChanged, which will cause block updates when used with
 /// LibMinecraft.Server.MultiplayerServer.</remarks>
 public virtual void SetBlock(Vector3 position, Block value)
 {
     Data[(int)position.Z + ((int)position.X * Height) + ((int)position.Y * Height * Depth)] = value.BlockID;
     if (OnBlockChanged != null)
         OnBlockChanged(this, new BlockSetEventArgs(value, position));
 }
Exemple #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BlockSetEventArgs"/> class.
 /// </summary>
 /// <param name="Block">The block.</param>
 /// <param name="Position">The position.</param>
 /// <remarks></remarks>
 public BlockSetEventArgs(Block Block, Vector3 Position)
 {
     this.Block = Block;
     this.Position = Position;
 }