public static void copyDefaultNode(YamlConfiguration configFile, Plugin plugin, String path, String nodPath){
configFile.createSection(nodPath);
path = fixPath(path);
InputStream file = plugin.getResource(path.replace(File.separatorChar, '/'));
if(file!=null){
YamlConfiguration defaultFile = YamlConfiguration.loadConfiguration(new InputStreamReader(file));
if(defaultFile.contains(nodPath))
configFile.set(nodPath, defaultFile.get(path));
else
configFile.set(nodPath, Error.MISSING_NODE.getMessage());
}
File temp = new File(plugin.getDataFolder(), path);
try {
configFile.save(temp);
} catch (IOException e) {
e.printStackTrace();
ErrorLogger.addError("I/O Exception for file : " + temp.getAbsolutePath());
}
}
java类org.bukkit.configuration.file.YamlConfiguration的实例源码
ConfigUtils.java 文件源码
项目:VanillaPlus
阅读 28
收藏 0
点赞 0
评论 0
ConfigController.java 文件源码
项目:CraftyProfessions
阅读 37
收藏 0
点赞 0
评论 0
/**
* This method essentially imitates the getConfig method within the JavaPlugin class
* but is used to create or grab special config files pertaining to the Wage Tables of
* the plugin
*
* @param resource The file or resource to grab the Configuration for.
*
* @return The configuration of the resource.
*/
public YamlConfiguration getSpecialConfig (String resource)
{
YamlConfiguration config = mWageConfigs.get (resource);
if (config == null)
{
InputStream configStream = mPlugin.getResource (resource);
config = YamlConfiguration.loadConfiguration (mWageFiles.get (resource));
if (configStream != null)
{
config.setDefaults (YamlConfiguration.loadConfiguration (new InputStreamReader (configStream, Charsets.UTF_8)));
}
mWageConfigs.put (resource, config);
}
return config;
}
GodFoodFile.java 文件源码
项目:AsgardAscension
阅读 30
收藏 0
点赞 0
评论 0
public void createConfig() {
(new File("plugins" + File.separator + "AsgardAscension" + File.separator
+ "")).mkdirs();
file = new File("plugins" + File.separator + "AsgardAscension",
"food.yml");
config = YamlConfiguration.loadConfiguration(file);
if(!file.exists()){
config.options().header("Potion Effect Types: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/potion/PotionEffectType.html");
config.addDefault("1.name", "Nidhogg�s Heart");
config.addDefault("1.item", 372);
config.addDefault("1.amount", 1);
List<String> effects = new ArrayList<String>();
effects.add("SPEED, 120, 2");
config.addDefault("1.effects", effects);
config.options().copyDefaults(true);
}
saveConfig();
}
Menu.java 文件源码
项目:VanillaPlus
阅读 37
收藏 0
点赞 0
评论 0
public Menu(MessageManager messageManager, YamlConfiguration section) {
ConfigurationSection settings = section.getConfigurationSection(Node.SETTINGS.get());
if(settings == null){
Error.MISSING_NODE.add(Node.SETTINGS.get());
title = new MComponent(VanillaPlusCore.getDefaultLang(), " ");
icons = new Icon[37];
type = InventoryType.CHEST;
refresh = 0;
return;
}else{
title = messageManager.getComponentManager().get(settings.getString(Node.NAME_PATH.get()));
type = InventoryType.valueOf(settings.getString(Node.TYPE.get(), "CHEST"));
if(type == InventoryType.CHEST) {
int size = settings.getInt("ROWS");
if(size < 0 || size > 12)
ErrorLogger.addError("ROWS must be between 0 and 12 inclulsive !");
icons = new Icon[9*size+1];
}
else
icons = new Icon[type.getDefaultSize()+1];
refresh = (byte) settings.getInt("REFRESH", 0);
}
}
ConfigurationBuilder.java 文件源码
项目:Minecordbot
阅读 22
收藏 0
点赞 0
评论 0
private static Object build(Class clazz) {
Object object;
try {
object = clazz.newInstance();
} catch (InstantiationException | IllegalAccessException e) {
Logger.err("Failed to build a configuration - couldn't access the class!");
return null;
}
String name = object.getClass().getDeclaredAnnotation(Configuration.class).value();
File file = new File(JavaPlugin.getProvidingPlugin(clazz).getDataFolder(), String.format("%s.yml", name));
FileConfiguration configFile = YamlConfiguration.loadConfiguration(file);
buildFromConfig(configFile, clazz, object);
return object;
}
ConfigGGM.java 文件源码
项目:UltimateSpawn
阅读 23
收藏 0
点赞 0
评论 0
public static void loadConfig(Plugin plugin) {
pl = plugin;
file = new File(pl.getDataFolder(), "Config/Global/OnJoin/Gamemode-OnJoin.yml");
Config = YamlConfiguration.loadConfiguration(file);
if (!pl.getDataFolder().exists()) {
pl.getDataFolder().mkdir();
}
create();
int gamemode = Config.getInt("On-Join.Spawn.Gamemode.Gamemode");
if ((gamemode != 0) && (gamemode != 1) && (gamemode != 2) && (gamemode != 3)) {
Config.set("Gamemode.Value", Integer.valueOf(0));
}
}
PlayerManager.java 文件源码
项目:MT_Core
阅读 24
收藏 0
点赞 0
评论 0
public void savePlayersToDisk() {
YamlConfiguration config = file.returnYaml();
if (mtPlayers.isEmpty())
return;
for (PlayerObject p : mtPlayers.values()) {
String uuid = p.getUuid().toString();
config.set(uuid + ".pk-state", p.getPkState().name());
config.set(uuid + ".kills", p.getPlayerKills());
config.set(uuid + ".ingame-name", p.getCurrentIngameName());
config.set(uuid + ".in-geck-range", p.isPlayerInRangeOfGeck());
config.set(uuid + ".last-player-kill", p.getLastPlayerKillTime());
// if (config.get(uuid + ".first-join-time") == null)
// config.set(uuid + ".first-join-time", p.getJoinTime());
}
mtPlayers.clear();
file.save(config);
}
Metrics.java 文件源码
项目:Uranium
阅读 35
收藏 0
点赞 0
评论 0
public Metrics() throws IOException {
// load the config
configurationFile = getConfigFile();
configuration = YamlConfiguration.loadConfiguration(configurationFile);
// add some defaults
configuration.addDefault("opt-out", false);
configuration.addDefault("guid", UUID.randomUUID().toString());
configuration.addDefault("debug", false);
// Do we need to create the file?
if (configuration.get("guid", null) == null) {
configuration.options().header("http://mcstats.org").copyDefaults(true);
configuration.save(configurationFile);
}
// Load the guid then
guid = configuration.getString("guid");
debug = configuration.getBoolean("debug", false);
}
Map.java 文件源码
项目:mczone
阅读 26
收藏 0
点赞 0
评论 0
public Map(String title, String worldName, List<Location> spawns, Location specSpawn) {
list.add(this);
this.id = list.size();
this.title = title;
this.worldName = worldName;
this.spawns = spawns;
this.specSpawn = specSpawn;
File file = new File(SurvivalGames.getInstance().getDataFolder() + File.separator + "maps", worldName + ".yml");
if (!file.exists()) {
try {
file.createNewFile();
}
catch (IOException e) {
e.printStackTrace();
}
}
config = YamlConfiguration.loadConfiguration(file);
}
BungeeCordController.java 文件源码
项目:BlockBall
阅读 33
收藏 0
点赞 0
评论 0
public void add(String server, Location location) {
final BungeeCordSignInfo info = new BungeeCordSignInfo.Container(location, server);
this.signs.add(info);
final BungeeCordSignInfo[] signInfos = this.signs.toArray(new BungeeCordSignInfo[this.signs.size()]);
this.plugin.getServer().getScheduler().runTaskAsynchronously(this.plugin, () -> {
try {
final FileConfiguration configuration = new YamlConfiguration();
final File file = new File(BungeeCordController.this.plugin.getDataFolder(), "bungeecord_signs.yml");
if (file.exists()) {
if (!file.delete()) {
Bukkit.getLogger().log(Level.WARNING, "File cannot get deleted.");
}
}
for (int i = 0; i < signInfos.length; i++) {
configuration.set("signs." + i, signInfos[i].serialize());
}
configuration.save(file);
} catch (final IOException e) {
Bukkit.getLogger().log(Level.WARNING, "Save sign location.", e);
}
});
}
NetWorker.java 文件源码
项目:EscapeLag
阅读 25
收藏 0
点赞 0
评论 0
public static void CheckAndDownloadPlugin() {
if (ConfigMain.AutoUpdate == true) {
try {
// 整体获取
File NetworkerFile = new File(EscapeLag.MainThis.getDataFolder(), "networkerlog");
DowloadFile("http://www.relatev.com/files/EscapeLag/NetWorker.yml", NetworkerFile);
YamlConfiguration URLLog = YamlConfiguration.loadConfiguration(NetworkerFile);
// 检查插件并下载新版本
EscapeLag.MainThis.getLogger().info("正在检查新版本插件,请稍等...");
int NewVersion = URLLog.getInt("UpdateVersion");
int NowVersion = Integer.valueOf("%BUILD_NUMBER%");
if (NewVersion > NowVersion) {
EscapeLag.MainThis.getLogger().info("插件检测到新版本 " + NewVersion + ",正在自动下载新版本插件...");
DowloadFile("https://www.relatev.com/files/EscapeLag/EscapeLag.jar", EscapeLag.getPluginsFile());
EscapeLag.MainThis.getLogger().info("插件更新版本下载完成!正在重启服务器!");
Bukkit.shutdown();
} else {
EscapeLag.MainThis.getLogger().info("EscapeLag插件工作良好,暂无新版本检测更新。");
}
// 完成提示
EscapeLag.MainThis.getLogger().info("全部网络工作都读取完毕了...");
} catch (IOException ex) {
}
}
}
PlayerMetaSQLiteControllerIT.java 文件源码
项目:PetBlocks
阅读 32
收藏 0
点赞 0
评论 0
private static Plugin mockPlugin() {
final YamlConfiguration configuration = new YamlConfiguration();
configuration.set("sql.enabled", false);
configuration.set("sql.host", "localhost");
configuration.set("sql.port", 3306);
configuration.set("sql.database", "db");
configuration.set("sql.username", "root");
configuration.set("sql.password", "");
final Plugin plugin = mock(Plugin.class);
if (Bukkit.getServer() == null) {
final Server server = mock(Server.class);
when(server.getLogger()).thenReturn(Logger.getGlobal());
Bukkit.setServer(server);
}
new File("PetBlocks.db").delete();
when(plugin.getDataFolder()).thenReturn(new File("PetBlocks"));
when(plugin.getConfig()).thenReturn(configuration);
when(plugin.getResource(any(String.class))).thenAnswer(invocationOnMock -> {
final String file = invocationOnMock.getArgument(0);
return Thread.currentThread().getContextClassLoader().getResourceAsStream(file);
});
return plugin;
}
Module.java 文件源码
项目:DungeonGen
阅读 39
收藏 0
点赞 0
评论 0
/**Static method to get a modules config alone, returns null if failed.
* The loading is tested during the initial yml test and should therefore work during DunGen runtime.
* @param parent The parent plugin
* @param name The modules name for witch the config should be loaded (file 'name'.yml)
* @return The config object. Returns null if errors occured and sets plugin state to ERROR.
*/
public static YamlConfiguration getConfig(DunGen parent, String name) {
File confFile = new File(parent.getDataFolder(),name+".yml");
if (!confFile.exists()) {
parent.setStateAndNotify(State.ERROR, "Config file for module " + name + " could not be found!");
return null;
}
YamlConfiguration conf = new YamlConfiguration();
try {
conf.load(confFile);
}catch (IOException | InvalidConfigurationException e) {
parent.setStateAndNotify(State.ERROR, "Loading of config file for module " + name + " failed:");
e.printStackTrace();
return null;
}
// everything ok, if code reached here.
parent.getLogger().info("YML file for module " + name + " loaded.");
return conf;
}
FireCraftTableRecipe.java 文件源码
项目:RealSurvival
阅读 35
收藏 0
点赞 0
评论 0
public boolean save(){
YamlConfiguration recipe;
File f=new File(rs.getDataFolder()+File.separator+"SyntheticFormula"+File.separator+"FireCraftTable"+File.separator+name+".yml");
if(!f.exists())try {f.createNewFile();} catch (IOException e1) {return false;}
recipe=YamlConfiguration.loadConfiguration(f);
recipe.set(name+".name", name);
recipe.set(name+".time", time);
recipe.set(name+".temperature", temperature);
recipe.set(name+".maxTime", maxTime);
recipe.set(name+".shape", shape);
for(Character c:materials.keySet())
recipe.set(name+".material."+c,materials.get(c) );
for(int i=0;i<3;i++)
recipe.set(name+".product."+i, product[i]);
try {recipe.save(f);} catch (IOException e) {return false;}
return true;
}
CraftStorage.java 文件源码
项目:CaulCrafting
阅读 42
收藏 0
点赞 0
评论 0
public void removeCraft(int nb) {
try {
//replacing in the file
File craftfile = new File(plugin.getDataFolder(), "crafts.yml");
craftfile.createNewFile();
FileConfiguration craftconfig = YamlConfiguration.loadConfiguration(craftfile);
int count = 0;
for(String craftuuid : craftconfig.getConfigurationSection("Crafts").getKeys(false)) {
if(nb == count) {
craftconfig.set("Crafts." + craftuuid, null);
}
count++;
}
craftconfig.save(craftfile);
} catch (Exception e) {
//
}
}
LobbyModule.java 文件源码
项目:OpenUHC
阅读 28
收藏 0
点赞 0
评论 0
@Override
public void onEnable() {
world = Bukkit.createWorld(new WorldCreator(OpenUHC.WORLD_DIR_PREFIX + "lobby"));
// Read lobby yml if it exists
File lobbyFile = new File(OpenUHC.WORLD_DIR_PREFIX + "lobby/lobby.yml");
if (lobbyFile.exists()) {
FileConfiguration lobbyConfig = YamlConfiguration.loadConfiguration(lobbyFile);
ConfigurationSection spawn = lobbyConfig.getConfigurationSection("spawn");
if (spawn != null) {
double x = spawn.getDouble("x", 0);
double y = spawn.getDouble("y", 64);
double z = spawn.getDouble("z", 0);
double r = spawn.getDouble("r", 1);
this.spawn = new Vector(x, y, z);
radius = (float) r;
}
}
OpenUHC.registerEvents(this);
}
GeneratorListener.java 文件源码
项目:MT_Core
阅读 29
收藏 0
点赞 0
评论 0
public void loadFile() {
file = new PluginFile(main, "generators", FileType.YAML);
for (World w : Bukkit.getWorlds()) {
powerable.put(w.getName(), new ManyMap<>());
generators.put(w.getName(), new ManyMap<>());
}
YamlConfiguration config = file.returnYaml();
for (String locString : config.getStringList("gens")) {
Location loc = StringUtilities.stringToLocation(locString);
ManyMap<String, Location> mm = generators.get(loc.getWorld().getName());
mm.addValue(loc.getChunk().getX() + ";" + loc.getChunk().getZ(), loc);
generators.put(loc.getWorld().getName(), mm);
for (Block bloc : getNearbyBlocks(loc.getBlock(), 15)) {
Location ploc = bloc.getLocation();
ManyMap<String, Location> pmm = powerable.get(ploc.getWorld().getName());
pmm.addValue(ploc.getChunk().getX() + ";" + ploc.getChunk().getZ(), ploc);
powerable.put(ploc.getWorld().getName(), pmm);
}
}
}
PlayerStevesBattleGrounds.java 文件源码
项目:PlayerStevesBattleGrounds
阅读 37
收藏 0
点赞 0
评论 0
@Override
public void onEnable() {
saveResource("lang.yml", false);
saveResource("config.yml", false);
Lang.lang = YamlConfiguration.loadConfiguration(new java.io.File(getDataFolder(), "lang.yml"));
config = YamlConfiguration.loadConfiguration(new java.io.File(getDataFolder(), "config.yml"));
waitTimer.init();
getServer().getPluginManager().registerEvents(new StaticWorldListener(this), this);
getServer().getPluginManager().registerEvents(new PlayerListener(this), this);
getServer().getPluginManager().registerEvents(waitTimer, this);
waitTimer.startTiming();
}
GameController.java 文件源码
项目:SkyWarsReloaded
阅读 25
收藏 0
点赞 0
评论 0
public void signJoinLoad() {
File signJoinFile = new File(SkyWarsReloaded.get().getDataFolder(), "signJoinGames.yml");
if (!signJoinFile.exists()) {
SkyWarsReloaded.get().saveResource("signJoinGames.yml", false);
}
if (signJoinFile.exists()) {
FileConfiguration storage = YamlConfiguration.loadConfiguration(signJoinFile);
try {
for (String gameNumber : storage.getConfigurationSection("games.").getKeys(false)) {
String mapName = storage.getString("games." + gameNumber + ".map");
String world = storage.getString("games." + gameNumber + ".world");
if (mapName != null && world != null) {
GameSign gs = new GameSign(storage.getInt("games." + gameNumber + ".x"), storage.getInt("games." + gameNumber + ".y"), storage.getInt("games." + gameNumber + ".z"), world, mapName);
signJoinGames.put(Integer.valueOf(gameNumber), gs);
createGame(Integer.valueOf(gameNumber), gs);
}
}
} catch (NullPointerException e) {
}
}
}
PlayerManager.java 文件源码
项目:MT_Communication
阅读 30
收藏 0
点赞 0
评论 0
public void savePlayersToDisk() {
YamlConfiguration config = file.returnYaml();
for (PlayerObject p : players.values()) {
String uuid = p.getUuid().toString();
config.set(uuid + ".current-cellphone-recipient", p.getCurrentCellPhoneRecipient());
// config.set(uuid + ".walkie-talkie.current-channel", p.getCurrentWalkieTalkieFrequency().getChannel());
// config.set(uuid + ".walkie-talkie.current-frequency", p.getCurrentWalkieTalkieFrequency().getFrequency());
config.set(uuid + ".notification-sound", p.receiveNotificationSound());
config.set(uuid + ".contacts", p.getContacts());
}
players.clear();
file.save(config);
}
TextMessageManager.java 文件源码
项目:MT_Communication
阅读 23
收藏 0
点赞 0
评论 0
public void saveMessagessToDisk() {
YamlConfiguration config = file.returnYaml();
List<String> messageStrings = new ArrayList<>();
for (TextMessage m : textMessages) {
messageStrings.add(m.getConfigFormat());
}
config.set("messages", messageStrings);
file.save(config);
}
Map.java 文件源码
项目:mczone
阅读 31
收藏 0
点赞 0
评论 0
public static void load() {
list.clear();
File maps = new File(SurvivalGames.getInstance().getDataFolder(), "maps");
for (File yml : Files.getFiles(maps)) {
if (!yml.getName().endsWith(".yml"))
continue;
ConfigAPI api = new ConfigAPI(YamlConfiguration.loadConfiguration(yml));
FileConfiguration config = api.getConfig();
String title = config.getString("info.title");
String worldName = config.getString("info.worldName");
if (title == null || worldName == null) {
Chat.log(Level.SEVERE, "Error with map file: " + yml.getName() + " (no title and/or world name)");
continue;
}
List<Location> spawns = new ArrayList<Location>();
for (String s : config.getConfigurationSection("spawns").getKeys(false)) {
if (api.getString("spawns." + s + ".team") != null && api.getString("spawns." + s + ".team").equals("spec"))
continue;
Location l = api.getLocation("spawns." + s);
spawns.add(l);
}
Location specSpawn = api.getLocation("spawns.spec");
new Map(title, worldName, spawns, specSpawn);
}
Comparator<Map> comp = new Comparator<Map>() {
public int compare(Map m1, Map m2) {
return m1.getTitle().compareTo(m2.getTitle());
}
};
Collections.sort(list, comp);
Chat.log("Loaded a total of " + Map.getList().size() + " maps!");
}
ConfigServer.java 文件源码
项目:UltimateSpawn
阅读 30
收藏 0
点赞 0
评论 0
public static void loadConfig(Plugin plugin) {
pl = plugin;
file = new File(pl.getDataFolder(), "Config/Server.yml");
Config = YamlConfiguration.loadConfiguration(file);
if (!pl.getDataFolder().exists()) {
pl.getDataFolder().mkdir();
}
create();
}
DDoSManager.java 文件源码
项目:ViperBot
阅读 27
收藏 0
点赞 0
评论 0
public FileConfiguration getConfig(){
FileConfiguration config = new YamlConfiguration();
File userFile = new File(mainFolder, "AllowedUsers.yml");
if(userFile.exists()){
try {
config.load(userFile);
} catch (IOException | InvalidConfigurationException e) {
e.printStackTrace();
config.set("Data", allowedUsers);
}
}
return config;
}
TextMessageManager.java 文件源码
项目:MT_Communication
阅读 34
收藏 0
点赞 0
评论 0
public void saveMessagessToDisk() {
YamlConfiguration config = file.returnYaml();
List<String> messageStrings = new ArrayList<>();
for (TextMessage m : textMessages) {
messageStrings.add(m.getConfigFormat());
}
config.set("messages", messageStrings);
file.save(config);
}
TextMessageManager.java 文件源码
项目:MT_Communication
阅读 25
收藏 0
点赞 0
评论 0
public void loadMessagesFromDisk() {
file = new PluginFile("textMessages", FileType.YAML);
YamlConfiguration config = file.returnYaml();
for (String s : config.getStringList("messages")) {
String[] split = s.split("-");
textMessages.add(new TextMessage(split[0], split[1], split[2]));
}
}
SignListener.java 文件源码
项目:SkyWarsReloaded
阅读 24
收藏 0
点赞 0
评论 0
@EventHandler
public void signRemoved(BlockBreakEvent event) {
Location blockLocation = event.getBlock().getLocation();
World w = blockLocation.getWorld();
Block b = w.getBlockAt(blockLocation);
if(b.getType() == Material.WALL_SIGN || b.getType() == Material.SIGN_POST){
Sign sign = (Sign) b.getState();
String line1 = ChatColor.stripColor(sign.getLine(0));
if (line1.equalsIgnoreCase(ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', new Messaging.MessageFormatter().format("signJoinSigns.line1"))))) {
String world = blockLocation.getWorld().getName().toString();
int x = blockLocation.getBlockX();
int y = blockLocation.getBlockY();
int z = blockLocation.getBlockZ();
File signJoinFile = new File(SkyWarsReloaded.get().getDataFolder(), "signJoinGames.yml");
if (signJoinFile.exists()) {
FileConfiguration storage = YamlConfiguration.loadConfiguration(signJoinFile);
for (String gameNumber : storage.getConfigurationSection("games.").getKeys(false)) {
String world1 = storage.getString("games." + gameNumber + ".world");
int x1 = storage.getInt("games." + gameNumber + ".x");
int y1 = storage.getInt("games." + gameNumber + ".y");
int z1 = storage.getInt("games." + gameNumber + ".z");
if (x1 == x && y1 == y && z1 == z && world.equalsIgnoreCase(world1)) {
if (event.getPlayer().hasPermission("swr.signs")) {
SkyWarsReloaded.getGC().removeSignJoinGame(gameNumber);
} else {
event.setCancelled(true);
event.getPlayer().sendMessage(ChatColor.RED + "YOU DO NOT HAVE PERMISSION TO DESTROY SWR SIGNS");
}
}
}
}
}
}
}
ScriptManager.java 文件源码
项目:uppercore
阅读 25
收藏 0
点赞 0
评论 0
public void reloadConfig(File configFile) {
extensionsToEngineName = new HashMap<>();
FileConfiguration config = YamlConfiguration.loadConfiguration(configFile);
ConfigurationSection section = config.getConfigurationSection("engines");
for (Map.Entry<String, Object> obj : section.getValues(false).entrySet())
extensionsToEngineName.put(obj.getKey(), obj.getValue().toString());
}
ParticleController.java 文件源码
项目:SkyWarsReloaded
阅读 24
收藏 0
点赞 0
评论 0
public void load() {
particleMap.clear();
File particleFile = new File(SkyWarsReloaded.get().getDataFolder(), "particleeffects.yml");
if (!particleFile.exists()) {
SkyWarsReloaded.get().saveResource("particleeffects.yml", false);
}
if (particleFile.exists()) {
FileConfiguration storage = YamlConfiguration.loadConfiguration(particleFile);
if (storage.contains("effects")) {
for (String item : storage.getStringList("effects")) {
List<String> itemData = new LinkedList<String>(Arrays.asList(item.split(" ")));
int cost = Integer.parseInt(itemData.get(1));
String effect = itemData.get(0).toLowerCase();
String name = null;
if (effects.contains(effect)) {
name = new Messaging.MessageFormatter().format("effects." + effect);
}
if (name != null) {
particleMap.put(ChatColor.stripColor(ChatColor.translateAlternateColorCodes('&', name)), new ParticleItem(effect, name, cost));
}
}
}
}
}
FriendlyConfiguration.java 文件源码
项目:Peach
阅读 27
收藏 0
点赞 0
评论 0
/**
* @param source original {@link YamlConfiguration} file.
* @throws NullPointerException if source is null.
*/
public FriendlyConfiguration(YamlConfiguration source) {
if (source == null) {
throw new NullPointerException("yaml cannot be null!");
}
this.source = source;
}