mirror of
https://github.com/ChestShop-authors/ChestShop-3.git
synced 2024-11-24 19:15:48 +01:00
a84c68d49d
- Added support for Deadbolt - By default, left clicking your own sign doesn't do anything - Restricted signs now check if you've got permission ChestShop.group.groupName - Added support for stacking unstackable things - Updated Register - Changed how plugins are loaded.
33 lines
824 B
Java
33 lines
824 B
Java
package com.Acrobot.ChestShop.Utils;
|
|
|
|
import com.Acrobot.ChestShop.ChestShop;
|
|
import org.bukkit.util.config.Configuration;
|
|
|
|
import java.io.File;
|
|
|
|
/**
|
|
* @author Acrobot
|
|
*/
|
|
public class uLongName {
|
|
public static Configuration config = new Configuration(new File(ChestShop.folder, "longName.storage"));
|
|
|
|
public static String getName(final String shortName) {
|
|
return config.getString(shortName, shortName);
|
|
}
|
|
|
|
public static void saveName(String name) {
|
|
if (name.length() != 16) return;
|
|
config.setProperty(name.substring(0, 15), name);
|
|
reloadConfig();
|
|
}
|
|
|
|
public static String stripName(String name) {
|
|
return (name.length() > 15 ? name.substring(0, 15) : name);
|
|
}
|
|
|
|
private static void reloadConfig() {
|
|
config.save();
|
|
config.load();
|
|
}
|
|
}
|