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 {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly fg.deobf("net.fretux.ascend:Ascend:2.1.1")
runtimeOnly 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.2.1")
// Iron's Spellbooks
compileOnly fg.deobf("io.redspace.ironsspellbooks:irons_spellbooks:${irons_spells_version}:api")
+1 -1
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.
mod_license=All Rights Reserved
# 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.
# This should match the base package used for the mod sources.
# See https://maven.apache.org/guides/mini/guide-naming-conventions.html
@@ -1,13 +1,14 @@
package net.fretux.mindmotion;
import com.mojang.logging.LogUtils;
import net.fretux.mindmotion.client.Keybinds;
import net.fretux.mindmotion.command.SanityCommand;
import net.fretux.mindmotion.event.CombatEvents;
import net.fretux.mindmotion.event.PlayerTickHandler;
import net.fretux.mindmotion.network.ModMessages;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.eventbus.api.IEventBus;
import net.minecraftforge.fml.DistExecutor;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.config.ModConfig;
@@ -23,7 +24,9 @@ public class AscendMindMotion {
public AscendMindMotion() {
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
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(PlayerTickHandler.class);
MinecraftForge.EVENT_BUS.register(CombatEvents.class);
@@ -1,7 +1,7 @@
package net.fretux.mindmotion.network;
import net.fretux.mindmotion.client.shader.VentShaderHandler;
import net.minecraft.client.Minecraft;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.fml.DistExecutor;
import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.network.NetworkEvent;
@@ -16,10 +16,10 @@ public class VentClientEffectPacket {
public void handle(Supplier<NetworkEvent.Context> ctx) {
ctx.get().enqueueWork(() -> {
Minecraft mc = Minecraft.getInstance();
if (mc.player == null) return;
mc.player.swingTime = 10;
VentShaderHandler.triggerVentShockwave();
DistExecutor.unsafeRunWhenOn(Dist.CLIENT, () -> () ->
net.fretux.mindmotion.client.ClientPacketHandlers.handleVentEffect()
);
});
ctx.get().setPacketHandled(true);
}
}