mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-30 22:24:06 +01:00
fabric-1.18: rename BlockEvents.EVENT -> BlockEvents.BLOCK_EVENT
This commit is contained in:
parent
ebdab5e706
commit
ef31e6daa8
@ -753,7 +753,7 @@ public class DynmapPlugin {
|
|||||||
ServerChunkEvents.CHUNK_LOAD.register((world, chunk) -> worldTracker.handleChunkLoad(world, chunk));
|
ServerChunkEvents.CHUNK_LOAD.register((world, chunk) -> worldTracker.handleChunkLoad(world, chunk));
|
||||||
ServerChunkEvents.CHUNK_UNLOAD.register((world, chunk) -> worldTracker.handleChunkUnload(world, chunk));
|
ServerChunkEvents.CHUNK_UNLOAD.register((world, chunk) -> worldTracker.handleChunkUnload(world, chunk));
|
||||||
ChunkDataEvents.SAVE.register((world, chunk) -> worldTracker.handleChunkDataSave(world, chunk));
|
ChunkDataEvents.SAVE.register((world, chunk) -> worldTracker.handleChunkDataSave(world, chunk));
|
||||||
BlockEvents.EVENT.register((world, pos) -> worldTracker.handleBlockEvent(world, pos));
|
BlockEvents.BLOCK_EVENT.register((world, pos) -> worldTracker.handleBlockEvent(world, pos));
|
||||||
}
|
}
|
||||||
// Prime the known full chunks
|
// Prime the known full chunks
|
||||||
if (onchunkgenerate && (server.getWorlds() != null)) {
|
if (onchunkgenerate && (server.getWorlds() != null)) {
|
||||||
|
@ -9,7 +9,7 @@ public class BlockEvents {
|
|||||||
private BlockEvents() {
|
private BlockEvents() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static Event<BlockCallback> EVENT = EventFactory.createArrayBacked(BlockCallback.class,
|
public static Event<BlockCallback> BLOCK_EVENT = EventFactory.createArrayBacked(BlockCallback.class,
|
||||||
(listeners) -> (world, pos) -> {
|
(listeners) -> (world, pos) -> {
|
||||||
for (BlockCallback callback : listeners) {
|
for (BlockCallback callback : listeners) {
|
||||||
callback.onBlockEvent(world, pos);
|
callback.onBlockEvent(world, pos);
|
||||||
@ -17,6 +17,7 @@ public class BlockEvents {
|
|||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@FunctionalInterface
|
||||||
public interface BlockCallback {
|
public interface BlockCallback {
|
||||||
void onBlockEvent(World world, BlockPos pos);
|
void onBlockEvent(World world, BlockPos pos);
|
||||||
}
|
}
|
||||||
|
@ -19,7 +19,7 @@ public abstract class WorldChunkMixin {
|
|||||||
@Inject(method = "setBlockState", at = @At("RETURN"))
|
@Inject(method = "setBlockState", at = @At("RETURN"))
|
||||||
public void setBlockState(BlockPos pos, BlockState state, boolean moved, CallbackInfoReturnable<BlockState> info) {
|
public void setBlockState(BlockPos pos, BlockState state, boolean moved, CallbackInfoReturnable<BlockState> info) {
|
||||||
if (info.getReturnValue() != null) {
|
if (info.getReturnValue() != null) {
|
||||||
BlockEvents.EVENT.invoker().onBlockEvent(this.getWorld(), pos);
|
BlockEvents.BLOCK_EVENT.invoker().onBlockEvent(this.getWorld(), pos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user