本文整理汇总了Java中org.bukkit.configuration.InvalidConfigurationException.printStackTrace方法的典型用法代码示例。如果您正苦于以下问题:Java InvalidConfigurationException.printStackTrace方法的具体用法?Java InvalidConfigurationException.printStackTrace怎么用?Java InvalidConfigurationException.printStackTrace使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.bukkit.configuration.InvalidConfigurationException
的用法示例。
在下文中一共展示了InvalidConfigurationException.printStackTrace方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: StringToItemStack
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public static ItemStack StringToItemStack(String string) {
if (string == null) {
return null;
}
YamlConfiguration yaml = new YamlConfiguration();
try {
yaml.loadFromString(string);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
if (yaml.contains("item")) {
return yaml.getItemStack("item", null);
} else {
return yaml.getItemStack("i", null);
}
}
示例2: create
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public static void create() throws IOException{
File pluginFolder = DogTags.getInstance().getDataFolder();
f = new File(pluginFolder, "config.yml");
if(!f.exists()){
f.getParentFile().mkdirs();
DogTags.getInstance().saveResource(f.getName(), false);
LogUtil.outputMsg("File &6%file% &fdoesn't exist, creating file!".replace("%file%", f.getName()));
}
fc = new YamlConfiguration();
try {
fc.load(f);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
}
示例3: loadItems
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public List<ShopItem> loadItems(String path) {
YamlConfiguration configuration = new YamlConfiguration();
try {
configuration.loadFromString(this.yaml);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
ArrayList<ShopItem> list = new ArrayList<>();
if (configuration.isConfigurationSection(path)) {
ConfigurationSection section = configuration.getConfigurationSection(path);
for (String k : section.getKeys(false)) {
list.add(new ShopItem(section.getConfigurationSection(k)));
}
}
return list;
}
示例4: saveItems
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public void saveItems(String path, List<ShopItem> list) {
YamlConfiguration configuration = new YamlConfiguration();
try {
configuration.loadFromString(this.yaml);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
configuration.set(path, null);
ConfigurationSection section = configuration.createSection(path);
for (int i = 0; i < list.size(); i++) {
ShopItem item = list.get(i);
if (item.getAmount() > 0 && item.getItemStack(1).getType() != Material.AIR) {
list.get(i).save(section.createSection(String.valueOf(i)));
}
}
this.yaml = configuration.saveToString();
}
示例5: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public PositionRequirement fromConfig(Goal goal, ConfigurationSection config) {
PositionRequirement req = new PositionRequirement(goal);
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例6: addTemporaryStorage
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public void addTemporaryStorage(OfflinePlayer player, ItemStack item) {
Query<TempStorageRepo> result = query(TempStorageRepo.class).whereEq("player_id", player.getUniqueId().toString());
YamlConfiguration cfg = new YamlConfiguration();
boolean update;
if (result == null || result.count() == 0) {
update = false;
cfg.set("0", item);
} else {
update = true;
YamlConfiguration tmp = new YamlConfiguration();
try {
tmp.loadFromString(result.selectUnique().yaml);
} catch (InvalidConfigurationException ex) {
ex.printStackTrace();
throw new RuntimeException(ex);
}
List<ItemStack> items = new ArrayList<>();
for (String key : tmp.getKeys(false)) {
items.add(tmp.getItemStack(key));
}
items.add(item);
for (int i = 0; i < items.size(); i++) {
cfg.set(Integer.toString(i), items.get(i));
}
}
TempStorageRepo bean = new TempStorageRepo();
bean.setPlayerId(player.getUniqueId());
bean.yaml = cfg.saveToString();
if (update) {
result.update(bean);
} else {
query(TempStorageRepo.class).insert(bean);
}
}
示例7: getItemStack
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public ItemStack getItemStack() {
YamlConfiguration yaml = new YamlConfiguration();
try {
yaml.loadFromString(new String(Base64.getDecoder().decode(item)));
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
ItemStack itemStack = yaml.getItemStack("item");
itemStack.setAmount(this.amount);
return itemStack;
}
示例8: getItemStack
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public ItemStack getItemStack() {
YamlConfiguration yaml = new YamlConfiguration();
try {
yaml.loadFromString(new String(Base64.getDecoder().decode(item)));
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
ItemStack itemStack = yaml.getItemStack("item");
itemStack.setAmount((int) this.amount);
return itemStack;
}
示例9: SpellPylon
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
/**
* Creates a spell pylon with the given type at the given location. Also sets the icon to
* that which is provided. If nothing is provided for icon (icon == null), a generic clock head
* is used instead (whcih still looks kinda cool)
* @param l Center location for the pylon
*/
public SpellPylon(String type, ItemStack icon, Location l) {
this.type = type;
this.location = l;
entity = (ArmorStand) l.getWorld().spawnEntity(l, EntityType.ARMOR_STAND);
entity.setVisible(false);
entity.setAI(false);
entity.setCustomName(ChatColor.DARK_BLUE + YamlWriter.toStandardFormat(type) + " Rune");
entity.setCustomNameVisible(true);
entity.setGravity(false);
entity.setRemoveWhenFarAway(false);
entity.setSmall(true);
if (icon == null) {
YamlConfiguration yc = new YamlConfiguration();
try {
yc.loadFromString(HEAD_YAML);
icon = yc.getItemStack("skull");
} catch (InvalidConfigurationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
icon = new ItemStack(Material.SKULL_ITEM);
}
}
entity.setHelmet(icon);
entity.setHeadPose(new EulerAngle((1.5 * Math.PI), 0, 0));
effect = new AuraEffect(Effect.FLYING_GLYPH, 2);
effect.play(entity);
Alarm.getScheduler().schedule(this, 0, cycleDuration / movementsPerCycle);
}
示例10: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public TalkRequirement fromConfig(Goal goal, ConfigurationSection config) {
TalkRequirement req = new TalkRequirement(goal);
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例11: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
@Override
public ArriveRequirement fromConfig(Goal goal, ConfigurationSection config) {
ArriveRequirement req = new ArriveRequirement(goal);
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例12: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
@Override
public SlayRequirement fromConfig(Goal goal, ConfigurationSection config) {
SlayRequirement req = new SlayRequirement(goal);
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例13: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public PossessRequirement fromConfig(Goal goal, ConfigurationSection config) {
PossessRequirement req = new PossessRequirement(goal);
req.participants = goal.getQuest().getParticipants();
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例14: fromConfig
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public ChestRequirement fromConfig(Goal goal, ConfigurationSection config) {
ChestRequirement req = new ChestRequirement(goal);
try {
req.fromConfig(config);
} catch (InvalidConfigurationException e) {
e.printStackTrace();
}
return req;
}
示例15: Updater
import org.bukkit.configuration.InvalidConfigurationException; //导入方法依赖的package包/类
public Updater(Main plugin, int resourceID, boolean log)
throws IOException
{
if (plugin == null) {
throw new IllegalArgumentException("Plugin cannot be null");
}
if (resourceID == 0) {
throw new IllegalArgumentException("Resource ID cannot be null (0)");
}
m = plugin;
this.id = resourceID;
this.log = log;
this.url = new URL("https://api.inventivetalent.org/spigot/resource-simple/" + resourceID);
File configDir = new File(plugin.getDataFolder().getParentFile(), "HeadUpdater");
File config = new File(configDir, "config.yml");
YamlConfiguration yamlConfig = new YamlConfiguration();
if (!configDir.exists()) {
configDir.mkdirs();
}
if (!config.exists())
{
config.createNewFile();
yamlConfig.options().header("Configuration for the HeadUpdater system\nit will inform you about new versions of all plugins which use this updater\n'enabled' specifies whether the system is enabled (affects all plugins)");
yamlConfig.options().copyDefaults(true);
yamlConfig.addDefault("enabled", Boolean.valueOf(true));
yamlConfig.addDefault("enabledingame", Boolean.valueOf(true));
yamlConfig.save(config);
}
try
{
yamlConfig.load(config);
}
catch (InvalidConfigurationException e)
{
e.printStackTrace();
return;
}
this.enabled = yamlConfig.getBoolean("enabled");
this.enabledingame = yamlConfig.getBoolean("enabledingame");
super.start();
}