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;
}
@Inject(method = "tick()V", at = @At("HEAD"))
@Inject(method = "tick()V", at = @At("HEAD"), cancellable = true)
private void tick(CallbackInfo ci) {
if(!this.isAuthenticated()) {
// Checking player timer
@ -207,6 +207,7 @@ public abstract class MixinPlayerEntity implements PlayerAuth {
player.sendMessage(this.getAuthMessage(), false);
kickTimer--;
}
ci.cancel();
}
}