Fix NPE in runCommand (#969)

This commit is contained in:
IzzelAliz 2023-05-15 09:54:46 +08:00
parent 02a708d994
commit 08b035dd93
No known key found for this signature in database
GPG Key ID: EE50E123A11D8338

View File

@ -48,7 +48,7 @@ public abstract class DedicatedServerMixin extends MinecraftServerMixin {
BukkitRegistry.lockRegistries();
}
@Inject(method = "initServer", at = @At(value = "INVOKE", shift = At.Shift.AFTER, target = "Lnet/minecraft/server/rcon/thread/RconThread;create(Lnet/minecraft/server/ServerInterface;)Lnet/minecraft/server/rcon/thread/RconThread;"))
@Inject(method = "initServer", at = @At(value = "FIELD", target = "Lnet/minecraft/server/dedicated/DedicatedServerProperties;enableRcon:Z"))
public void arclight$setRcon(CallbackInfoReturnable<Boolean> cir) {
this.remoteConsole = new CraftRemoteConsoleCommandSender(this.rconConsoleSource);
}