-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
NeoForge: Fix loading on dedicated if cloth-config is present (#706)
* NeoForge: Fix loading on dedicated if cloth config is present * Hopefully fix neoforge issue template
- Loading branch information
Showing
4 changed files
with
33 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31 changes: 31 additions & 0 deletions
31
neoforge/src/main/java/fr/rakambda/fallingtree/neoforge/FallingTreeClient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package fr.rakambda.fallingtree.neoforge; | ||
|
||
import fr.rakambda.fallingtree.common.FallingTreeCommon; | ||
import fr.rakambda.fallingtree.neoforge.client.cloth.ClothConfigHook; | ||
import lombok.extern.log4j.Log4j2; | ||
import net.neoforged.api.distmarker.Dist; | ||
import net.neoforged.bus.api.IEventBus; | ||
import net.neoforged.fml.ModContainer; | ||
import net.neoforged.fml.ModList; | ||
import net.neoforged.fml.common.Mod; | ||
import org.jetbrains.annotations.NotNull; | ||
import java.lang.reflect.InvocationTargetException; | ||
|
||
@Log4j2 | ||
@Mod(value = FallingTree.MOD_ID, dist = Dist.CLIENT) | ||
public class FallingTreeClient { | ||
public FallingTreeClient(@NotNull IEventBus modEventBus, @NotNull ModContainer modContainer){ | ||
if(ModList.get().isLoaded("cloth_config")){ | ||
try{ | ||
Class.forName("fr.rakambda.fallingtree.neoforge.client.cloth.ClothConfigHook") | ||
.asSubclass(ClothConfigHook.class) | ||
.getConstructor(FallingTreeCommon.class) | ||
.newInstance(FallingTree.getMod()) | ||
.load(modContainer); | ||
} | ||
catch(ClassNotFoundException | IllegalAccessException | InstantiationException | NoSuchMethodException | InvocationTargetException e){ | ||
log.error("Failed to hook into ClothConfig", e); | ||
} | ||
} | ||
} | ||
} |