mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-22 17:17:38 +01:00
Use plugin logger, seperate 'quests.entity.*' check
This commit is contained in:
parent
72dbed3173
commit
672f8b9732
@ -24,7 +24,8 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.potion.PotionEffect;
|
||||
|
||||
public class Event {
|
||||
|
||||
|
||||
Quests plugin;
|
||||
String name = "";
|
||||
String message = null;
|
||||
boolean clearInv = false;
|
||||
@ -336,7 +337,7 @@ public class Event {
|
||||
if (data.isBoolean(eventKey + "clear-inventory")) {
|
||||
event.clearInv = data.getBoolean(eventKey + "clear-inventory");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "clear-inventory: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a true/false value!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "clear-inventory: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a true/false value!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -347,7 +348,7 @@ public class Event {
|
||||
if (data.isBoolean(eventKey + "fail-quest")) {
|
||||
event.failQuest = data.getBoolean(eventKey + "fail-quest");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "fail-quest: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a true/false value!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "fail-quest: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a true/false value!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -362,8 +363,8 @@ public class Event {
|
||||
Location loc = Quests.getLocation(s);
|
||||
|
||||
if (loc == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + loc + ChatColor.GOLD + " inside " + ChatColor.GREEN + "explosions: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + loc + ChatColor.GOLD + " inside " + ChatColor.GREEN + "explosions: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -372,7 +373,7 @@ public class Event {
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "explosions: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "explosions: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -395,13 +396,13 @@ public class Event {
|
||||
Location l = Quests.getLocation(effectLocs.get(effectList.indexOf(s)));
|
||||
|
||||
if (effect == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + "effects: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid effect name!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + "effects: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid effect name!");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (l == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + effectLocs.get(effectList.indexOf(s)) + ChatColor.GOLD + " inside " + ChatColor.GREEN + "effect-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + effectLocs.get(effectList.indexOf(s)) + ChatColor.GOLD + " inside " + ChatColor.GREEN + "effect-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -410,17 +411,17 @@ public class Event {
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "effect-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "effect-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "effect-locations:");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "effect-locations:");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "effects: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of effects!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "effects: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of effects!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -435,7 +436,7 @@ public class Event {
|
||||
try {
|
||||
eventItems.add(ItemUtil.readItemStack(s));
|
||||
} catch (Exception e) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] \"" + ChatColor.RED + s + ChatColor.GOLD + "\" inside " + ChatColor.GREEN + " items: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not formatted properly!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] \"" + ChatColor.RED + s + ChatColor.GOLD + "\" inside " + ChatColor.GREEN + " items: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not formatted properly!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -443,7 +444,7 @@ public class Event {
|
||||
event.items.addAll(eventItems);
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "items: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of items!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "items: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of items!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -454,7 +455,7 @@ public class Event {
|
||||
World w = plugin.getServer().getWorld(data.getString(eventKey + "storm-world"));
|
||||
|
||||
if (w == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "storm-world: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid World name!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "storm-world: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid World name!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -463,14 +464,14 @@ public class Event {
|
||||
if (data.getInt(eventKey + "storm-duration", -999) != -999) {
|
||||
event.stormDuration = data.getInt(eventKey + "storm-duration");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "storm-duration: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "storm-duration: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
return null;
|
||||
}
|
||||
|
||||
event.stormWorld = w;
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "storm-duration:");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "storm-duration:");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -481,7 +482,7 @@ public class Event {
|
||||
World w = plugin.getServer().getWorld(data.getString(eventKey + "thunder-world"));
|
||||
|
||||
if (w == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "thunder-world: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid World name!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "thunder-world: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid World name!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -490,14 +491,14 @@ public class Event {
|
||||
if (data.getInt(eventKey + "thunder-duration", -999) != -999) {
|
||||
event.thunderDuration = data.getInt(eventKey + "thunder-duration");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "thunder-duration: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "thunder-duration: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
return null;
|
||||
}
|
||||
|
||||
event.thunderWorld = w;
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "thunder-duration:");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "thunder-duration:");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -514,13 +515,13 @@ public class Event {
|
||||
Integer mobAmount = section.getInt(s + ".spawn-amounts");
|
||||
|
||||
if (spawnLocation == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " mob-spawn-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " mob-spawn-locations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
return null;
|
||||
}
|
||||
|
||||
if (type == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + section.getString(s + ".mob-type") + ChatColor.GOLD + " inside " + ChatColor.GREEN + " mob-spawn-types: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid mob name!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + section.getString(s + ".mob-type") + ChatColor.GOLD + " inside " + ChatColor.GREEN + " mob-spawn-types: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid mob name!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -559,8 +560,8 @@ public class Event {
|
||||
|
||||
Location loc = Quests.getLocation(s);
|
||||
if (loc == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
return null;
|
||||
}
|
||||
event.lightningStrikes.add(loc);
|
||||
@ -568,7 +569,7 @@ public class Event {
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of locations!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -584,7 +585,7 @@ public class Event {
|
||||
event.commands.add(s);
|
||||
}
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "commands: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of commands!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "commands: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of commands!");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -609,7 +610,7 @@ public class Event {
|
||||
|
||||
PotionEffect effect = Quests.getPotionEffect(s, durations.get(types.indexOf(s)), amplifiers.get(types.indexOf(s)));
|
||||
if (effect == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid potion effect name!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + s + ChatColor.GOLD + " inside " + ChatColor.GREEN + " lightning-strikes: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a valid potion effect name!");
|
||||
return null;
|
||||
}
|
||||
event.potionEffects.add(effect);
|
||||
@ -617,27 +618,27 @@ public class Event {
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-amplifiers: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of numbers!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-amplifiers: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of numbers!");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "potion-effect-amplifiers:");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "potion-effect-amplifiers:");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-durations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of numbers!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-durations: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of numbers!");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "potion-effect-durations:");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is missing " + ChatColor.RED + "potion-effect-durations:");
|
||||
return null;
|
||||
}
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-types: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of potion effects!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "potion-effect-types: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a list of potion effects!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -648,7 +649,7 @@ public class Event {
|
||||
if (data.getInt(eventKey + "hunger", -999) != -999) {
|
||||
event.hunger = data.getInt(eventKey + "hunger");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "hunger: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "hunger: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -659,7 +660,7 @@ public class Event {
|
||||
if (data.getInt(eventKey + "saturation", -999) != -999) {
|
||||
event.saturation = data.getInt(eventKey + "saturation");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "saturation: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "saturation: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -670,7 +671,7 @@ public class Event {
|
||||
if (data.getInt(eventKey + "health", -999) != -999) {
|
||||
event.health = data.getInt(eventKey + "health");
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "health: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "health: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a number!");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -682,14 +683,14 @@ public class Event {
|
||||
|
||||
Location l = Quests.getLocation(data.getString(eventKey + "teleport-location"));
|
||||
if (l == null) {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + data.getString(eventKey + "teleport-location") + ChatColor.GOLD + "for " + ChatColor.GREEN + " teleport-location: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + data.getString(eventKey + "teleport-location") + ChatColor.GOLD + "for " + ChatColor.GREEN + " teleport-location: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not in proper location format!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] Proper location format is: \"WorldName x y z\"");
|
||||
return null;
|
||||
}
|
||||
event.teleport = l;
|
||||
|
||||
} else {
|
||||
Quests.printSevere(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "teleport-location: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a location!");
|
||||
plugin.getLogger().severe(ChatColor.GOLD + "[Quests] " + ChatColor.RED + "teleport-location: " + ChatColor.GOLD + "inside Event " + ChatColor.DARK_PURPLE + name + ChatColor.GOLD + " is not a location!");
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -27,7 +27,7 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
|
||||
public class Quest {
|
||||
|
||||
|
||||
public String name;
|
||||
public String description;
|
||||
public String finished;
|
||||
@ -258,7 +258,7 @@ public class Quest {
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
Quests.printWarning("[Quests] Quester \"" + player.getName() + "\" attempted to take Quest \"" + name + "\", but the Custom Requirement \"" + s + "\" could not be found. Does it still exist?");
|
||||
plugin.getLogger().warning("[Quests] Quester \"" + player.getName() + "\" attempted to take Quest \"" + name + "\", but the Custom Requirement \"" + s + "\" could not be found. Does it still exist?");
|
||||
}
|
||||
|
||||
}
|
||||
@ -510,7 +510,7 @@ public class Quest {
|
||||
player.sendMessage("- " + ChatColor.GOLD + found.getRewardName());
|
||||
found.giveReward(player, customRewards.get(s));
|
||||
} else {
|
||||
Quests.printWarning("[Quests] Quester \"" + player.getName() + "\" completed the Quest \"" + name + "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
|
||||
plugin.getLogger().warning("[Quests] Quester \"" + player.getName() + "\" completed the Quest \"" + name + "\", but the Custom Reward \"" + s + "\" could not be found. Does it still exist?");
|
||||
}
|
||||
|
||||
none = null;
|
||||
|
@ -2581,7 +2581,7 @@ public class Quester {
|
||||
|
||||
if (stage == null) {
|
||||
quest.completeQuest(this);
|
||||
Quests.log.log(Level.SEVERE, "[Quests] Invalid stage number for player: \"" + id + "\" on Quest \"" + quest.name + "\". Quest ended.");
|
||||
plugin.getLogger().log(Level.SEVERE, "[Quests] Invalid stage number for player: \"" + id + "\" on Quest \"" + quest.name + "\". Quest ended.");
|
||||
return true;
|
||||
}
|
||||
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -11,7 +11,9 @@ import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
|
||||
public class ItemUtil implements ColorUtil {
|
||||
|
||||
|
||||
static Quests plugin;
|
||||
|
||||
/**
|
||||
* Will compare stacks by name, amount, data, display name/lore and enchantments
|
||||
*
|
||||
@ -75,7 +77,7 @@ public class ItemUtil implements ColorUtil {
|
||||
}
|
||||
|
||||
//Formats -> name-name:amount-amount:data-data:enchantment-enchantment level:displayname-displayname:lore-lore:
|
||||
//
|
||||
//Returns null if invalid format
|
||||
public static ItemStack readItemStack(String data) {
|
||||
|
||||
if (data == null) {
|
||||
@ -92,7 +94,7 @@ public class ItemUtil implements ColorUtil {
|
||||
meta = stack.getItemMeta();
|
||||
} else if (arg.startsWith("amount-")) {
|
||||
if(arg.length() >= 8 && stack != null)
|
||||
stack.setAmount(Integer.parseInt(arg.substring(7)));
|
||||
stack.setAmount(Integer.parseInt(arg.substring(7)));
|
||||
} else if (arg.startsWith("data-")) {
|
||||
stack.setDurability(Short.parseShort(arg.substring(5)));
|
||||
} else if (arg.startsWith("enchantment-")) {
|
||||
@ -103,6 +105,8 @@ public class ItemUtil implements ColorUtil {
|
||||
meta.setDisplayName(arg.substring(5));
|
||||
} else if (arg.startsWith("lore-")) {
|
||||
lore.add(arg.substring(5));
|
||||
} else {
|
||||
plugin.getLogger().severe("Malformed itemstack data in quests.yml: " + arg);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1158,24 +1158,24 @@ public class Lang {
|
||||
config2.save(file);
|
||||
|
||||
} catch (Exception e) {
|
||||
Quests.log.severe("An error occurred while trying to dump new language phrases. Operation aborted. Error log:");
|
||||
plugin.getLogger().severe("An error occurred while trying to dump new language phrases. Operation aborted. Error log:");
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Quests.log.info("There are new language phrases with the current version. They have been stored in /lang/en_new.yml");
|
||||
plugin.getLogger().info("There are new language phrases with the current version. They have been stored in /lang/en_new.yml");
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
Quests.log.severe("There was an error reading the language file: /lang/" + lang + ".yml");
|
||||
Quests.log.severe("Language loading aborted. Error log:");
|
||||
plugin.getLogger().severe("There was an error reading the language file: /lang/" + lang + ".yml");
|
||||
plugin.getLogger().severe("Language loading aborted. Error log:");
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
} else {
|
||||
|
||||
Quests.log.severe("Attempted to load language file: /lang/" + lang + ".yml but the file was not found. Using default language EN");
|
||||
plugin.getLogger().severe("Attempted to load language file: /lang/" + lang + ".yml but the file was not found. Using default language EN");
|
||||
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user