Remove unused chat-event

This commit is contained in:
Lukas Rieger (Blue) 2024-06-03 22:48:03 +02:00
parent fbac48cd86
commit 6392b67744
No known key found for this signature in database
GPG Key ID: AA33883B1BBA03E6
4 changed files with 0 additions and 29 deletions

View File

@ -24,8 +24,6 @@
*/
package de.bluecolored.bluemap.common.serverinterface;
import de.bluecolored.bluemap.common.plugin.text.Text;
import java.util.UUID;
public interface ServerEventListener {
@ -34,6 +32,4 @@ public interface ServerEventListener {
default void onPlayerLeave(UUID playerUuid) {};
default void onChatMessage(Text message) {};
}

View File

@ -24,10 +24,7 @@
*/
package de.bluecolored.bluemap.bukkit;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.common.serverinterface.ServerEventListener;
import io.papermc.paper.event.player.AsyncChatEvent;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@ -63,10 +60,4 @@ public synchronized void onPlayerLeave(PlayerQuitEvent evt) {
for (ServerEventListener listener : listeners) listener.onPlayerJoin(evt.getPlayer().getUniqueId());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public synchronized void onPlayerChat(AsyncChatEvent evt) {
String message = PlainTextComponentSerializer.plainText().serialize(evt.message());
for (ServerEventListener listener : listeners) listener.onChatMessage(Text.of(message));
}
}

View File

@ -25,11 +25,9 @@
package de.bluecolored.bluemap.bukkit;
import de.bluecolored.bluemap.common.serverinterface.ServerEventListener;
import de.bluecolored.bluemap.common.plugin.text.Text;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.event.player.PlayerJoinEvent;
import org.bukkit.event.player.PlayerQuitEvent;
@ -62,10 +60,4 @@ public synchronized void onPlayerLeave(PlayerQuitEvent evt) {
for (ServerEventListener listener : listeners) listener.onPlayerJoin(evt.getPlayer().getUniqueId());
}
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
public synchronized void onPlayerChat(AsyncPlayerChatEvent evt) {
String message = String.format(evt.getFormat(), evt.getPlayer().getDisplayName(), evt.getMessage());
for (ServerEventListener listener : listeners) listener.onChatMessage(Text.of(message));
}
}

View File

@ -24,12 +24,9 @@
*/
package de.bluecolored.bluemap.sponge;
import de.bluecolored.bluemap.common.plugin.text.Text;
import de.bluecolored.bluemap.common.serverinterface.ServerEventListener;
import net.kyori.adventure.text.serializer.plain.PlainTextComponentSerializer;
import org.spongepowered.api.event.Listener;
import org.spongepowered.api.event.Order;
import org.spongepowered.api.event.message.PlayerChatEvent;
import org.spongepowered.api.event.network.ServerSideConnectionEvent;
public class EventForwarder {
@ -50,9 +47,4 @@ public void onPlayerLeave(ServerSideConnectionEvent.Disconnect evt) {
listener.onPlayerJoin(evt.player().uniqueId());
}
@Listener(order = Order.POST)
public void onPlayerChat(PlayerChatEvent evt) {
listener.onChatMessage(Text.of(PlainTextComponentSerializer.plainText().serialize(evt.message())));
}
}