Option to send coordinate after death (#3207)

This commit is contained in:
kakd 2020-05-27 03:58:54 -05:00 committed by GitHub
parent db410fb3e7
commit b9f8fc2e11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 16 additions and 0 deletions

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials;
import net.ess3.api.IEssentials;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.entity.*;
import org.bukkit.event.EventHandler;
@ -145,6 +146,10 @@ public class EssentialsEntityListener implements Listener {
return;
}
final User user = ess.getUser(event.getEntity());
if (ess.getSettings().infoAfterDeath()) {
final Location loc = user.getLocation();
user.sendMessage(tl("infoAfterDeath", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
}
if (user.isAuthorized("essentials.back.ondeath") && !ess.getSettings().isCommandDisabled("back")) {
user.setLastLocation();
user.sendMessage(tl("backAfterDeath"));

View File

@ -358,4 +358,6 @@ public interface ISettings extends IConf {
boolean isSpawnIfNoHome();
boolean infoAfterDeath();
}

View File

@ -1684,4 +1684,9 @@ public class Settings implements net.ess3.api.ISettings {
public boolean isSpawnIfNoHome() {
return config.getBoolean("spawn-if-no-home", true);
}
@Override
public boolean infoAfterDeath() {
return config.getBoolean("send-info-after-death", false);
}
}

View File

@ -459,6 +459,9 @@ broadcast-afk-message: true
# You can disable the death messages of Minecraft here.
death-messages: true
# When players die, should they receive the coordinates they died at?
send-info-after-death: false
# Should players with permissions be able to join and part silently?
# You can control this with essentials.silentjoin and essentials.silentquit permissions if it is enabled.
# In addition, people with essentials.silentjoin.vanish will be vanished on join.

View File

@ -189,6 +189,7 @@ ignoredList=\u00a76Ignored\:\u00a7r {0}
ignoreExempt=\u00a74You may not ignore that player.
ignorePlayer=\u00a76You ignore player\u00a7c {0} \u00a76from now on.
illegalDate=Illegal date format.
infoAfterDeath=\u00a76You died in \u00a7e{0} \u00a76at \u00a7e{1}, {2}, {3}\u00a76.
infoChapter=\u00a76Select chapter\:
infoChapterPages=\u00a7e ---- \u00a76{0} \u00a7e--\u00a76 Page \u00a7c{1}\u00a76 of \u00a7c{2} \u00a7e----
infoPages=\u00a7e ---- \u00a76{2} \u00a7e--\u00a76 Page \u00a7c{0}\u00a76/\u00a7c{1} \u00a7e----