Disable ticking player if not authenticated

This commit is contained in:
samo_lego 2020-10-16 22:41:37 +02:00
parent c4ea00194a
commit 561e3784c9
1 changed files with 2 additions and 1 deletions

View File

@ -194,7 +194,7 @@ public abstract class MixinPlayerEntity implements PlayerAuth {
return playerCacheMap.containsKey(uuid) && playerCacheMap.get(uuid).isAuthenticated; return playerCacheMap.containsKey(uuid) && playerCacheMap.get(uuid).isAuthenticated;
} }
@Inject(method = "tick()V", at = @At("HEAD")) @Inject(method = "tick()V", at = @At("HEAD"), cancellable = true)
private void tick(CallbackInfo ci) { private void tick(CallbackInfo ci) {
if(!this.isAuthenticated()) { if(!this.isAuthenticated()) {
// Checking player timer // Checking player timer
@ -207,6 +207,7 @@ public abstract class MixinPlayerEntity implements PlayerAuth {
player.sendMessage(this.getAuthMessage(), false); player.sendMessage(this.getAuthMessage(), false);
kickTimer--; kickTimer--;
} }
ci.cancel();
} }
} }