Jump to content

Recommended Posts

Posted

Hello Folks,

I just tried to port my mod from 1.12.2 to 1.16.1. It is a serverside only mod, which doesn't (or shouldn't) be required on the client side. In 1.12.2 there was an attribute in the @mod annotation called "acceptable remote version". I set this to "*" and it worked. In 1.16 the annotation does not take any attribute other than the mod name. So is there another way of doing this? I didn't found anything on the internet regarding this and the only open source mod I know is Ender IO, which has not been ported to 1.16 (and is not serverside only)

 

Thanks in advance :)

Posted

I think that you mean someting like this:
 

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, ...);

 

But I don't know how the function/the second argument would look like. I also tried looking on the internet but didn't find anything related to that.

Posted

Ok nevermind, I got it:

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, ()-> Pair.of(()->FMLNetworkConstants.IGNORESERVERONLY, (version, network) -> {return true;}));

 

And my problem is solved now.

Thanks for the help

  • 4 months later...
Posted (edited)

I can't get it to compile the previous lines

 

ModLoadingContext.get().registerExtensionPoint(ExtensionPoint.DISPLAYTEST, ()-> Pair.of(()->FMLNetworkConstants.IGNORESERVERONLY, (version, network) -> {return true;}));

 

console --> The target type of this expression must be a functional interface

 

import java.io.File;
import java.util.Iterator;
import java.util.function.Supplier;

 

import org.apache.commons.lang3.tuple.Pair;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

 

import com.mojang.brigadier.context.CommandContext;


import net.minecraft.world.server.ServerWorld;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.ExtensionPoint;
import net.minecraftforge.fml.ModLoadingContext;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.event.lifecycle.FMLCommonSetupEvent;
import net.minecraftforge.fml.event.server.FMLServerStartingEvent;
import net.minecraftforge.fml.javafmlmod.FMLJavaModLoadingContext;
import net.minecraftforge.fml.network.FMLNetworkConstants;

 

I need help --> Version Forge 1.16.4 - 35.1.4

 

thanks :)

Edited by Mine_asd

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.