Jump to content

Recommended Posts

Posted

Sorry if Forgelin isn't supported here, there was nowhere else to ask. If you post Java, IDEA automatically converts it into Kotlin, so it doesn't matter if you don't know Kotlin. Anyway, I set up a ClientProxy and ServerProxy that implement an IProxy interface I made. I added a public static val (like a constant in Java) of type IProxy? with an @SidedProxy annotation with the exact package names of both proxies. Both the proxies are public. When I run, I get an error saying this:

 

java.lang.IllegalAccessException: Class net.minecraftforge.fml.common.ProxyInjector can not access a member of class com.fieldbox.upgrademod.ClientProxy with modifiers "private"

 

I don't understand. The object ClientProxy is public, so it shouldn't be throwing this error, right?

 

Proxy code in mod file (Kotlin)

@JvmStatic
@SidedProxy(clientSide = "com.fieldbox.upgrademod.ClientProxy", serverSide = "com.fieldbox.upgrademod.ServerProxy")
public val proxy : IProxy? = null

 

Proxy code in mod file (Java, but a bit rusty)

@SidedProxyclientSide = "com.fieldbox.upgrademod.ClientProxy", serverSide = "com.fieldbox.upgrademod.ServerProxy"public static final IProxy 
Posted
7 minutes ago, fieldbox said:

The object ClientProxy is public, so it shouldn't be throwing this error, right?

Apparently it’s not public. You probably don’t need a proxy at all and can get rid of it completely btw.

@diesieben07 knows plenty about kotlin

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

Posted
3 minutes ago, fieldbox said:

I'm assuming world.isRemote will be fine for any side related code?

Any logical side related code. Proxies deal with physical sides. The replacement for Proxies in 99.5% or cases is Sided EventSubscribers.

About Me

Spoiler

My Discord - Cadiboo#8887

My WebsiteCadiboo.github.io

My ModsCadiboo.github.io/projects

My TutorialsCadiboo.github.io/tutorials

Versions below 1.14.4 are no longer supported on this forum. Use the latest version to receive support.

When asking support remember to include all relevant log files (logs are found in .minecraft/logs/), code if applicable and screenshots if possible.

Only download mods from trusted sites like CurseForge (minecraft.curseforge.com). A list of bad sites can be found here, with more information available at stopmodreposts.org

Edit your own signature at www.minecraftforge.net/forum/settings/signature/ (Make sure to check its compatibility with the Dark Theme)

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.