[FEAT] MessageBroadcastEvent

This commit is contained in:
2023-07-20 19:37:33 +02:00
parent 3fcd6edb2a
commit 235217c0c4
2 changed files with 45 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
package com.hypherionmc.craterlib.api.event.server;
import com.hypherionmc.craterlib.core.event.CraterEvent;
import net.minecraft.network.chat.Component;
import net.minecraft.server.level.ServerPlayer;
import java.util.function.Function;
public class MessageBroadcastEvent extends CraterEvent {
private final Component component;
private final Function<ServerPlayer, Component> function;
private final boolean bl;
public MessageBroadcastEvent(Component component, Function<ServerPlayer, Component> function, boolean bl) {
this.component = component;
this.function = function;
this.bl = bl;
}
public Component getComponent() {
return component;
}
public boolean isBl() {
return bl;
}
public Function<ServerPlayer, Component> getFunction() {
return function;
}
@Override
public boolean canCancel() {
return false;
}
}