try to fix crash on server load

This commit is contained in:
2026-03-28 17:59:23 +01:00
parent eb76cc806c
commit 0de012634c
4 changed files with 16 additions and 13 deletions
+2 -2
View File
@@ -88,8 +88,8 @@ repositories {
dependencies { dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}" minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly fg.deobf("net.fretux.ascend:Ascend:2.1.1") compileOnly fg.deobf("net.fretux.ascend:Ascend:2.2.1")
runtimeOnly fg.deobf("net.fretux.ascend:Ascend:2.1.1") runtimeOnly fg.deobf("net.fretux.ascend:Ascend:2.2.1")
// Iron's Spellbooks // Iron's Spellbooks
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api") compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
+2 -2
View File
@@ -52,7 +52,7 @@ mod_name=Mind & Motion
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default. # The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=All Rights Reserved mod_license=All Rights Reserved
# The mod version. See https://semver.org/ # The mod version. See https://semver.org/
mod_version=1.3.0 mod_version=1.3.1
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository. # The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources. # This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html # See https://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -60,4 +60,4 @@ mod_group_id=net.fretux.mindmotion
# The authors of the mod. This is a simple text string that is used for display purposes in the mod list. # The authors of the mod. This is a simple text string that is used for display purposes in the mod list.
mod_authors=Fretux mod_authors=Fretux
# The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list. # The description of the mod. This is a simple multiline text string that is used for display purposes in the mod list.
mod_description=A mod adding sanity, insanity and adrenaline to minecraft. mod_description=A mod adding sanity, insanity and adrenaline to minecraft.
@@ -1,13 +1,14 @@
package net.fretux.mindmotion; package net.fretux.mindmotion;
import com.mojang.logging.LogUtils; import com.mojang.logging.LogUtils;
import net.fretux.mindmotion.client.Keybinds;
import net.fretux.mindmotion.command.SanityCommand; import net.fretux.mindmotion.command.SanityCommand;
import net.fretux.mindmotion.event.CombatEvents; import net.fretux.mindmotion.event.CombatEvents;
import net.fretux.mindmotion.event.PlayerTickHandler; import net.fretux.mindmotion.event.PlayerTickHandler;
import net.fretux.mindmotion.network.ModMessages; import net.fretux.mindmotion.network.ModMessages;
import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext; import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod; import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig; import net.minecraftforge.fml.config.ModConfig;
@@ -23,7 +24,9 @@ public class AscendMindMotion {
public AscendMindMotion() { public AscendMindMotion() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus(); IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
modEventBus.addListener(this::commonSetup); modEventBus.addListener(this::commonSetup);
modEventBus.addListener(Keybinds::register); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () ->
net.fretux.mindmotion.client.ClientBootstrap.init(modEventBus)
);
MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(this);
MinecraftForge.EVENT_BUS.register(PlayerTickHandler.class); MinecraftForge.EVENT_BUS.register(PlayerTickHandler.class);
MinecraftForge.EVENT_BUS.register(CombatEvents.class); MinecraftForge.EVENT_BUS.register(CombatEvents.class);
@@ -36,4 +39,4 @@ public class AscendMindMotion {
private void commonSetup(final FMLCommonSetupEvent event) { private void commonSetup(final FMLCommonSetupEvent event) {
ModMessages.register(); ModMessages.register();
} }
} }
@@ -1,7 +1,7 @@
package net.fretux.mindmotion.network; package net.fretux.mindmotion.network;
import net.fretux.mindmotion.client.shader.VentShaderHandler; import net.minecraftforge.api.distmarker.Dist;
import net.minecraft.client.Minecraft; import net.minecraftforge.fml.DistExecutor;
import net.minecraft.network.FriendlyByteBuf; import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent; import net.minecraftforge.network.NetworkEvent;
@@ -16,10 +16,10 @@ public class VentClientEffectPacket {
public void handle(Supplier<NetworkEvent.Context> ctx) { public void handle(Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> { ctx.get().enqueueWork(() -> {
Minecraft mc = Minecraft.getInstance(); DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () ->
if (mc.player == null) return; net.fretux.mindmotion.client.ClientPacketHandlers.handleVentEffect()
mc.player.swingTime = 10; );
VentShaderHandler.triggerVentShockwave();
}); });
ctx.get().setPacketHandled(true);
} }
} }