Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f82dd6c311 |
@@ -3,7 +3,7 @@ package com.prometheus.spigot;
|
|||||||
import com.prometheus.spigot.http.MetricsHttpHandler;
|
import com.prometheus.spigot.http.MetricsHttpHandler;
|
||||||
import com.prometheus.spigot.listeners.BlockBreakListener;
|
import com.prometheus.spigot.listeners.BlockBreakListener;
|
||||||
import com.prometheus.spigot.listeners.BlockPlaceListener;
|
import com.prometheus.spigot.listeners.BlockPlaceListener;
|
||||||
import com.prometheus.spigot.listeners.ChatMessageListener;
|
import com.prometheus.spigot.listeners.ChatListener;
|
||||||
import com.prometheus.spigot.listeners.ChunkListener;
|
import com.prometheus.spigot.listeners.ChunkListener;
|
||||||
import com.prometheus.spigot.listeners.CommandListener;
|
import com.prometheus.spigot.listeners.CommandListener;
|
||||||
import com.prometheus.spigot.listeners.ConnectionListener;
|
import com.prometheus.spigot.listeners.ConnectionListener;
|
||||||
@@ -76,7 +76,7 @@ public final class PrometheusSpigotPlugin extends JavaPlugin {
|
|||||||
pluginManager.registerEvents(new BlockBreakListener(metricsRegistry), this);
|
pluginManager.registerEvents(new BlockBreakListener(metricsRegistry), this);
|
||||||
pluginManager.registerEvents(new BlockPlaceListener(metricsRegistry), this);
|
pluginManager.registerEvents(new BlockPlaceListener(metricsRegistry), this);
|
||||||
pluginManager.registerEvents(new DeathListener(metricsRegistry), this);
|
pluginManager.registerEvents(new DeathListener(metricsRegistry), this);
|
||||||
pluginManager.registerEvents(new ChatMessageListener(metricsRegistry), this);
|
pluginManager.registerEvents(new ChatListener(metricsRegistry), this);
|
||||||
pluginManager.registerEvents(new MoveListener(metricsRegistry, countBlockMovementOnly), this);
|
pluginManager.registerEvents(new MoveListener(metricsRegistry, countBlockMovementOnly), this);
|
||||||
pluginManager.registerEvents(new ConnectionListener(metricsRegistry), this);
|
pluginManager.registerEvents(new ConnectionListener(metricsRegistry), this);
|
||||||
pluginManager.registerEvents(new CommandListener(metricsRegistry), this);
|
pluginManager.registerEvents(new CommandListener(metricsRegistry), this);
|
||||||
|
|||||||
+4
-4
@@ -1,20 +1,20 @@
|
|||||||
package com.prometheus.spigot.listeners;
|
package com.prometheus.spigot.listeners;
|
||||||
|
|
||||||
import com.prometheus.spigot.metrics.MetricsRegistry;
|
import com.prometheus.spigot.metrics.MetricsRegistry;
|
||||||
import io.papermc.paper.event.player.AsyncChatEvent;
|
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.EventPriority;
|
import org.bukkit.event.EventPriority;
|
||||||
import org.bukkit.event.Listener;
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.AsyncPlayerChatEvent;
|
||||||
|
|
||||||
public final class ChatMessageListener implements Listener {
|
public final class ChatListener implements Listener {
|
||||||
private final MetricsRegistry registry;
|
private final MetricsRegistry registry;
|
||||||
|
|
||||||
public ChatMessageListener(MetricsRegistry registry) {
|
public ChatListener(MetricsRegistry registry) {
|
||||||
this.registry = registry;
|
this.registry = registry;
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||||
public void onChat(AsyncChatEvent event) {
|
public void onChat(AsyncPlayerChatEvent event) {
|
||||||
registry.incrementChatMessages();
|
registry.incrementChatMessages();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user