Skip to content

Commit

Permalink
fix forge mod crashing on servers
Browse files Browse the repository at this point in the history
  • Loading branch information
fayer3 committed Dec 17, 2024
1 parent e735290 commit 25dde50
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
11 changes: 11 additions & 0 deletions forge/src/main/java/org/vivecraft/forge/ClientHelper.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package org.vivecraft.forge;

import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import org.vivecraft.client.gui.settings.VivecraftMainSettings;

public class ClientHelper {
public static void registerClientScreen(FMLJavaModLoadingContext context) {
context.registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new VivecraftMainSettings(screen)));
}
}
5 changes: 1 addition & 4 deletions forge/src/main/java/org/vivecraft/forge/Vivecraft.java
Original file line number Diff line number Diff line change
@@ -1,15 +1,12 @@
package org.vivecraft.forge;

import net.minecraft.network.FriendlyByteBuf;
import net.minecraftforge.client.ConfigScreenHandler;
import net.minecraftforge.common.ForgeMod;
import net.minecraftforge.event.network.CustomPayloadEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.loading.FMLEnvironment;
import net.minecraftforge.network.ChannelBuilder;
import net.minecraftforge.network.EventNetworkChannel;
import org.vivecraft.client.gui.settings.VivecraftMainSettings;
import org.vivecraft.client.network.ClientNetworking;
import org.vivecraft.common.network.CommonNetworkHelper;
import org.vivecraft.server.ServerNetworking;
Expand Down Expand Up @@ -40,7 +37,7 @@ public Vivecraft(FMLJavaModLoadingContext context) {
});

if (FMLEnvironment.dist.isClient()) {
context.registerExtensionPoint(ConfigScreenHandler.ConfigScreenFactory.class, () -> new ConfigScreenHandler.ConfigScreenFactory((mc, screen) -> new VivecraftMainSettings(screen)));
ClientHelper.registerClientScreen(context);
}
}

Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ minecraft_version=1.21.3
enabled_platforms=fabric,forge,neoforge

archives_base_name=vivecraft
mod_version=1.1.14-b3
mod_version=1.1.14-b4
maven_group=org.vivecraft

architectury_version=14.0.3
Expand Down

0 comments on commit 25dde50

Please sign in to comment.