try to fix crash on server load
This commit is contained in:
+2
-2
@@ -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")
|
||||
|
||||
+2
-2
@@ -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
|
||||
@@ -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.
|
||||
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.
|
||||
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;
|
||||
|
||||
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);
|
||||
@@ -36,4 +39,4 @@ public class AscendMindMotion {
|
||||
private void commonSetup(final FMLCommonSetupEvent event) {
|
||||
ModMessages.register();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user