Added common configuration file with the following exposed values: graceEnabled, graceLength and keyRefillAir. This has not been tested in LAN.

This commit is contained in:
2021-09-28 15:38:47 +01:00
parent 3977a22337
commit ec5b203e5a
5 changed files with 56 additions and 5 deletions

View File

@ -1,5 +1,6 @@
package com.micle.loginprotection.data;
import com.micle.loginprotection.setup.Config;
import net.minecraft.network.chat.TextComponent;
import net.minecraft.server.level.ServerPlayer;
import net.minecraftforge.fmllegacy.server.ServerLifecycleHooks;
@ -38,7 +39,7 @@ public class ProtectedPlayers {
protected_players.remove(protected_player);
ServerPlayer player = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayer(player_uuid);
if (player == null) { return; }
if (player == null || !Config.GRACE_ENABLED.get()) { return; }
player.sendMessage(new TextComponent("Grace Period over!"), player_uuid);
}