mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-11-27 20:58:40 +01:00
fabric-1.18: add BlockEvents.SIGN_CHANGE_EVENT
This commit is contained in:
parent
ef31e6daa8
commit
f03a484b37
@ -2,6 +2,9 @@ package org.dynmap.fabric_1_18.event;
|
||||
|
||||
import net.fabricmc.fabric.api.event.Event;
|
||||
import net.fabricmc.fabric.api.event.EventFactory;
|
||||
import net.minecraft.block.Material;
|
||||
import net.minecraft.server.network.ServerPlayerEntity;
|
||||
import net.minecraft.server.world.ServerWorld;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -17,8 +20,21 @@ public class BlockEvents {
|
||||
}
|
||||
);
|
||||
|
||||
public static Event<SignChangeCallback> SIGN_CHANGE_EVENT = EventFactory.createArrayBacked(SignChangeCallback.class,
|
||||
(listeners) -> (world, pos, lines, material, player) -> {
|
||||
for (SignChangeCallback callback : listeners) {
|
||||
callback.onSignChange(world, pos, lines, material, player);
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
@FunctionalInterface
|
||||
public interface BlockCallback {
|
||||
void onBlockEvent(World world, BlockPos pos);
|
||||
}
|
||||
|
||||
@FunctionalInterface
|
||||
public interface SignChangeCallback {
|
||||
void onSignChange(ServerWorld world, BlockPos pos, String[] lines, Material material, ServerPlayerEntity player);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user