Skip to content

Commit

Permalink
update last events
Browse files Browse the repository at this point in the history
  • Loading branch information
psu-de committed Jul 27, 2024
1 parent cfd78ca commit 9947b89
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 56 deletions.
19 changes: 0 additions & 19 deletions Components/MineSharp.Protocol/Events.cs

This file was deleted.

3 changes: 2 additions & 1 deletion Components/MineSharp.World/Chunks/IChunk.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using MineSharp.Core.Common.Biomes;
using MineSharp.Core.Common.Blocks;
using MineSharp.Core.Events;
using MineSharp.Core.Geometry;

namespace MineSharp.World.Chunks;
Expand All @@ -23,7 +24,7 @@ public interface IChunk
/// <summary>
/// Fired whenever a block in the chunk was updated
/// </summary>
public event Events.ChunkBlockEvent OnBlockUpdated;
public AsyncEvent<IChunk, int, Position> OnBlockUpdated { get; set; }

/// <summary>
/// Loads the chunk data from raw bytes.
Expand Down
5 changes: 3 additions & 2 deletions Components/MineSharp.World/V1_18/Chunk_1_18.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using MineSharp.Core.Common;
using MineSharp.Core.Common.Biomes;
using MineSharp.Core.Common.Blocks;
using MineSharp.Core.Events;
using MineSharp.Core.Geometry;
using MineSharp.Data;
using MineSharp.World.Chunks;
Expand Down Expand Up @@ -42,7 +43,7 @@ public Chunk118(MinecraftData data, ChunkCoordinates coordinates, BlockEntity[]
public ChunkCoordinates Coordinates { get; }

/// <inheritdoc />
public event Events.ChunkBlockEvent? OnBlockUpdated;
public AsyncEvent<IChunk, int, Position> OnBlockUpdated { get; set; } = new();

/// <inheritdoc />
public void LoadData(byte[] buf)
Expand Down Expand Up @@ -76,7 +77,7 @@ public void SetBlockAt(int state, Position position)
(var y, var section) = GetChunkSectionAndNewYFromPosition(position);
section.SetBlockAt(state, new(position.X, y, position.Z));

OnBlockUpdated?.Invoke(this, state, position);
OnBlockUpdated.Dispatch(this, state, position);
}

/// <inheritdoc />
Expand Down
34 changes: 0 additions & 34 deletions MineSharp.Bot/Events.cs

This file was deleted.

0 comments on commit 9947b89

Please sign in to comment.