Skip to content

Commit

Permalink
feat(game.mod): extension point utils
Browse files Browse the repository at this point in the history
[skip ci]
  • Loading branch information
WakelessSloth56 committed Oct 11, 2022
1 parent 8884ddf commit ed1e7d8
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
@@ -1,4 +1,4 @@
package org.auioc.mcmod.arnicalib.game.cpw;
package org.auioc.mcmod.arnicalib.game.mod;

import java.util.Locale;
import cpw.mods.modlauncher.Launcher;
Expand Down
@@ -0,0 +1,20 @@
package org.auioc.mcmod.arnicalib.game.mod;

import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import net.minecraftforge.fml.IExtensionPoint.DisplayTest;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.network.NetworkConstants;

public class ExtensionPointUtils {

@OnlyIn(Dist.CLIENT)
public static void clientOnly() {
ModLoadingContext.get().registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> "ANY", (remote, isServer) -> isServer));
}

public static void serverOnly() {
ModLoadingContext.get().registerExtensionPoint(DisplayTest.class, () -> new DisplayTest(() -> NetworkConstants.IGNORESERVERONLY, (s, b) -> true));
}

}

0 comments on commit ed1e7d8

Please sign in to comment.