TerraFirmaCraft

TerraFirmaCraft

3M Downloads

Incompatible with FastQuit (Fabric)

XSalsa20 opened this issue ยท 4 comments

commented

java.lang.NullPointerException: Cannot invoke "net.minecraft.server.MinecraftServer.m_129900_()" because "server" is null
at net.dries007.tfc.util.calendar.ServerCalendar.lambda$setDoDaylightCycleWithNoCallback$2(ServerCalendar.java:268) ~[TerraFirmaCraft-Forge-1.20.1-3.2.12.jar%23280!/:3.2.12] {re:classloading}
at net.dries007.tfc.util.ReentrantListener.runWithoutTriggeringCallbacks(ReentrantListener.java:35) ~[TerraFirmaCraft-Forge-1.20.1-3.2.12.jar%23280!/:3.2.12] {re:classloading}
at net.dries007.tfc.util.calendar.ServerCalendar.setDoDaylightCycleWithNoCallback(ServerCalendar.java:268) ~[TerraFirmaCraft-Forge-1.20.1-3.2.12.jar%23280!/:3.2.12] {re:classloading}
at net.dries007.tfc.util.calendar.ServerCalendar.onServerStart(ServerCalendar.java:155) ~[TerraFirmaCraft-Forge-1.20.1-3.2.12.jar%23280!/:3.2.12] {re:classloading}
at net.dries007.tfc.util.calendar.CalendarEventHandler.onServerStart(CalendarEventHandler.java:53) ~[TerraFirmaCraft-Forge-1.20.1-3.2.12.jar%23280!/:3.2.12] {re:classloading}
at net.minecraftforge.eventbus.EventBus.doCastFilter(EventBus.java:260) ~[eventbus-6.0.5.jar%23137!/:?] {}
at net.minecraftforge.eventbus.EventBus.lambda$addListener$11(EventBus.java:252) ~[eventbus-6.0.5.jar%23137!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:315) ~[eventbus-6.0.5.jar%23137!/:?] {}
at net.minecraftforge.eventbus.EventBus.post(EventBus.java:296) ~[eventbus-6.0.5.jar%23137!/:?] {}
at net.minecraftforge.server.ServerLifecycleHooks.handleServerStarting(ServerLifecycleHooks.java:110) ~[forge-1.20.1-47.3.22-universal.jar%23289!/:?] {re:classloading}
at net.minecraft.client.server.IntegratedServer.m_7038_(IntegratedServer.java:67) ~[client-1.20.1-20230612.114412-srg.jar%23284!/:?] {re:mixin,pl:connector_pre_launch:A,pl:runtimedistcleaner:A,re:classloading,pl:mixin:APP:modernfix-common.mixins.json:perf.thread_priorities.IntegratedServerMixin from mod modernfix,pl:mixin:A,pl:connector_pre_launch:A,pl:runtimedistcleaner:A}
at net.minecraft.server.MinecraftServer.m_130011_(MinecraftServer.java:634) ~[client-1.20.1-20230612.114412-srg.jar%23284!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:servercore.common.mixins.json:features.misc.MinecraftServerMixin from mod servercore,pl:mixin:APP:modernfix-common.mixins.json:core.MinecraftServerMixin from mod modernfix,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin from mod modernfix,pl:mixin:APP:tweed4_base.mixin.json:MinecraftServerAccessor from mod tweed4_base,pl:mixin:APP:tweed4_base.mixin.json:MixinMinecraftServer from mod tweed4_base,pl:mixin:APP:servercore.common.mixins.json:MinecraftServerMixin from mod servercore,pl:mixin:APP:fastquit.mixins.json:MinecraftServerAccessor from mod fastquit,pl:mixin:APP:fastquit.mixins.json:MinecraftServerMixin from mod fastquit,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:MinecraftServerMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin from mod kubejs,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin from mod kubejs,pl:mixin:APP:fabric-resource-loader-v0.mixins.json:MinecraftServerMixin from mod fabric_resource_loader_v0,pl:mixin:APP:fabric-message-api-v1.mixins.json:MinecraftServerMixin from mod fabric_message_api_v1,pl:mixin:APP:fabrication.mixins.json:general.config.MixinMinecraftServer from mod fabrication,pl:mixin:A,pl:connector_pre_launch:A}
at net.minecraft.server.MinecraftServer.m_206580
(MinecraftServer.java:251) ~[client-1.20.1-20230612.114412-srg.jar%23284!/:?] {re:mixin,pl:accesstransformer:B,pl:connector_pre_launch:A,re:classloading,pl:accesstransformer:B,pl:mixin:APP:servercore.common.mixins.json:features.misc.MinecraftServerMixin from mod servercore,pl:mixin:APP:modernfix-common.mixins.json:core.MinecraftServerMixin from mod modernfix,pl:mixin:APP:modernfix-common.mixins.json:perf.dedicated_reload_executor.MinecraftServerMixin from mod modernfix,pl:mixin:APP:tweed4_base.mixin.json:MinecraftServerAccessor from mod tweed4_base,pl:mixin:APP:tweed4_base.mixin.json:MixinMinecraftServer from mod tweed4_base,pl:mixin:APP:servercore.common.mixins.json:MinecraftServerMixin from mod servercore,pl:mixin:APP:fastquit.mixins.json:MinecraftServerAccessor from mod fastquit,pl:mixin:APP:fastquit.mixins.json:MinecraftServerMixin from mod fastquit,pl:mixin:APP:fabric-lifecycle-events-v1.mixins.json:MinecraftServerMixin from mod fabric_lifecycle_events_v1,pl:mixin:APP:kubejs-common.mixins.json:MinecraftServerMixin from mod kubejs,pl:mixin:APP:kubejs-common.mixins.json:inject_resources.MinecraftServerMixin from mod kubejs,pl:mixin:APP:fabric-resource-loader-v0.mixins.json:MinecraftServerMixin from mod fabric_resource_loader_v0,pl:mixin:APP:fabric-message-api-v1.mixins.json:MinecraftServerMixin from mod fabric_message_api_v1,pl:mixin:APP:fabrication.mixins.json:_general.config.MixinMinecraftServer from mod fabrication,pl:mixin:A,pl:connector_pre_launch:A}
at java.lang.Thread.run(Thread.java:840) ~[?:?] {re:mixin}

commented

Perhaps we need to add some null checks in ServerCalendar?
I don't seem to see any empty checks in this class.

problem code:

private void setDoDaylightCycleWithNoCallback(final boolean value)
{
    **final MinecraftServer server = getServer();**
    DO_DAYLIGHT_CYCLE.runWithoutTriggeringCallbacks(() -> server.getGameRules().getRule(GameRules.RULE_DAYLIGHT).set(value, server));
}
commented

What are the reproduction steps for this issue? Are there specific mod(s) that are required to reproduce this issue? Please attach a full latest.log file from the crash.

commented

What are the reproduction steps for this issue? Are there specific mod(s) that are required to reproduce this issue? Please attach a full latest.log file from the crash.

there is video in the zip that show how to reproduce this issue.

2025-1-19_16.28.45.zip

and to trigger this issue, at least the following mods need to be installed:

fastquit-3.0.0+1.20+
modernfix-forge-5.20.0+mc1.20.1
TerraFirmaCraft-Forge-1.20.1-3.2.12

commented

FastQuit is a Fabric mod and as a result we cannot support it in dev. While I'm unable to verify this, inspecting the code path it seems fairly plausible that by delaying server shutdown onto another thread, it is creating a race condition with Forge's patched ServerLifecycleHooks which are causing this invalid state. This is not possible for us to fix or support (again, due to it being a Fabric mod).