Having trouble with Config

Hello,

A little history: This is the first plugin I’ve made using Sponge, and even before then I didn’t have much expirence with Java.

I’ve looked at several plugins on how they’ve done their configs, and I’ve tried to make a config section to list words I want to detect as a swear, but there’s one line which throws a Java error and I can’t work out what is wrong with it. I’ve marked it on the code send

http://www.codesend.com/view/a157c908f813983a8d5d7f2ff77a77c1/

Any help is appreciated (Please explain your answers, I don’t understand this very well)

  • Alice

You are executing code to add values to an existing node, but specifically in a IF {} block you wrote to detect if the node was null. You need to create the missing node before you can add the values to it. So you’re halfway there…

I don’t understand how to create the node

I updated my code to github… Still don’t understand how to fix

https://github.com/DragonTechMC/DTEssentials/blob/master/src/com/dragontechmc/DTEssentials/config/Config.java

That error usually means that a required class file cannot be found on the classpath. This likely comes from not having the required jars in your workspace (as seen by the jars uploaded straight to github). You can either download the necessary jars yourself, or make a build script (maven or gradle) and add the spongeapi as a dependency (preferred).

But it’s not a Sponge thing which is ‘missing’ and I have all dependencies etc set up correctly

com.google.common.reflect.TypeToken appears to be a guava class. You are probably missing the guava dependency. Either download that and apply it to the build path or setup a build system.