Jump to content

Nested class with Networkmod dosen't switch as member ?


0xC6607Eo1

Recommended Posts

I'm starting to use nested classes towards my mod, just for fun and testing.

I'm actually trying to make nested classes of the configs, networkmod, proxy's and other stuff into one big mod file.

Its possible, altought there is a simply way, I want to try nested classes.

 

I get this error after I attempt to run the mod:

java.lang.IllegalAccessException: Class cpw.mods.fml.common.network.NetworkModHandler can not access a member of class il.steamcraft.common.Steamcraft$NetworkHandler with modifiers ""

 

while its trying to 'tryCreatingPacketHandler()'.

 

I'm using this as my NetworkHandler nest.

 

static class NetworkHandler implements IPacketHandler, IGuiHandler
{
	@Override
	public void onPacketData(INetworkManager INM, Packet250CustomPayload packet, Player player) {}

	@Override
	public Object getServerGuiElement(int var1, EntityPlayer EP, World W, int x, int y, int z) { return null; }

	@Override
	public Object getClientGuiElement(int var1, EntityPlayer EP, World W, int x, int y, int z) { return null; }
}

 

Nothing special, just a stock code.

And I'm using this above my main class

 

@Mod(modid = Steamcraft.SteamcraftInfo.ModID, version = Steamcraft.SteamcraftInfo.Version)
@NetworkMod(channels = { Steamcraft.SteamcraftInfo.ModID }, packetHandler = Steamcraft.NetworkHandler.class, clientSideRequired=true)
public class Steamcraft
{

 

Could anyone help me with this, and please correct me if its 'impossible' due to Forge constructor pre-requests.

Link to comment
Share on other sites

I'm starting to use nested classes towards my mod, just for fun and testing.

I'm actually trying to make nested classes of the configs, networkmod, proxy's and other stuff into one big mod file.

Its possible, altought there is a simply way, I want to try nested classes.

 

I get this error after I attempt to run the mod:

java.lang.IllegalAccessException: Class cpw.mods.fml.common.network.NetworkModHandler can not access a member of class il.steamcraft.common.Steamcraft$NetworkHandler with modifiers ""

 

while its trying to 'tryCreatingPacketHandler()'.

 

I'm using this as my NetworkHandler nest.

 

static class NetworkHandler implements IPacketHandler, IGuiHandler
{
	@Override
	public void onPacketData(INetworkManager INM, Packet250CustomPayload packet, Player player) {}

	@Override
	public Object getServerGuiElement(int var1, EntityPlayer EP, World W, int x, int y, int z) { return null; }

	@Override
	public Object getClientGuiElement(int var1, EntityPlayer EP, World W, int x, int y, int z) { return null; }
}

 

Nothing special, just a stock code.

And I'm using this above my main class

 

@Mod(modid = Steamcraft.SteamcraftInfo.ModID, version = Steamcraft.SteamcraftInfo.Version)
@NetworkMod(channels = { Steamcraft.SteamcraftInfo.ModID }, packetHandler = Steamcraft.NetworkHandler.class, clientSideRequired=true)
public class Steamcraft
{

 

Could anyone help me with this, and please correct me if its 'impossible' due to Forge constructor pre-requests.

Link to comment
Share on other sites

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.