Posted April 27, 20187 yr 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; }
April 27, 20187 yr Author This is 1.12.2 for reference. The method was changed to public in the main mod a few hours ago and I updated.
April 27, 20187 yr 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.