Jump to content

How to make a String config?


Recommended Posts

I can't really find much documentation on Configs, especially strings...


To put simply, I want to have it so that a user will set the information of the item.


When I do something like a boolean, I do it like so:

public static boolean disableUberium;
public static boolean disabled = false;

	final String UBERIUM = Main.config.CATEGORY_GENERAL + Main.config.CATEGORY_SPLITTER + "Materials";
	Main.config.addCustomCategoryComment(UBERIUM, "Disable materials here");
	this.disableUberium = Main.config.get(UBERIUM, "I don't like being OP", disabled).getBoolean(disabled);


So if I was to do a string how would I do it?

I thought it would be like this, but then I get lost:


public static String description;
	final String DESC = Main.config.CATEGORY_GENERAL + Main.config.CATEGORY_SPLITTER + "Materials";
	this.description = Main.config.get(DESC, "default text").getString();

But it doesn't seem to work, any ideas?

(default text is what the description of the item would be)

Why bother?

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.

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.


  • Create New...

Important Information

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