Updated the grace period messages sent to players. Added a new message to notify player when he is seen as active. Removed old console message when a player is no longer protected.
This commit is contained in:
@ -39,8 +39,10 @@ public class ProtectedPlayers {
|
||||
protected_players.remove(protected_player);
|
||||
|
||||
ServerPlayerEntity player = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayer(player_uuid);
|
||||
if (player == null || !Config.POST_GRACE_ENABLED.get()) { return; }
|
||||
player.sendMessage(new StringTextComponent("Grace Period over!"), player_uuid);
|
||||
if (player == null) { return; }
|
||||
|
||||
if (!Config.POST_GRACE_ENABLED.get()) { return; }
|
||||
player.sendMessage(new StringTextComponent("[LoginProtection] Grace period ended!"), player_uuid);
|
||||
}
|
||||
|
||||
public void updateGracePeriod(UUID player_uuid) {
|
||||
@ -51,7 +53,6 @@ public class ProtectedPlayers {
|
||||
protected_player.setGracePeriod(grace_period);
|
||||
if (grace_period <= 0) {
|
||||
removePlayer(player_uuid);
|
||||
System.out.println(protected_player.getPlayerUUID() + " is no longer being protected!");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -30,9 +30,10 @@ public class C2SKeyPress {
|
||||
|
||||
if (!Config.POST_GRACE_ENABLED.get()) {
|
||||
LoginProtection.protected_players.removePlayer(sender.getUUID());
|
||||
sender.sendMessage(new StringTextComponent("[LoginProtection] You are now seen as active."), sender.getUUID());
|
||||
} else {
|
||||
LoginProtection.protected_players.getPlayer(sender.getUUID()).setLoading(false);
|
||||
sender.sendMessage(new StringTextComponent("Grace Period started!"), sender.getUUID());
|
||||
sender.sendMessage(new StringTextComponent("[LoginProtection] Grace period started!"), sender.getUUID());
|
||||
}
|
||||
if (sender.isInWater()) {
|
||||
if (Config.POST_DROWN_ENABLED.get()) {
|
||||
|
||||
Reference in New Issue
Block a user