Added death messages (#12)

This commit is contained in:
Norbi Peti 2016-12-01 21:05:52 +01:00
parent 630384f125
commit 696f359f50

View file

@ -3,9 +3,9 @@ package buttondevteam.discordplugin.listeners;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.entity.Player; import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler; import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.server.ServerCommandEvent; import org.bukkit.event.entity.PlayerDeathEvent;
import buttondevteam.discordplugin.DiscordPlayer; import buttondevteam.discordplugin.DiscordPlayer;
import buttondevteam.discordplugin.DiscordPlugin; import buttondevteam.discordplugin.DiscordPlugin;
import buttondevteam.discordplugin.commands.ConnectCommand; import buttondevteam.discordplugin.commands.ConnectCommand;
@ -48,4 +48,9 @@ public class MCListener implements Listener {
+ user.getStatus().getUrl()); + user.getStatus().getUrl());
} }
} }
@EventHandler(priority = EventPriority.LOW)
public void onPlayerDeath(PlayerDeathEvent e) {
DiscordPlugin.sendMessageToChannel(DiscordPlugin.chatchannel, e.getDeathMessage());
}
} }