Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

So I'm working on a feature for my mod. I reference another mod that I'm dependent on in an event handler. I use a method shown below, and while in my IDE the method shows no errors. When I try to build my mod through command prompt with gradlew build, I get an error saying that the the method is not visible.  I've tried cleaning my workspace, deleting and replacing the dependant mod jar, and restarting my computer.

The error:

error: getPlayerList() is not public in Session; cannot be accessed from outside package.

 

Where I reference the method:

Spoiler

@SubscribeEvent
	public void onConnectionCreated(ConnectionCreatedEvent e) {
		if(MinestuckArsenalConfig.connectionGrist) {
			int grist = 2 * 10^(e.getSession().getPlayerList().size());
			
			if(grist >= 2000000000) {
				grist = 2000000000;
			}
			
			grist = grist - 20;
			
			GristHelper.increase(e.getConnection().getClientIdentifier(), new GristSet(GristType.Build, grist));
			MinestuckPlayerTracker.updateGristCache(e.getConnection().getClientIdentifier());
		}
	}

 

 

Method in question: 

Spoiler

/**
	 * Creates a list with all players in the session.
	 * @return Returns a list with the players identifiers.
	 */
	public Set<PlayerIdentifier> getPlayerList()
	{
		Set<PlayerIdentifier> list = new HashSet<PlayerIdentifier>();
		for(SburbConnection c : this.connections)
		{
			list.add(c.getClientIdentifier());
			if(!c.getServerIdentifier().equals(IdentifierHandler.nullIdentifier))
				list.add(c.getServerIdentifier());
		}
		list.addAll(predefinedPlayers.keySet());
		return list;
	}

 

 

What about the Session class? Is it public? 

 

You haven't really given enough code to fully understand what you're trying to do. I'm not familiar with that event, is that a custom event? You said you have dependency to the other mod, are you sure you have that set up properly in your build.gradle and otherwise classpath? And is the other mod properly present for the build purpose?

Check out my tutorials here: http://jabelarminecraft.blogspot.com/

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.