2011-07-23 21:00:47 +02:00
|
|
|
package com.Acrobot.ChestShop.Utils;
|
|
|
|
|
2012-03-01 22:03:59 +01:00
|
|
|
import com.Acrobot.ChestShop.Config.ConfigObject;
|
|
|
|
import org.bukkit.configuration.file.YamlConfiguration;
|
2011-07-23 21:00:47 +02:00
|
|
|
|
2011-08-13 12:08:34 +02:00
|
|
|
import java.io.File;
|
|
|
|
|
2011-07-23 21:00:47 +02:00
|
|
|
/**
|
|
|
|
* @author Acrobot
|
|
|
|
*/
|
|
|
|
public class uLongName {
|
2012-03-01 22:03:59 +01:00
|
|
|
public static YamlConfiguration config;
|
|
|
|
public static File configFile;
|
2011-07-23 21:00:47 +02:00
|
|
|
|
2011-08-13 12:08:34 +02:00
|
|
|
public static String getName(final String shortName) {
|
2011-07-23 21:00:47 +02:00
|
|
|
return config.getString(shortName, shortName);
|
|
|
|
}
|
|
|
|
|
2011-08-13 12:08:34 +02:00
|
|
|
public static void saveName(String name) {
|
|
|
|
if (name.length() != 16) return;
|
2012-03-01 22:03:59 +01:00
|
|
|
config.set(name.substring(0, 15), name);
|
|
|
|
ConfigObject.reloadConfig(config, configFile);
|
2011-07-23 21:00:47 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public static String stripName(String name) {
|
|
|
|
return (name.length() > 15 ? name.substring(0, 15) : name);
|
|
|
|
}
|
|
|
|
}
|