Implemented config features into the ProtectedPlayer and ProtectedPlayers classes.
This commit is contained in:
@ -1,5 +1,7 @@
|
||||
package com.micle.loginprotection.data;
|
||||
|
||||
import com.micle.loginprotection.setup.Config;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
public class ProtectedPlayer {
|
||||
@ -9,7 +11,7 @@ public class ProtectedPlayer {
|
||||
|
||||
public ProtectedPlayer(UUID player_uuid) {
|
||||
this.player_uuid = player_uuid;
|
||||
this.grace_period = 400;
|
||||
this.grace_period = (Config.POST_GRACE_DURATION.get() * 40);
|
||||
this.is_loading = true;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.micle.loginprotection.data;
|
||||
|
||||
import com.micle.loginprotection.setup.Config;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraftforge.fml.server.ServerLifecycleHooks;
|
||||
@ -38,7 +39,7 @@ public class ProtectedPlayers {
|
||||
protected_players.remove(protected_player);
|
||||
|
||||
ServerPlayerEntity player = ServerLifecycleHooks.getCurrentServer().getPlayerList().getPlayer(player_uuid);
|
||||
if (player == null) { return; }
|
||||
if (player == null || !Config.POST_GRACE_ENABLED.get()) { return; }
|
||||
player.sendMessage(new StringTextComponent("Grace Period over!"), player_uuid);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user