Disable ticking player if not authenticated
This commit is contained in:
parent
c4ea00194a
commit
561e3784c9
|
@ -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();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue