Skip to content

Commit 9947b89

Browse files
committed
update last events
1 parent cfd78ca commit 9947b89

File tree

4 files changed

+5
-56
lines changed

4 files changed

+5
-56
lines changed

Components/MineSharp.Protocol/Events.cs

Lines changed: 0 additions & 19 deletions
This file was deleted.

Components/MineSharp.World/Chunks/IChunk.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using MineSharp.Core.Common.Biomes;
22
using MineSharp.Core.Common.Blocks;
3+
using MineSharp.Core.Events;
34
using MineSharp.Core.Geometry;
45

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

2829
/// <summary>
2930
/// Loads the chunk data from raw bytes.

Components/MineSharp.World/V1_18/Chunk_1_18.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using MineSharp.Core.Common;
22
using MineSharp.Core.Common.Biomes;
33
using MineSharp.Core.Common.Blocks;
4+
using MineSharp.Core.Events;
45
using MineSharp.Core.Geometry;
56
using MineSharp.Data;
67
using MineSharp.World.Chunks;
@@ -42,7 +43,7 @@ public Chunk118(MinecraftData data, ChunkCoordinates coordinates, BlockEntity[]
4243
public ChunkCoordinates Coordinates { get; }
4344

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

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

79-
OnBlockUpdated?.Invoke(this, state, position);
80+
OnBlockUpdated.Dispatch(this, state, position);
8081
}
8182

8283
/// <inheritdoc />

MineSharp.Bot/Events.cs

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)