Localized LoginLocationFix
This commit is contained in:
parent
e69ba501da
commit
eed5ce1b7b
@ -2,6 +2,8 @@ package fr.xephi.authme.listener;
|
||||
|
||||
import fr.xephi.authme.AuthMe;
|
||||
import fr.xephi.authme.api.v3.AuthMeApi;
|
||||
import fr.xephi.authme.message.MessageKey;
|
||||
import fr.xephi.authme.message.Messages;
|
||||
import fr.xephi.authme.settings.properties.SecuritySettings;
|
||||
import fr.xephi.authme.util.TeleportUtils;
|
||||
import org.bukkit.Location;
|
||||
@ -20,6 +22,8 @@ import javax.inject.Inject;
|
||||
public class LoginLocationFixListener implements Listener {
|
||||
@Inject
|
||||
private AuthMe plugin;
|
||||
@Inject
|
||||
private Messages messages;
|
||||
private final AuthMeApi authmeApi = AuthMeApi.getInstance();
|
||||
|
||||
public LoginLocationFixListener() {
|
||||
@ -65,7 +69,7 @@ public class LoginLocationFixListener implements Listener {
|
||||
JoinBlock.getRelative(BlockFace.UP).breakNaturally();
|
||||
JoinBlock.breakNaturally();
|
||||
}
|
||||
player.sendMessage("§a你在登录时卡在了地狱门, 现已修正");
|
||||
messages.send(player, MessageKey.LOCATION_FIX_PORTAL);
|
||||
} else if (isFixGroundStuck) {
|
||||
Material UpType = JoinLocation.getBlock().getRelative(BlockFace.UP).getType();
|
||||
World world = player.getWorld();
|
||||
@ -88,7 +92,7 @@ public class LoginLocationFixListener implements Listener {
|
||||
} else {
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 0.1, 0.5));
|
||||
}
|
||||
player.sendMessage("§a你被埋住了, 坐标已修正, 下次下线之前请小心!");
|
||||
messages.send(player, MessageKey.LOCATION_FIX_UNDERGROUND);
|
||||
break;
|
||||
}
|
||||
if (i == MaxHeight) {
|
||||
@ -97,7 +101,7 @@ public class LoginLocationFixListener implements Listener {
|
||||
} else {
|
||||
player.teleport(JoinBlock.getLocation().add(0.5, 1.1, 0.5));
|
||||
}
|
||||
player.sendMessage("§a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~");
|
||||
messages.send(player, MessageKey.LOCATION_FIX_UNDERGROUND_CANT_FIX);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,22 @@ package fr.xephi.authme.message;
|
||||
* Keys for translatable messages managed by {@link Messages}.
|
||||
*/
|
||||
public enum MessageKey {
|
||||
|
||||
/**
|
||||
* You are stuck in portal during Login.
|
||||
*/
|
||||
LOCATION_FIX_PORTAL("login_location_fix.fix_portal"),
|
||||
|
||||
/**
|
||||
* You are stuck underground during Login.
|
||||
*/
|
||||
LOCATION_FIX_UNDERGROUND("login_location_fix.fix_underground"),
|
||||
|
||||
/**
|
||||
* You are stuck underground during Login, but we cant fix it.
|
||||
*/
|
||||
LOCATION_FIX_UNDERGROUND_CANT_FIX("login_location_fix.cannot_fix_underground"),
|
||||
|
||||
/**
|
||||
* Bedrock auto login success!
|
||||
*/
|
||||
|
||||
@ -151,6 +151,7 @@ public class MessageUpdater {
|
||||
.put("two_factor", "Two-factor authentication")
|
||||
.put("gui_captcha", "3rd party features: GUI Captcha")
|
||||
.put("bedrock_auto_login", "3rd party features: Bedrock Auto Login")
|
||||
.put("login_location_fix", "3rd party features: Login Location Fix")
|
||||
.build();
|
||||
|
||||
Set<String> addedKeys = new HashSet<>();
|
||||
|
||||
@ -170,3 +170,9 @@ gui_captcha:
|
||||
# 3rd party features: Bedrock Auto Login
|
||||
bedrock_auto_login:
|
||||
success: '&aBedrock auto login success!'
|
||||
|
||||
# 3rd party features: Login Location Fix
|
||||
login_location_fix:
|
||||
fix_portal: '&aYou are stuck in portal during Login.'
|
||||
fix_underground: '&aYou are stuck underground during Login.'
|
||||
cannot_fix_underground: '&aYou are stuck underground during Login, but we cant fix it.'
|
||||
|
||||
@ -179,3 +179,9 @@ gui_captcha:
|
||||
# 3rd party features: Bedrock Auto Login
|
||||
bedrock_auto_login:
|
||||
success: "&a基岩版自动登录完成"
|
||||
|
||||
# 3rd party features: Login Location Fix
|
||||
login_location_fix:
|
||||
fix_portal: '&a你在登录时卡在了地狱门, 现已修正'
|
||||
fix_underground: '&a你被埋住了, 坐标已修正, 下次下线之前请小心!'
|
||||
cannot_fix_underground: '&a你被埋住了, 坐标无法修正, 只好送你去了最高点, 自求多福吧少年~'
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user