Changed grace period time from 200 to 400 (5s to 10s). Added function to ProtectedPlayers.java to remove a player from the list, updated the updateGracePeriods method. Updated C2SKeyPress.java. Made OnKeyPressEventHandler.java check for mouse clicks as well, also made sure it only fires on client-side. Added an event for when a player leaves the server to remove them from the list.
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
package com.micle.loginprotection.events;
|
||||
|
||||
import com.micle.loginprotection.LoginProtection;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.event.entity.player.PlayerEvent;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
|
||||
public class OnPlayerLeaveEventHandler {
|
||||
@SubscribeEvent
|
||||
@OnlyIn(Dist.DEDICATED_SERVER)
|
||||
public void PlayerLeaveEvent(PlayerEvent.PlayerLoggedOutEvent event) {
|
||||
if (!(event.getEntity() instanceof PlayerEntity)) { return; }
|
||||
PlayerEntity player = event.getPlayer();
|
||||
|
||||
LoginProtection.protected_players.removePlayer(player.getUUID());
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user