forgot a check

This commit is contained in:
ZeroEpoch1969 2019-12-13 22:02:16 -07:00
parent 6b3d170c6d
commit 4d1cdfedc7
No known key found for this signature in database
GPG Key ID: A7BAB4E14F089CF3

View File

@ -9,6 +9,7 @@ import java.util.HashMap;
import java.util.List;
import javax.security.auth.login.LoginException;
import me.totalfreedom.totalfreedommod.FreedomService;
import me.totalfreedom.totalfreedommod.GameRuleHandler;
import me.totalfreedom.totalfreedommod.TotalFreedomMod;
import me.totalfreedom.totalfreedommod.admin.Admin;
import me.totalfreedom.totalfreedommod.config.ConfigEntry;
@ -28,6 +29,7 @@ import net.dv8tion.jda.api.events.ReadyEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.pravian.aero.util.StringUtils;
import org.apache.commons.lang.WordUtils;
import org.bukkit.GameRule;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
@ -125,6 +127,17 @@ public class Discord extends FreedomService
@EventHandler(priority = EventPriority.MONITOR)
public void onPlayerDeath(PlayerDeathEvent event)
{
try
{
if (!event.getEntity().getWorld().getGameRuleValue(GameRule.SHOW_DEATH_MESSAGES))
{
return;
}
}
catch (NullPointerException e)
{
}
messageChatChannel("**" + event.getDeathMessage() + "**");
}