mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-26 15:16:45 +01:00
Refactor ALL THE THINGS!
This commit is contained in:
parent
ac35f002f1
commit
47b7780c96
@ -3,11 +3,11 @@ package com.gmail.nossr50.api;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class ChatAPI {
|
public class ChatAPI {
|
||||||
/**
|
/**
|
||||||
@ -61,7 +61,7 @@ public class ChatAPI {
|
|||||||
mcMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
|
mcMMO.p.getLogger().info("[A]<" + chatEvent.getSender() + "> " + chatEvent.getMessage());
|
||||||
|
|
||||||
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
for (Player player : mcMMO.p.getServer().getOnlinePlayers()) {
|
||||||
if (mcPermissions.getInstance().adminChat(player) || player.isOp())
|
if (Permissions.getInstance().adminChat(player) || player.isOp())
|
||||||
player.sendMessage(aPrefix + chatEvent.getMessage());
|
player.sendMessage(aPrefix + chatEvent.getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,9 +2,9 @@ package com.gmail.nossr50.api;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class ExperienceAPI {
|
public class ExperienceAPI {
|
||||||
|
|
||||||
|
@ -4,8 +4,8 @@ import java.util.ArrayList;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class PartyAPI {
|
public class PartyAPI {
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ package com.gmail.nossr50.commands;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class CommandHelper {
|
public class CommandHelper {
|
||||||
|
|
||||||
@ -23,8 +23,8 @@ public class CommandHelper {
|
|||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
|
|
||||||
if (player != null && !mcPermissions.getInstance().permission(player, permission)) {
|
if (player != null && !Permissions.getInstance().permission(player, permission)) {
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.NoPermission"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -34,7 +34,7 @@ public class CommandHelper {
|
|||||||
|
|
||||||
public static boolean noConsoleUsage(CommandSender sender) {
|
public static boolean noConsoleUsage(CommandSender sender) {
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.NoConsole"));
|
sender.sendMessage(LocaleLoader.getString("Commands.NoConsole"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -51,26 +51,26 @@ public class CommandHelper {
|
|||||||
if (Skills.hasGatheringSkills(inspect)) {
|
if (Skills.hasGatheringSkills(inspect)) {
|
||||||
PlayerProfile PP = Users.getProfile(inspect);
|
PlayerProfile PP = Users.getProfile(inspect);
|
||||||
|
|
||||||
display.sendMessage(mcLocale.getString("Stats.Header.Gathering"));
|
display.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().excavation(inspect)) {
|
if (Permissions.getInstance().excavation(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().fishing(inspect)) {
|
if (Permissions.getInstance().fishing(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().herbalism(inspect)) {
|
if (Permissions.getInstance().herbalism(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().mining(inspect)) {
|
if (Permissions.getInstance().mining(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().woodcutting(inspect)) {
|
if (Permissions.getInstance().woodcutting(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -89,26 +89,26 @@ public class CommandHelper {
|
|||||||
if (Skills.hasCombatSkills(inspect)) {
|
if (Skills.hasCombatSkills(inspect)) {
|
||||||
PlayerProfile PP = Users.getProfile(inspect);
|
PlayerProfile PP = Users.getProfile(inspect);
|
||||||
|
|
||||||
display.sendMessage(mcLocale.getString("Stats.Header.Combat"));
|
display.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().axes(inspect)) {
|
if (Permissions.getInstance().axes(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().archery(inspect)) {
|
if (Permissions.getInstance().archery(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().swords(inspect)) {
|
if (Permissions.getInstance().swords(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().taming(inspect)) {
|
if (Permissions.getInstance().taming(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().unarmed(inspect)) {
|
if (Permissions.getInstance().unarmed(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -126,14 +126,14 @@ public class CommandHelper {
|
|||||||
public static void printMiscSkills(Player inspect, CommandSender display) {
|
public static void printMiscSkills(Player inspect, CommandSender display) {
|
||||||
if (Skills.hasMiscSkills(inspect)) {
|
if (Skills.hasMiscSkills(inspect)) {
|
||||||
PlayerProfile PP = Users.getProfile(inspect);
|
PlayerProfile PP = Users.getProfile(inspect);
|
||||||
display.sendMessage(mcLocale.getString("Stats.Header.Misc"));
|
display.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().acrobatics(inspect)) {
|
if (Permissions.getInstance().acrobatics(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().repair(inspect)) {
|
if (Permissions.getInstance().repair(inspect)) {
|
||||||
display.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
display.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class AddlevelsCommand implements CommandExecutor{
|
public class AddlevelsCommand implements CommandExecutor{
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -40,11 +40,11 @@ public class AddlevelsCommand implements CommandExecutor{
|
|||||||
case 2:
|
case 2:
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
if (!Skills.isSkill(args[0])) {
|
if (!Skills.isSkill(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[1])) {
|
if (Misc.isInt(args[1])) {
|
||||||
modifiedPlayer = (Player) sender;
|
modifiedPlayer = (Player) sender;
|
||||||
levels = Integer.valueOf(args[1]);
|
levels = Integer.valueOf(args[1]);
|
||||||
skill = Skills.getSkillType(args[0]);
|
skill = Skills.getSkillType(args[0]);
|
||||||
@ -54,7 +54,7 @@ public class AddlevelsCommand implements CommandExecutor{
|
|||||||
skillName = "all skills";
|
skillName = "all skills";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.addLevels(skill, levels);
|
PP.addLevels(skill, levels);
|
||||||
@ -73,16 +73,16 @@ public class AddlevelsCommand implements CommandExecutor{
|
|||||||
PP = Users.getProfile(modifiedPlayer);
|
PP = Users.getProfile(modifiedPlayer);
|
||||||
|
|
||||||
if (!PP.isLoaded()) {
|
if (!PP.isLoaded()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Skills.isSkill(args[1])) {
|
if (!Skills.isSkill(args[1])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[2])) {
|
if (Misc.isInt(args[2])) {
|
||||||
levels = Integer.valueOf(args[2]);
|
levels = Integer.valueOf(args[2]);
|
||||||
skill = Skills.getSkillType(args[1]);
|
skill = Skills.getSkillType(args[1]);
|
||||||
String message;
|
String message;
|
||||||
@ -94,7 +94,7 @@ public class AddlevelsCommand implements CommandExecutor{
|
|||||||
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
//TODO: Any way we can make this work for offline use?
|
//TODO: Any way we can make this work for offline use?
|
||||||
public class AddxpCommand implements CommandExecutor {
|
public class AddxpCommand implements CommandExecutor {
|
||||||
@ -38,11 +38,11 @@ public class AddxpCommand implements CommandExecutor {
|
|||||||
case 2:
|
case 2:
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
if (!Skills.isSkill(args[1])) {
|
if (!Skills.isSkill(args[1])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[1])) {
|
if (Misc.isInt(args[1])) {
|
||||||
modifiedPlayer = (Player) sender;
|
modifiedPlayer = (Player) sender;
|
||||||
xp = Integer.valueOf(args[1]);
|
xp = Integer.valueOf(args[1]);
|
||||||
skill = Skills.getSkillType(args[0]);
|
skill = Skills.getSkillType(args[0]);
|
||||||
@ -53,7 +53,7 @@ public class AddxpCommand implements CommandExecutor {
|
|||||||
skillName = "all skills";
|
skillName = "all skills";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
modifiedPlayer.sendMessage(ChatColor.GREEN + "You were awarded " + xp + " experience in " + skillName + "!"); //TODO: Needs more locale.
|
modifiedPlayer.sendMessage(ChatColor.GREEN + "You were awarded " + xp + " experience in " + skillName + "!"); //TODO: Needs more locale.
|
||||||
@ -80,16 +80,16 @@ public class AddxpCommand implements CommandExecutor {
|
|||||||
String playerName = modifiedPlayer.getName();
|
String playerName = modifiedPlayer.getName();
|
||||||
|
|
||||||
if (!Users.getProfile(modifiedPlayer).isLoaded()) {
|
if (!Users.getProfile(modifiedPlayer).isLoaded()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Skills.isSkill(args[1])) {
|
if (!Skills.isSkill(args[1])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[2])) {
|
if (Misc.isInt(args[2])) {
|
||||||
xp = Integer.valueOf(args[2]);
|
xp = Integer.valueOf(args[2]);
|
||||||
skill = Skills.getSkillType(args[1]);
|
skill = Skills.getSkillType(args[1]);
|
||||||
String message;
|
String message;
|
||||||
@ -101,7 +101,7 @@ public class AddxpCommand implements CommandExecutor {
|
|||||||
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,14 +6,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class InspectCommand implements CommandExecutor {
|
public class InspectCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -40,49 +40,49 @@ public class InspectCommand implements CommandExecutor {
|
|||||||
if (target.isOnline()) {
|
if (target.isOnline()) {
|
||||||
Player player = (Player) target;
|
Player player = (Player) target;
|
||||||
|
|
||||||
if (sender instanceof Player && !sender.isOp() && !m.isNear(((Player) sender).getLocation(), player.getLocation(), 5.0) && !mcPermissions.getInstance().inspectDistanceBypass((Player) sender)) {
|
if (sender instanceof Player && !sender.isOp() && !Misc.isNear(((Player) sender).getLocation(), player.getLocation(), 5.0) && !Permissions.getInstance().inspectDistanceBypass((Player) sender)) {
|
||||||
sender.sendMessage(mcLocale.getString("Inspect.TooFar"));
|
sender.sendMessage(LocaleLoader.getString("Inspect.TooFar"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(mcLocale.getString("Inspect.Stats", new Object[] { target.getName() }));
|
sender.sendMessage(LocaleLoader.getString("Inspect.Stats", new Object[] { target.getName() }));
|
||||||
CommandHelper.printGatheringSkills(player, sender);
|
CommandHelper.printGatheringSkills(player, sender);
|
||||||
CommandHelper.printCombatSkills(player, sender);
|
CommandHelper.printCombatSkills(player, sender);
|
||||||
CommandHelper.printMiscSkills(player, sender);
|
CommandHelper.printMiscSkills(player, sender);
|
||||||
sender.sendMessage(mcLocale.getString("Commands.PowerLevel", new Object[] { PP.getPowerLevel() }));
|
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { PP.getPowerLevel() }));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (sender instanceof Player && !sender.isOp() && !mcPermissions.getInstance().inspectOfflineBypass((Player) sender)) {
|
if (sender instanceof Player && !sender.isOp() && !Permissions.getInstance().inspectOfflineBypass((Player) sender)) {
|
||||||
sender.sendMessage(mcLocale.getString("Inspect.Offline"));
|
sender.sendMessage(LocaleLoader.getString("Inspect.Offline"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!PP.isLoaded()) {
|
if (!PP.isLoaded()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
sender.sendMessage(mcLocale.getString("Inspect.OfflineStats", new Object[] { args[0] }));
|
sender.sendMessage(LocaleLoader.getString("Inspect.OfflineStats", new Object[] { args[0] }));
|
||||||
|
|
||||||
sender.sendMessage(mcLocale.getString("Stats.Header.Gathering"));
|
sender.sendMessage(LocaleLoader.getString("Stats.Header.Gathering"));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Excavation.Listener"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Fishing.Listener"), PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Herbalism.Listener"), PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Mining.Listener"), PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Woodcutting.Listener"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
||||||
|
|
||||||
sender.sendMessage(mcLocale.getString("Stats.Header.Combat"));
|
sender.sendMessage(LocaleLoader.getString("Stats.Header.Combat"));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Axes.Listener"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Archery.Listener"), PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Swords.Listener"), PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Taming.Listener"), PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Unarmed.Listener"), PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
||||||
|
|
||||||
sender.sendMessage(mcLocale.getString("Stats.Header.Misc"));
|
sender.sendMessage(LocaleLoader.getString("Stats.Header.Misc"));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Acrobatics.Listener"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
||||||
sender.sendMessage(mcLocale.getString("Skills.Stats", new Object[] { mcLocale.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
sender.sendMessage(LocaleLoader.getString("Skills.Stats", new Object[] { LocaleLoader.getString("Repair.Listener"), PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McstatsCommand implements CommandExecutor {
|
public class McstatsCommand implements CommandExecutor {
|
||||||
|
|
||||||
@ -21,14 +21,14 @@ public class McstatsCommand implements CommandExecutor {
|
|||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Stats.Own.Stats"));
|
player.sendMessage(LocaleLoader.getString("Stats.Own.Stats"));
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.NoSkillNote"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoSkillNote"));
|
||||||
|
|
||||||
CommandHelper.printGatheringSkills(player);
|
CommandHelper.printGatheringSkills(player);
|
||||||
CommandHelper.printCombatSkills(player);
|
CommandHelper.printCombatSkills(player);
|
||||||
CommandHelper.printMiscSkills(player);
|
CommandHelper.printMiscSkills(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.PowerLevel", new Object[] { String.valueOf(PP.getPowerLevel()) }));
|
player.sendMessage(LocaleLoader.getString("Commands.PowerLevel", new Object[] { String.valueOf(PP.getPowerLevel()) }));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -7,14 +7,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class MmoeditCommand implements CommandExecutor {
|
public class MmoeditCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -40,11 +40,11 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
case 2:
|
case 2:
|
||||||
if (sender instanceof Player) {
|
if (sender instanceof Player) {
|
||||||
if (!Skills.isSkill(args[0])) {
|
if (!Skills.isSkill(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[1])) {
|
if (Misc.isInt(args[1])) {
|
||||||
modifiedPlayer = (Player) sender;
|
modifiedPlayer = (Player) sender;
|
||||||
newValue = Integer.valueOf(args[1]);
|
newValue = Integer.valueOf(args[1]);
|
||||||
skill = Skills.getSkillType(args[0]);
|
skill = Skills.getSkillType(args[0]);
|
||||||
@ -54,7 +54,7 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
skillName = "all skills";
|
skillName = "all skills";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.modifySkill(skill, newValue);
|
PP.modifySkill(skill, newValue);
|
||||||
@ -76,16 +76,16 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
PP = Users.getProfile(modifiedPlayer);
|
PP = Users.getProfile(modifiedPlayer);
|
||||||
|
|
||||||
if (!PP.isLoaded()) {
|
if (!PP.isLoaded()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Skills.isSkill(args[1])) {
|
if (!Skills.isSkill(args[1])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[2])) {
|
if (Misc.isInt(args[2])) {
|
||||||
newValue = Integer.valueOf(args[2]);
|
newValue = Integer.valueOf(args[2]);
|
||||||
skill = Skills.getSkillType(args[1]);
|
skill = Skills.getSkillType(args[1]);
|
||||||
String message;
|
String message;
|
||||||
@ -97,7 +97,7 @@ public class MmoeditCommand implements CommandExecutor {
|
|||||||
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + "All skills have been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
skillName = m.getCapitalized(skill.toString());
|
skillName = Misc.getCapitalized(skill.toString());
|
||||||
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
message = ChatColor.RED + skillName + " has been modified for " + playerName + "."; //TODO: Use locale
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,11 +6,11 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.runnables.SQLConversionTask;
|
import com.gmail.nossr50.runnables.SQLConversionTask;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class MmoupdateCommand implements CommandExecutor {
|
public class MmoupdateCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
@ -5,11 +5,11 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
public class XprateCommand implements CommandExecutor {
|
public class XprateCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -22,9 +22,9 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
String usage1 = mcLocale.getString("Commands.xprate.proper.0");
|
String usage1 = LocaleLoader.getString("Commands.xprate.proper.0");
|
||||||
String usage2 = mcLocale.getString("Commands.xprate.proper.1");
|
String usage2 = LocaleLoader.getString("Commands.xprate.proper.1");
|
||||||
String usage3 = mcLocale.getString("Commands.xprate.proper.2");
|
String usage3 = LocaleLoader.getString("Commands.xprate.proper.2");
|
||||||
|
|
||||||
if (CommandHelper.noCommandPermissions(sender, "mcmmo.admin")) {
|
if (CommandHelper.noCommandPermissions(sender, "mcmmo.admin")) {
|
||||||
return true;
|
return true;
|
||||||
@ -35,7 +35,7 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
if (args[0].equalsIgnoreCase("reset")) {
|
if (args[0].equalsIgnoreCase("reset")) {
|
||||||
if (xpevent) {
|
if (xpevent) {
|
||||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||||
x.sendMessage(mcLocale.getString("Commands.xprate.over"));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.over"));
|
||||||
}
|
}
|
||||||
|
|
||||||
xpevent = !xpevent;
|
xpevent = !xpevent;
|
||||||
@ -45,7 +45,7 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
Config.getInstance().xpGainMultiplier = oldrate;
|
Config.getInstance().xpGainMultiplier = oldrate;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (m.isInt(args[0])) {
|
else if (Misc.isInt(args[0])) {
|
||||||
sender.sendMessage(usage3);
|
sender.sendMessage(usage3);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -55,7 +55,7 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (m.isInt(args[0])) {
|
if (Misc.isInt(args[0])) {
|
||||||
oldrate = Config.getInstance().xpGainMultiplier;
|
oldrate = Config.getInstance().xpGainMultiplier;
|
||||||
|
|
||||||
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
|
if (args[1].equalsIgnoreCase("true") || args[1].equalsIgnoreCase("false")) {
|
||||||
@ -65,12 +65,12 @@ public class XprateCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(usage3);
|
sender.sendMessage(usage3);
|
||||||
}
|
}
|
||||||
|
|
||||||
Config.getInstance().xpGainMultiplier = m.getInt(args[0]);
|
Config.getInstance().xpGainMultiplier = Misc.getInt(args[0]);
|
||||||
|
|
||||||
if (xpevent) {
|
if (xpevent) {
|
||||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||||
x.sendMessage(mcLocale.getString("Commands.xprate.started.0"));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.0"));
|
||||||
x.sendMessage(mcLocale.getString("Commands.xprate.started.1", new Object[] {Config.getInstance().xpGainMultiplier}));
|
x.sendMessage(LocaleLoader.getString("Commands.xprate.started.1", new Object[] {Config.getInstance().xpGainMultiplier}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
@ -5,10 +5,10 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McabilityCommand implements CommandExecutor {
|
public class McabilityCommand implements CommandExecutor {
|
||||||
|
|
||||||
@ -25,10 +25,10 @@ public class McabilityCommand implements CommandExecutor {
|
|||||||
PlayerProfile PP = Users.getProfile((Player) sender);
|
PlayerProfile PP = Users.getProfile((Player) sender);
|
||||||
|
|
||||||
if (PP.getAbilityUse()) {
|
if (PP.getAbilityUse()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Ability.Off"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Ability.Off"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Ability.On"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Ability.On"));
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.toggleAbilityUse();
|
PP.toggleAbilityUse();
|
||||||
|
@ -6,9 +6,9 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
//TODO: Rework this whole thing. It's ugly. Also is missing all the admin & spout commands.
|
//TODO: Rework this whole thing. It's ugly. Also is missing all the admin & spout commands.
|
||||||
public class MccCommand implements CommandExecutor {
|
public class MccCommand implements CommandExecutor {
|
||||||
@ -23,49 +23,49 @@ public class MccCommand implements CommandExecutor {
|
|||||||
|
|
||||||
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale.
|
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale.
|
||||||
|
|
||||||
if (mcPermissions.getInstance().party(player)) {
|
if (Permissions.getInstance().party(player)) {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.Commands"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Commands"));
|
||||||
player.sendMessage("/party " + mcLocale.getString("Commands.Party"));
|
player.sendMessage("/party " + LocaleLoader.getString("Commands.Party"));
|
||||||
player.sendMessage("/party q " + mcLocale.getString("Commands.Party.Quit"));
|
player.sendMessage("/party q " + LocaleLoader.getString("Commands.Party.Quit"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().partyChat(player)) {
|
if (Permissions.getInstance().partyChat(player)) {
|
||||||
player.sendMessage("/p " + mcLocale.getString("Commands.Party.Toggle"));
|
player.sendMessage("/p " + LocaleLoader.getString("Commands.Party.Toggle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage("/invite " + mcLocale.getString("Commands.Party.Invite"));
|
player.sendMessage("/invite " + LocaleLoader.getString("Commands.Party.Invite"));
|
||||||
player.sendMessage("/accept " + mcLocale.getString("Commands.Party.Accept"));
|
player.sendMessage("/accept " + LocaleLoader.getString("Commands.Party.Accept"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().partyTeleport(player)) {
|
if (Permissions.getInstance().partyTeleport(player)) {
|
||||||
player.sendMessage("/ptp " + mcLocale.getString("Commands.Party.Teleport"));
|
player.sendMessage("/ptp " + LocaleLoader.getString("Commands.Party.Teleport"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.Other"));
|
player.sendMessage(LocaleLoader.getString("Commands.Other"));
|
||||||
player.sendMessage("/mcstats " + mcLocale.getString("Commands.Stats"));
|
player.sendMessage("/mcstats " + LocaleLoader.getString("Commands.Stats"));
|
||||||
player.sendMessage("/mctop " + mcLocale.getString("m.mccLeaderboards"));
|
player.sendMessage("/mctop " + LocaleLoader.getString("m.mccLeaderboards"));
|
||||||
|
|
||||||
if (mcPermissions.getInstance().mcAbility(player)) {
|
if (Permissions.getInstance().mcAbility(player)) {
|
||||||
player.sendMessage("/mcability " + mcLocale.getString("Commands.ToggleAbility"));
|
player.sendMessage("/mcability " + LocaleLoader.getString("Commands.ToggleAbility"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().adminChat(player)) {
|
if (Permissions.getInstance().adminChat(player)) {
|
||||||
player.sendMessage("/a " + mcLocale.getString("Commands.AdminToggle"));
|
player.sendMessage("/a " + LocaleLoader.getString("Commands.AdminToggle"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().inspect(player)) {
|
if (Permissions.getInstance().inspect(player)) {
|
||||||
player.sendMessage("/inspect " + mcLocale.getString("Commands.Inspect"));
|
player.sendMessage("/inspect " + LocaleLoader.getString("Commands.Inspect"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().mmoedit(player)) {
|
if (Permissions.getInstance().mmoedit(player)) {
|
||||||
player.sendMessage("/mmoedit " + mcLocale.getString("Commands.mmoedit"));
|
player.sendMessage("/mmoedit " + LocaleLoader.getString("Commands.mmoedit"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().mcgod(player)) {
|
if (Permissions.getInstance().mcgod(player)) {
|
||||||
player.sendMessage("/mcgod " + mcLocale.getString("Commands.mcgod"));
|
player.sendMessage("/mcgod " + LocaleLoader.getString("Commands.mcgod"));
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.SkillInfo"));
|
player.sendMessage(LocaleLoader.getString("Commands.SkillInfo"));
|
||||||
player.sendMessage("/mcmmo " + mcLocale.getString("Commands.ModDescription"));
|
player.sendMessage("/mcmmo " + LocaleLoader.getString("Commands.ModDescription"));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,10 +5,10 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McgodCommand implements CommandExecutor {
|
public class McgodCommand implements CommandExecutor {
|
||||||
|
|
||||||
@ -25,10 +25,10 @@ public class McgodCommand implements CommandExecutor {
|
|||||||
PlayerProfile PP = Users.getProfile((Player) sender);
|
PlayerProfile PP = Users.getProfile((Player) sender);
|
||||||
|
|
||||||
if (PP.getGodMode()) {
|
if (PP.getGodMode()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.GodMode.Disabled"));
|
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Disabled"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.GodMode.Enabled"));
|
sender.sendMessage(LocaleLoader.getString("Commands.GodMode.Enabled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.toggleGodMode();
|
PP.toggleGodMode();
|
||||||
|
@ -8,13 +8,13 @@ import org.bukkit.command.CommandSender;
|
|||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
public class McmmoCommand implements CommandExecutor {
|
public class McmmoCommand implements CommandExecutor {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||||
String description = mcLocale.getString("mcMMO.Description");
|
String description = LocaleLoader.getString("mcMMO.Description");
|
||||||
String[] mcSplit = description.split(",");
|
String[] mcSplit = description.split(",");
|
||||||
sender.sendMessage(mcSplit);
|
sender.sendMessage(mcSplit);
|
||||||
|
|
||||||
|
@ -7,11 +7,11 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McrefreshCommand implements CommandExecutor {
|
public class McrefreshCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -48,7 +48,7 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
String playerName = player.getName();
|
String playerName = player.getName();
|
||||||
|
|
||||||
if (!PP.isLoaded()) {
|
if (!PP.isLoaded()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class McrefreshCommand implements CommandExecutor {
|
|||||||
PP.resetAbilityMode();
|
PP.resetAbilityMode();
|
||||||
|
|
||||||
if (player.isOnline()) {
|
if (player.isOnline()) {
|
||||||
((Player) player).sendMessage(mcLocale.getString("Ability.Generic.Refresh"));
|
((Player) player).sendMessage(LocaleLoader.getString("Ability.Generic.Refresh"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -10,11 +10,11 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class McremoveCommand implements CommandExecutor {
|
public class McremoveCommand implements CommandExecutor {
|
||||||
private final String location = mcMMO.usersFile;
|
private final String location = mcMMO.usersFile;
|
||||||
@ -82,7 +82,7 @@ public class McremoveCommand implements CommandExecutor {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -90,7 +90,7 @@ public class McremoveCommand implements CommandExecutor {
|
|||||||
sender.sendMessage(success);
|
sender.sendMessage(success);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.DoesNotExist"));
|
sender.sendMessage(LocaleLoader.getString("Commands.DoesNotExist"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,12 +7,12 @@ import org.bukkit.ChatColor;
|
|||||||
import org.bukkit.command.Command;
|
import org.bukkit.command.Command;
|
||||||
import org.bukkit.command.CommandExecutor;
|
import org.bukkit.command.CommandExecutor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import com.gmail.nossr50.Leaderboard;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Leaderboard;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
public class MctopCommand implements CommandExecutor {
|
public class MctopCommand implements CommandExecutor {
|
||||||
|
|
||||||
@ -28,25 +28,25 @@ public class MctopCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (m.isInt(args[0])) {
|
if (Misc.isInt(args[0])) {
|
||||||
flatfileDisplay(Integer.valueOf(args[0]), "ALL", sender);
|
flatfileDisplay(Integer.valueOf(args[0]), "ALL", sender);
|
||||||
}
|
}
|
||||||
else if (Skills.isSkill(args[0])) {
|
else if (Skills.isSkill(args[0])) {
|
||||||
flatfileDisplay(1, args[0].toUpperCase(), sender);
|
flatfileDisplay(1, args[0].toUpperCase(), sender);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (!Skills.isSkill(args[0])) {
|
if (!Skills.isSkill(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[1])) {
|
if (Misc.isInt(args[1])) {
|
||||||
flatfileDisplay(Integer.valueOf(args[1]), args[0].toUpperCase(), sender);
|
flatfileDisplay(Integer.valueOf(args[1]), args[0].toUpperCase(), sender);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -69,25 +69,25 @@ public class MctopCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (m.isInt(args[0])) {
|
if (Misc.isInt(args[0])) {
|
||||||
sqlDisplay(Integer.valueOf(args[0]), powerlevel, sender);
|
sqlDisplay(Integer.valueOf(args[0]), powerlevel, sender);
|
||||||
}
|
}
|
||||||
else if (Skills.isSkill(args[0])) {
|
else if (Skills.isSkill(args[0])) {
|
||||||
sqlDisplay(1, args[0].toLowerCase(), sender);
|
sqlDisplay(1, args[0].toLowerCase(), sender);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (!Skills.isSkill(args[0])) {
|
if (!Skills.isSkill(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m.isInt(args[1])) {
|
if (Misc.isInt(args[1])) {
|
||||||
sqlDisplay(Integer.valueOf(args[1]), args[0].toLowerCase(), sender);
|
sqlDisplay(Integer.valueOf(args[1]), args[0].toLowerCase(), sender);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -107,10 +107,10 @@ public class MctopCommand implements CommandExecutor {
|
|||||||
String[] info = Leaderboard.retrieveInfo(skill, page);
|
String[] info = Leaderboard.retrieveInfo(skill, page);
|
||||||
|
|
||||||
if (skill == "ALL") {
|
if (skill == "ALL") {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.PowerLevel.Leaderboard"));
|
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Leaderboard", new Object[] { m.getCapitalized(skill) }));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", new Object[] { Misc.getCapitalized(skill) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
int n = (page * 10) - 9; // Position
|
int n = (page * 10) - 9; // Position
|
||||||
@ -136,10 +136,10 @@ public class MctopCommand implements CommandExecutor {
|
|||||||
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC ");
|
HashMap<Integer, ArrayList<String>> userslist = mcMMO.database.read("SELECT " + query + ", user_id FROM " + tablePrefix + "skills WHERE " + query + " > 0 ORDER BY " + query + " DESC ");
|
||||||
|
|
||||||
if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") {
|
if (query == "taming+mining+woodcutting+repair+unarmed+herbalism+excavation+archery+swords+axes+acrobatics+fishing") {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.PowerLevel.Leaderboard"));
|
sender.sendMessage(LocaleLoader.getString("Commands.PowerLevel.Leaderboard"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Skill.Leaderboard", new Object[] { m.getCapitalized(query) }));
|
sender.sendMessage(LocaleLoader.getString("Commands.Skill.Leaderboard", new Object[] { Misc.getCapitalized(query) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = (page * 10) - 9; i <= (page * 10); i++) {
|
for (int i = (page * 10) - 9; i <= (page * 10); i++) {
|
||||||
|
@ -6,13 +6,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class ACommand implements CommandExecutor {
|
public class ACommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -42,10 +42,10 @@ public class ACommand implements CommandExecutor {
|
|||||||
PP.toggleAdminChat();
|
PP.toggleAdminChat();
|
||||||
|
|
||||||
if (PP.getAdminChatMode()) {
|
if (PP.getAdminChatMode()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.AdminChat.On"));
|
sender.sendMessage(LocaleLoader.getString("Commands.AdminChat.On"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.AdminChat.Off"));
|
sender.sendMessage(LocaleLoader.getString("Commands.AdminChat.Off"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -88,7 +88,7 @@ public class ACommand implements CommandExecutor {
|
|||||||
plugin.getLogger().info("[A]<*Console*> " + message);
|
plugin.getLogger().info("[A]<*Console*> " + message);
|
||||||
|
|
||||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
||||||
if (mcPermissions.getInstance().adminChat(player) || player.isOp()) {
|
if (Permissions.getInstance().adminChat(player) || player.isOp()) {
|
||||||
player.sendMessage(prefix + message);
|
player.sendMessage(prefix + message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -5,14 +5,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class AcceptCommand implements CommandExecutor {
|
public class AcceptCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -60,7 +60,7 @@ public class AcceptCommand implements CommandExecutor {
|
|||||||
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.NoInvites"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoInvites"));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
//TODO: Make this work from console.
|
//TODO: Make this work from console.
|
||||||
public class InviteCommand implements CommandExecutor {
|
public class InviteCommand implements CommandExecutor {
|
||||||
@ -41,7 +41,7 @@ public class InviteCommand implements CommandExecutor {
|
|||||||
Party partyInstance = Party.getInstance();
|
Party partyInstance = Party.getInstance();
|
||||||
|
|
||||||
if (!PP.inParty()) {
|
if (!PP.inParty()) {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.None"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -52,19 +52,19 @@ public class InviteCommand implements CommandExecutor {
|
|||||||
PlayerProfile PPt = Users.getProfile(target);
|
PlayerProfile PPt = Users.getProfile(target);
|
||||||
PPt.modifyInvite(PP.getParty());
|
PPt.modifyInvite(PP.getParty());
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.Invite.Success"));
|
player.sendMessage(LocaleLoader.getString("Commands.Invite.Success"));
|
||||||
|
|
||||||
target.sendMessage(mcLocale.getString("Commands.Party.Invite.0", new Object[] { PPt.getInvite(), player.getName() }));
|
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.0", new Object[] { PPt.getInvite(), player.getName() }));
|
||||||
target.sendMessage(mcLocale.getString("Commands.Party.Invite.1"));
|
target.sendMessage(LocaleLoader.getString("Commands.Party.Invite.1"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.Locked"));
|
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.Player.Invalid"));
|
player.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,13 +6,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class PCommand implements CommandExecutor {
|
public class PCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -43,10 +43,10 @@ public class PCommand implements CommandExecutor {
|
|||||||
PP.togglePartyChat();
|
PP.togglePartyChat();
|
||||||
|
|
||||||
if (PP.getPartyChatMode()) {
|
if (PP.getPartyChatMode()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Party.Chat.On"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Party.Chat.On"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Party.Chat.Off"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Party.Chat.Off"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -61,7 +61,7 @@ public class PCommand implements CommandExecutor {
|
|||||||
PP = Users.getProfile(player);
|
PP = Users.getProfile(player);
|
||||||
|
|
||||||
if (!PP.inParty()) {
|
if (!PP.inParty()) {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.None"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ public class PCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Party.getInstance().isParty(args[0])) {
|
if (!Party.getInstance().isParty(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Party.InvalidName"));
|
sender.sendMessage(LocaleLoader.getString("Party.InvalidName"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,14 +6,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class PartyCommand implements CommandExecutor {
|
public class PartyCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -48,9 +48,9 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
switch (args.length) {
|
switch (args.length) {
|
||||||
case 0:
|
case 0:
|
||||||
if (!inParty) {
|
if (!inParty) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.0"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.0"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.1"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.1"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.2"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.2"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
String tempList = "";
|
String tempList = "";
|
||||||
@ -71,8 +71,8 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
tempList += ChatColor.WHITE + playerName;
|
tempList += ChatColor.WHITE + playerName;
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.InParty", new Object[] { partyName }));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.InParty", new Object[] { partyName }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.Members", new Object[] { tempList }));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Members", new Object[] { tempList }));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -88,33 +88,33 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
partyInstance.removeFromParty(player, PP);
|
partyInstance.removeFromParty(player, PP);
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.Leave"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Leave"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage("Commands.Party.None");
|
player.sendMessage("Commands.Party.None");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[0].equals("?")) {
|
else if (args[0].equals("?")) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.3"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.3"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.1"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.1"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.4"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.4"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.5"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.5"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.6"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.6"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.7"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.7"));
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("lock")) {
|
else if (args[0].equalsIgnoreCase("lock")) {
|
||||||
if (inParty) {
|
if (inParty) {
|
||||||
if (isLeader) {
|
if (isLeader) {
|
||||||
if (partyInstance.isPartyLocked(partyName)) {
|
if (partyInstance.isPartyLocked(partyName)) {
|
||||||
player.sendMessage(mcLocale.getString("Party.IsLocked"));
|
player.sendMessage(LocaleLoader.getString("Party.IsLocked"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
partyInstance.lockParty(partyName);
|
partyInstance.lockParty(partyName);
|
||||||
player.sendMessage(mcLocale.getString("Party.Locked"));
|
player.sendMessage(LocaleLoader.getString("Party.Locked"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -125,15 +125,15 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
if (inParty) {
|
if (inParty) {
|
||||||
if (isLeader) {
|
if (isLeader) {
|
||||||
if (!partyInstance.isPartyLocked(partyName)) {
|
if (!partyInstance.isPartyLocked(partyName)) {
|
||||||
player.sendMessage(mcLocale.getString("Party.IsntLocked"));
|
player.sendMessage(LocaleLoader.getString("Party.IsntLocked"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
partyInstance.unlockParty(partyName);
|
partyInstance.unlockParty(partyName);
|
||||||
player.sendMessage(mcLocale.getString("Party.Unlocked"));
|
player.sendMessage(LocaleLoader.getString("Party.Unlocked"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -167,7 +167,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
if (!partyInstance.isParty(args[0])) {
|
if (!partyInstance.isParty(args[0])) {
|
||||||
sender.sendMessage(mcLocale.getString("Party.InvalidName"));
|
sender.sendMessage(LocaleLoader.getString("Party.InvalidName"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -179,10 +179,10 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
partyInstance.setPartyPassword(partyName, args[1]);
|
partyInstance.setPartyPassword(partyName, args[1]);
|
||||||
player.sendMessage(mcLocale.getString("Party.PasswordSet", new Object[] { args[1] }));
|
player.sendMessage(LocaleLoader.getString("Party.PasswordSet", new Object[] { args[1] }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("kick")) {
|
else if (args[0].equalsIgnoreCase("kick")) {
|
||||||
@ -190,7 +190,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
Player target = plugin.getServer().getPlayer(args[1]);
|
Player target = plugin.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Player.Invalid"));
|
player.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -198,7 +198,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
String targetName = target.getName();
|
String targetName = target.getName();
|
||||||
|
|
||||||
if (!partyInstance.inSameParty(player, (Player) target)) {
|
if (!partyInstance.inSameParty(player, (Player) target)) {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotInYourParty", new Object[] { targetName }));
|
player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", new Object[] { targetName }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -211,11 +211,11 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
partyInstance.removeFromParty(target, PPt);
|
partyInstance.removeFromParty(target, PPt);
|
||||||
target.sendMessage(mcLocale.getString("Commands.Party.Kick", new Object[] { partyName }));
|
target.sendMessage(LocaleLoader.getString("Commands.Party.Kick", new Object[] { partyName }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args[0].equalsIgnoreCase("owner")) {
|
else if (args[0].equalsIgnoreCase("owner")) {
|
||||||
@ -223,14 +223,14 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
Player target = plugin.getServer().getPlayer(args[1]);
|
Player target = plugin.getServer().getPlayer(args[1]);
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Player.Invalid"));
|
player.sendMessage(LocaleLoader.getString("Party.Player.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
String targetName = target.getName();
|
String targetName = target.getName();
|
||||||
|
|
||||||
if (!partyInstance.inSameParty(player, (Player) target)) {
|
if (!partyInstance.inSameParty(player, (Player) target)) {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotInYourParty", new Object[] { targetName }));
|
player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", new Object[] { targetName }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -239,7 +239,7 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
player.sendMessage(LocaleLoader.getString("Party.NotOwner"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -268,9 +268,9 @@ public class PartyCommand implements CommandExecutor {
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.0"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.0"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.1"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.1"));
|
||||||
player.sendMessage(mcLocale.getString("Party.Help.2"));
|
player.sendMessage(LocaleLoader.getString("Party.Help.2"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,14 +6,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent;
|
import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class PtpCommand implements CommandExecutor {
|
public class PtpCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -40,12 +40,12 @@ public class PtpCommand implements CommandExecutor {
|
|||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
if (!Party.getInstance().isInParty(player, PP)) {
|
if (!Party.getInstance().isInParty(player, PP)) {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.None"));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.None"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getRecentlyHurt() + (Config.getInstance().getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) {
|
if (PP.getRecentlyHurt() + (Config.getInstance().getPTPCommandCooldown() * 1000) > System.currentTimeMillis()) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Teleport.Hurt", new Object[] { Config.getInstance().getPTPCommandCooldown() }));
|
player.sendMessage(LocaleLoader.getString("Party.Teleport.Hurt", new Object[] { Config.getInstance().getPTPCommandCooldown() }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -57,12 +57,12 @@ public class PtpCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (target == null) {
|
if (target == null) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Teleport.Invalid"));
|
player.sendMessage(LocaleLoader.getString("Party.Teleport.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (target.isDead()) {
|
if (target.isDead()) {
|
||||||
player.sendMessage(mcLocale.getString("Party.Teleport.Dead"));
|
player.sendMessage(LocaleLoader.getString("Party.Teleport.Dead"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -75,11 +75,11 @@ public class PtpCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.teleport(target);
|
player.teleport(target);
|
||||||
player.sendMessage(mcLocale.getString("Party.Teleport.Player", new Object[] { target.getName() }));
|
player.sendMessage(LocaleLoader.getString("Party.Teleport.Player", new Object[] { target.getName() }));
|
||||||
target.sendMessage(mcLocale.getString("Party.Teleport.Target", new Object[] { player.getName() }));
|
target.sendMessage(LocaleLoader.getString("Party.Teleport.Target", new Object[] { player.getName() }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Party.NotInYourParty", new Object[] { target.getName() }));
|
player.sendMessage(LocaleLoader.getString("Party.NotInYourParty", new Object[] { target.getName() }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class AcrobaticsCommand implements CommandExecutor {
|
public class AcrobaticsCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -40,40 +40,40 @@ public class AcrobaticsCommand implements CommandExecutor {
|
|||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
permissionsCheck(player);
|
permissionsCheck(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Acrobatics.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Acrobatics.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Acrobatics") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Acrobatics") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS) }));
|
||||||
|
|
||||||
if (canDodge || canGracefulRoll || canRoll) {
|
if (canDodge || canGracefulRoll || canRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canRoll) {
|
if (canRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Acrobatics.Effect.0"), mcLocale.getString("Acrobatics.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.0"), LocaleLoader.getString("Acrobatics.Effect.1") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canGracefulRoll) {
|
if (canGracefulRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Acrobatics.Effect.2"), mcLocale.getString("Acrobatics.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.2"), LocaleLoader.getString("Acrobatics.Effect.3") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canDodge) {
|
if (canDodge) {
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Acrobatics.Effect.4"), mcLocale.getString("Acrobatics.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Acrobatics.Effect.4"), LocaleLoader.getString("Acrobatics.Effect.5") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canDodge || canGracefulRoll || canRoll) {
|
if (canDodge || canGracefulRoll || canRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canRoll) {
|
if (canRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Chance", new Object[] { rollChance }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canGracefulRoll) {
|
if (canGracefulRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.GraceChance", new Object[] { gracefulRollChance }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (canDodge) {
|
if (canDodge) {
|
||||||
player.sendMessage(mcLocale.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.DodgeChance", new Object[] { dodgeChance }));
|
||||||
}
|
}
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.ACROBATICS, player, args);
|
Page.grabGuidePageForSkill(SkillType.ACROBATICS, player, args);
|
||||||
@ -105,7 +105,7 @@ public class AcrobaticsCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void permissionsCheck(Player player) {
|
private void permissionsCheck(Player player) {
|
||||||
mcPermissions permInstance = mcPermissions.getInstance();
|
Permissions permInstance = Permissions.getInstance();
|
||||||
canDodge = permInstance.dodge(player);
|
canDodge = permInstance.dodge(player);
|
||||||
canRoll = permInstance.roll(player);
|
canRoll = permInstance.roll(player);
|
||||||
canGracefulRoll = permInstance.gracefulRoll(player);
|
canGracefulRoll = permInstance.gracefulRoll(player);
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class ArcheryCommand implements CommandExecutor {
|
public class ArcheryCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -34,19 +34,19 @@ public class ArcheryCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.ARCHERY);
|
skillValue = (float) PP.getSkillLevel(SkillType.ARCHERY);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Archery.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Archery.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Archery") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Archery") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.ARCHERY), PP.getSkillXpLevel(SkillType.ARCHERY), PP.getXpToLevel(SkillType.ARCHERY) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Archery.Effect.0"), mcLocale.getString("Archery.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.0"), LocaleLoader.getString("Archery.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Archery.Effect.2"), mcLocale.getString("Archery.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.2"), LocaleLoader.getString("Archery.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Archery.Effect.4"), mcLocale.getString("Archery.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Archery.Effect.4"), LocaleLoader.getString("Archery.Effect.5") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Archery.Combat.SkillshotBonus", new Object[] { skillShotBonus }));
|
player.sendMessage(LocaleLoader.getString("Archery.Combat.SkillshotBonus", new Object[] { skillShotBonus }));
|
||||||
player.sendMessage(mcLocale.getString("Archery.Combat.DazeChance", new Object[] { dazeChance }));
|
player.sendMessage(LocaleLoader.getString("Archery.Combat.DazeChance", new Object[] { dazeChance }));
|
||||||
player.sendMessage(mcLocale.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance }));
|
player.sendMessage(LocaleLoader.getString("Archery.Combat.RetrieveChance", new Object[] { retrieveChance }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.ARCHERY, player, args);
|
Page.grabGuidePageForSkill(SkillType.ARCHERY, player, args);
|
||||||
|
|
||||||
|
@ -5,11 +5,11 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class AxesCommand implements CommandExecutor {
|
public class AxesCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -35,23 +35,23 @@ public class AxesCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.AXES);
|
skillValue = (float) PP.getSkillLevel(SkillType.AXES);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Axes.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Axes.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Axes") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Axes") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Axes.Effect.0"), mcLocale.getString("Axes.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.0"), LocaleLoader.getString("Axes.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Axes.Effect.2"), mcLocale.getString("Axes.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.2"), LocaleLoader.getString("Axes.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Axes.Effect.4"), mcLocale.getString("Axes.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.4"), LocaleLoader.getString("Axes.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Axes.Effect.6"), mcLocale.getString("Axes.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.6"), LocaleLoader.getString("Axes.Effect.7") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Axes.Effect.8"), mcLocale.getString("Axes.Effect.9") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Axes.Effect.8"), LocaleLoader.getString("Axes.Effect.9") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Axes.Combat.CritChance", new Object[] { critChance }));
|
player.sendMessage(LocaleLoader.getString("Axes.Combat.CritChance", new Object[] { critChance }));
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Axes.Ability.Bonus.0"), mcLocale.getString("Axes.Ability.Bonus.1", new Object[] {bonusDamage}) }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Axes.Ability.Bonus.0"), LocaleLoader.getString("Axes.Ability.Bonus.1", new Object[] {bonusDamage}) }));
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Axes.Ability.Bonus.2"), mcLocale.getString("Axes.Ability.Bonus.3", new Object[] {impactDamage}) }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Axes.Ability.Bonus.2"), LocaleLoader.getString("Axes.Ability.Bonus.3", new Object[] {impactDamage}) }));
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Axes.Ability.Bonus.4"), mcLocale.getString("Axes.Ability.Bonus.5", new Object[] {greaterImpactDamage}) }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Axes.Ability.Bonus.4"), LocaleLoader.getString("Axes.Ability.Bonus.5", new Object[] {greaterImpactDamage}) }));
|
||||||
player.sendMessage(mcLocale.getString("Axes.Combat.SS.Length", new Object[] { skullSplitterLength }));
|
player.sendMessage(LocaleLoader.getString("Axes.Combat.SS.Length", new Object[] { skullSplitterLength }));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class ExcavationCommand implements CommandExecutor {
|
public class ExcavationCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -32,16 +32,16 @@ public class ExcavationCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.EXCAVATION);
|
skillValue = (float) PP.getSkillLevel(SkillType.EXCAVATION);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Excavation.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Excavation.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Excavation") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Excavation") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Excavation.Effect.0"), mcLocale.getString("Excavation.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.0"), LocaleLoader.getString("Excavation.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Excavation.Effect.2"), mcLocale.getString("Excavation.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Excavation.Effect.2"), LocaleLoader.getString("Excavation.Effect.3") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }));
|
player.sendMessage(LocaleLoader.getString("Excavation.Effect.Length", new Object[] { gigaDrillBreakerLength }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args);
|
Page.grabGuidePageForSkill(SkillType.EXCAVATION, player, args);
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Fishing;
|
import com.gmail.nossr50.skills.Fishing;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class FishingCommand implements CommandExecutor {
|
public class FishingCommand implements CommandExecutor {
|
||||||
@Override
|
@Override
|
||||||
@ -27,25 +27,25 @@ public class FishingCommand implements CommandExecutor {
|
|||||||
Player player = (Player) sender;
|
Player player = (Player) sender;
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Fishing.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Fishing.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Fishing") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Fishing") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.FISHING), PP.getSkillXpLevel(SkillType.FISHING), PP.getXpToLevel(SkillType.FISHING) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.0"), mcLocale.getString("Fishing.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Fishing.Effect.0"), LocaleLoader.getString("Fishing.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.2"), mcLocale.getString("Fishing.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Fishing.Effect.2"), LocaleLoader.getString("Fishing.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Fishing.Effect.4"), mcLocale.getString("Fishing.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Fishing.Effect.4"), LocaleLoader.getString("Fishing.Effect.5") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Fishing.Ability.Rank", new Object[] { Fishing.getFishingLootTier(PP) }));
|
player.sendMessage(LocaleLoader.getString("Fishing.Ability.Rank", new Object[] { Fishing.getFishingLootTier(PP) }));
|
||||||
player.sendMessage(mcLocale.getString("Fishing.Ability.Info"));
|
player.sendMessage(LocaleLoader.getString("Fishing.Ability.Info"));
|
||||||
|
|
||||||
//TODO: Do we really need to display this twice? Not like there are any associated stats.
|
//TODO: Do we really need to display this twice? Not like there are any associated stats.
|
||||||
if (PP.getSkillLevel(SkillType.FISHING) < 150) {
|
if (PP.getSkillLevel(SkillType.FISHING) < 150) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Fishing.Ability.Locked.0") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Fishing.Ability.Locked.0") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Fishing.Ability.Shake"));
|
player.sendMessage(LocaleLoader.getString("Fishing.Ability.Shake"));
|
||||||
}
|
}
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.FISHING, player, args);
|
Page.grabGuidePageForSkill(SkillType.FISHING, player, args);
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class HerbalismCommand implements CommandExecutor {
|
public class HerbalismCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -36,23 +36,23 @@ public class HerbalismCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.HERBALISM);
|
skillValue = (float) PP.getSkillLevel(SkillType.HERBALISM);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Herbalism.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Herbalism.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Herbalism") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Herbalism") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.HERBALISM), PP.getSkillXpLevel(SkillType.HERBALISM), PP.getXpToLevel(SkillType.HERBALISM) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.0"), mcLocale.getString("Herbalism.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Herbalism.Effect.0"), LocaleLoader.getString("Herbalism.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.2"), mcLocale.getString("Herbalism.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Herbalism.Effect.2"), LocaleLoader.getString("Herbalism.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.4"), mcLocale.getString("Herbalism.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Herbalism.Effect.4"), LocaleLoader.getString("Herbalism.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.6"), mcLocale.getString("Herbalism.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Herbalism.Effect.6"), LocaleLoader.getString("Herbalism.Effect.7") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Herbalism.Effect.8"), mcLocale.getString("Herbalism.Effect.9") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Herbalism.Effect.8"), LocaleLoader.getString("Herbalism.Effect.9") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Herbalism.Ability.GTe.Length", new Object[] { greenTerraLength }));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.GTe.Length", new Object[] { greenTerraLength }));
|
||||||
player.sendMessage(mcLocale.getString("Herbalism.Ability.GTh.Chance", new Object[] { greenThumbChance }));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.GTh.Chance", new Object[] { greenThumbChance }));
|
||||||
player.sendMessage(mcLocale.getString("Herbalism.Ability.GTh.Stage", new Object[] { greenThumbStage }));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.GTh.Stage", new Object[] { greenThumbStage }));
|
||||||
player.sendMessage(mcLocale.getString("Herbalism.Ability.FD", new Object[] { farmersDietRank } ));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.FD", new Object[] { farmersDietRank } ));
|
||||||
player.sendMessage(mcLocale.getString("Herbalism.Ability.DoubleDropChance", new Object[] { doubleDropChance }));
|
player.sendMessage(LocaleLoader.getString("Herbalism.Ability.DoubleDropChance", new Object[] { doubleDropChance }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.HERBALISM, player, args);
|
Page.grabGuidePageForSkill(SkillType.HERBALISM, player, args);
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class MiningCommand implements CommandExecutor {
|
public class MiningCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -36,40 +36,40 @@ public class MiningCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.MINING);
|
skillValue = (float) PP.getSkillLevel(SkillType.MINING);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Mining.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Mining.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Mining") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Mining") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.MINING), PP.getSkillXpLevel(SkillType.MINING), PP.getXpToLevel(SkillType.MINING) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Mining.Effect.0"), mcLocale.getString("Mining.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Mining.Effect.0"), LocaleLoader.getString("Mining.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Mining.Effect.2"), mcLocale.getString("Mining.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Mining.Effect.2"), LocaleLoader.getString("Mining.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Mining.Effect.4"), mcLocale.getString("Mining.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Mining.Effect.4"), LocaleLoader.getString("Mining.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Mining.Effect.6"), mcLocale.getString("Mining.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Mining.Effect.6"), LocaleLoader.getString("Mining.Effect.7") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Mining.Effect.8"), mcLocale.getString("Mining.Effect.9") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Mining.Effect.8"), LocaleLoader.getString("Mining.Effect.9") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Mining.Effect.DropChance", new Object[] { doubleDropChance }));
|
player.sendMessage(LocaleLoader.getString("Mining.Effect.DropChance", new Object[] { doubleDropChance }));
|
||||||
player.sendMessage(mcLocale.getString("Mining.Ability.Length", new Object[] { superBreakerLength }));
|
player.sendMessage(LocaleLoader.getString("Mining.Ability.Length", new Object[] { superBreakerLength }));
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.MINING) < 125) {
|
if (PP.getSkillLevel(SkillType.MINING) < 125) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Mining.Ability.Locked.0") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Mining.Ability.Locked.0") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Mining.Blast.Rank", new Object[] { blastMiningRank, mcLocale.getString("Mining.Blast.Effect." + (blastMiningRank - 1)) }));
|
player.sendMessage(LocaleLoader.getString("Mining.Blast.Rank", new Object[] { blastMiningRank, LocaleLoader.getString("Mining.Blast.Effect." + (blastMiningRank - 1)) }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.MINING) < 250) {
|
if (PP.getSkillLevel(SkillType.MINING) < 250) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Mining.Ability.Locked.1") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Mining.Ability.Locked.1") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("m.MiningBiggerBombs", new Object[] { blastRadiusIncrease }));
|
player.sendMessage(LocaleLoader.getString("m.MiningBiggerBombs", new Object[] { blastRadiusIncrease }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.MINING) < 500) {
|
if (PP.getSkillLevel(SkillType.MINING) < 500) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Mining.Ability.Locked.2") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Mining.Ability.Locked.2") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("m.MiningDemolitionsExpertDamageDecrease", new Object[] { blastDamageDecrease }));
|
player.sendMessage(LocaleLoader.getString("m.MiningDemolitionsExpertDamageDecrease", new Object[] { blastDamageDecrease }));
|
||||||
}
|
}
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.MINING, player, args);
|
Page.grabGuidePageForSkill(SkillType.MINING, player, args);
|
||||||
|
@ -5,14 +5,14 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Repair;
|
import com.gmail.nossr50.skills.Repair;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class RepairCommand implements CommandExecutor {
|
public class RepairCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -37,23 +37,23 @@ public class RepairCommand implements CommandExecutor {
|
|||||||
|
|
||||||
int arcaneForgingRank = Repair.getArcaneForgingRank(PP);
|
int arcaneForgingRank = Repair.getArcaneForgingRank(PP);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Repair.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Repair.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Repair") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Repair") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.REPAIR), PP.getSkillXpLevel(SkillType.REPAIR), PP.getXpToLevel(SkillType.REPAIR) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.0"), mcLocale.getString("Repair.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.0"), LocaleLoader.getString("Repair.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.2"), mcLocale.getString("Repair.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.2"), LocaleLoader.getString("Repair.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.4"), mcLocale.getString("Repair.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.4"), LocaleLoader.getString("Repair.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.6", new Object[] { Config.getInstance().getRepairDiamondLevelRequirement() }), mcLocale.getString("Repair.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.6", new Object[] { Config.getInstance().getRepairDiamondLevelRequirement() }), LocaleLoader.getString("Repair.Effect.7") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Repair.Effect.8"), mcLocale.getString("Repair.Effect.9") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Repair.Effect.8"), LocaleLoader.getString("Repair.Effect.9") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.Mastery", new Object[] { repairMasteryBonus }));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.Mastery", new Object[] { repairMasteryBonus }));
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.Super.Chance", new Object[] { superRepairChance }));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.Super.Chance", new Object[] { superRepairChance }));
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Rank", new Object[] { arcaneForgingRank }));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Rank", new Object[] { arcaneForgingRank }));
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Chance.Success", new Object[] { Repair.getEnchantChance(arcaneForgingRank) }));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Success", new Object[] { Repair.getEnchantChance(arcaneForgingRank) }));
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Chance.Downgrade", new Object[] { Repair.getDowngradeChance(arcaneForgingRank) }));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Chance.Downgrade", new Object[] { Repair.getDowngradeChance(arcaneForgingRank) }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.REPAIR, player, args);
|
Page.grabGuidePageForSkill(SkillType.REPAIR, player, args);
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SwordsCommand implements CommandExecutor {
|
public class SwordsCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -35,22 +35,22 @@ public class SwordsCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.SWORDS);
|
skillValue = (float) PP.getSkillLevel(SkillType.SWORDS);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Swords.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Swords.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Swords") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Swords") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.SWORDS), PP.getSkillXpLevel(SkillType.SWORDS), PP.getXpToLevel(SkillType.SWORDS) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Swords.Effect.0"), mcLocale.getString("Swords.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.0"), LocaleLoader.getString("Swords.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Swords.Effect.2"), mcLocale.getString("Swords.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.2"), LocaleLoader.getString("Swords.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Swords.Effect.4"), mcLocale.getString("Swords.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.4"), LocaleLoader.getString("Swords.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Swords.Effect.6"), mcLocale.getString("Swords.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Swords.Effect.6"), LocaleLoader.getString("Swords.Effect.7") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Chance", new Object[] { counterAttackChance }));
|
||||||
player.sendMessage(mcLocale.getString("Swords.Combat.Bleed.Length", new Object[] { bleedLength }));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Length", new Object[] { bleedLength }));
|
||||||
player.sendMessage(mcLocale.getString("Swords.Combat.Bleed.Note"));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Note"));
|
||||||
player.sendMessage(mcLocale.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleed.Chance", new Object[] { bleedChance }));
|
||||||
player.sendMessage(mcLocale.getString("Swords.SS.Length", new Object[] { serratedStrikesLength }));
|
player.sendMessage(LocaleLoader.getString("Swords.SS.Length", new Object[] { serratedStrikesLength }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.SWORDS, player, args);
|
Page.grabGuidePageForSkill(SkillType.SWORDS, player, args);
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class TamingCommand implements CommandExecutor {
|
public class TamingCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -33,60 +33,60 @@ public class TamingCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.TAMING);
|
skillValue = (float) PP.getSkillLevel(SkillType.TAMING);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Taming.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Taming.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Taming") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Taming") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.TAMING), PP.getSkillXpLevel(SkillType.TAMING), PP.getXpToLevel(SkillType.TAMING) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.0"), mcLocale.getString("Taming.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.0"), LocaleLoader.getString("Taming.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.2"), mcLocale.getString("Taming.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.2"), LocaleLoader.getString("Taming.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.4"), mcLocale.getString("Taming.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.4"), LocaleLoader.getString("Taming.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.6"), mcLocale.getString("Taming.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.6"), LocaleLoader.getString("Taming.Effect.7") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.8"), mcLocale.getString("Taming.Effect.9") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.8"), LocaleLoader.getString("Taming.Effect.9") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.10"), mcLocale.getString("Taming.Effect.11") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.10"), LocaleLoader.getString("Taming.Effect.11") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.12"), mcLocale.getString("Taming.Effect.13") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.12"), LocaleLoader.getString("Taming.Effect.13") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Taming.Effect.16"), mcLocale.getString("Taming.Effect.17") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Taming.Effect.16"), LocaleLoader.getString("Taming.Effect.17") }));
|
||||||
player.sendMessage(mcLocale.getString("Taming.Effect.14", new Object[] { Config.getInstance().getTamingCOTWOcelotCost() }));
|
player.sendMessage(LocaleLoader.getString("Taming.Effect.14", new Object[] { Config.getInstance().getTamingCOTWOcelotCost() }));
|
||||||
player.sendMessage(mcLocale.getString("Taming.Effect.15", new Object[] { Config.getInstance().getTamingCOTWWolfCost() }));
|
player.sendMessage(LocaleLoader.getString("Taming.Effect.15", new Object[] { Config.getInstance().getTamingCOTWWolfCost() }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.TAMING) < 100) {
|
if (PP.getSkillLevel(SkillType.TAMING) < 100) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Taming.Ability.Locked.0") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.0") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Taming.Ability.Bonus.0"), mcLocale.getString("Taming.Ability.Bonus.1") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.0"), LocaleLoader.getString("Taming.Ability.Bonus.1") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.TAMING) < 250) {
|
if (PP.getSkillLevel(SkillType.TAMING) < 250) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Taming.Ability.Locked.1") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.1") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Taming.Ability.Bonus.2"), mcLocale.getString("Taming.Ability.Bonus.3") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.2"), LocaleLoader.getString("Taming.Ability.Bonus.3") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.TAMING) < 500) {
|
if (PP.getSkillLevel(SkillType.TAMING) < 500) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Taming.Ability.Locked.2") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.2") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Taming.Ability.Bonus.4"), mcLocale.getString("Taming.Ability.Bonus.5") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.4"), LocaleLoader.getString("Taming.Ability.Bonus.5") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.TAMING) < 750) {
|
if (PP.getSkillLevel(SkillType.TAMING) < 750) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Taming.Ability.Locked.3") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.3") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Taming.Ability.Bonus.6"), mcLocale.getString("Taming.Ability.Bonus.7") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.6"), LocaleLoader.getString("Taming.Ability.Bonus.7") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.TAMING) < 50) {
|
if (PP.getSkillLevel(SkillType.TAMING) < 50) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Taming.Ability.Locked.4") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Taming.Ability.Locked.4") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Taming.Ability.Bonus.8"), mcLocale.getString("Taming.Ability.Bonus.9 ") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Taming.Ability.Bonus.8"), LocaleLoader.getString("Taming.Ability.Bonus.9 ") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }));
|
player.sendMessage(LocaleLoader.getString("Taming.Combat.Chance.Gore", new Object[] { goreChance }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.TAMING, player, args);
|
Page.grabGuidePageForSkill(SkillType.TAMING, player, args);
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class UnarmedCommand implements CommandExecutor {
|
public class UnarmedCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -35,21 +35,21 @@ public class UnarmedCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.UNARMED);
|
skillValue = (float) PP.getSkillLevel(SkillType.UNARMED);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Unarmed.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Unarmed.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.Unarmed") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.Unarmed") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.UNARMED), PP.getSkillXpLevel(SkillType.UNARMED), PP.getXpToLevel(SkillType.UNARMED) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Unarmed.Effect.0"), mcLocale.getString("Unarmed.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Unarmed.Effect.0"), LocaleLoader.getString("Unarmed.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Unarmed.Effect.2"), mcLocale.getString("Unarmed.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Unarmed.Effect.2"), LocaleLoader.getString("Unarmed.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Unarmed.Effect.4"), mcLocale.getString("Unarmed.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Unarmed.Effect.4"), LocaleLoader.getString("Unarmed.Effect.5") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Unarmed.Effect.6"), mcLocale.getString("Unarmed.Effect.7") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Unarmed.Effect.6"), LocaleLoader.getString("Unarmed.Effect.7") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Unarmed.Ability.Bonus.0"), mcLocale.getString("Unarmed.Ability.Bonus.1", new Object[] {ironArmBonus}) }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Unarmed.Ability.Bonus.0"), LocaleLoader.getString("Unarmed.Ability.Bonus.1", new Object[] {ironArmBonus}) }));
|
||||||
player.sendMessage(mcLocale.getString("Unarmed.Ability.Chance.ArrowDeflect", new Object[] { deflectChance }));
|
player.sendMessage(LocaleLoader.getString("Unarmed.Ability.Chance.ArrowDeflect", new Object[] { deflectChance }));
|
||||||
player.sendMessage(mcLocale.getString("Unarmed.Ability.Chance.Disarm", new Object[] { disarmChance }));
|
player.sendMessage(LocaleLoader.getString("Unarmed.Ability.Chance.Disarm", new Object[] { disarmChance }));
|
||||||
player.sendMessage(mcLocale.getString("Unarmed.Ability.Berserk.Length", new Object[] { berserkLength }));
|
player.sendMessage(LocaleLoader.getString("Unarmed.Ability.Berserk.Length", new Object[] { berserkLength }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.UNARMED, player, args);
|
Page.grabGuidePageForSkill(SkillType.UNARMED, player, args);
|
||||||
|
|
||||||
|
@ -5,12 +5,12 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.util.Page;
|
import com.gmail.nossr50.util.Page;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class WoodcuttingCommand implements CommandExecutor {
|
public class WoodcuttingCommand implements CommandExecutor {
|
||||||
private float skillValue;
|
private float skillValue;
|
||||||
@ -33,26 +33,26 @@ public class WoodcuttingCommand implements CommandExecutor {
|
|||||||
skillValue = (float) PP.getSkillLevel(SkillType.UNARMED);
|
skillValue = (float) PP.getSkillLevel(SkillType.UNARMED);
|
||||||
dataCalculations(skillValue);
|
dataCalculations(skillValue);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("WoodCutting.SkillName") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("WoodCutting.SkillName") }));
|
||||||
player.sendMessage(mcLocale.getString("Commands.XPGain", new Object[] { mcLocale.getString("Commands.XPGain.WoodCutting") }));
|
player.sendMessage(LocaleLoader.getString("Commands.XPGain", new Object[] { LocaleLoader.getString("Commands.XPGain.WoodCutting") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
player.sendMessage(LocaleLoader.getString("Effects.Level", new Object[] { PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING) }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Effects.Effects") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Effects.Effects") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Woodcutting.Effect.0"), mcLocale.getString("Woodcutting.Effect.1") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Woodcutting.Effect.0"), LocaleLoader.getString("Woodcutting.Effect.1") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Woodcutting.Effect.2"), mcLocale.getString("Woodcutting.Effect.3") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Woodcutting.Effect.2"), LocaleLoader.getString("Woodcutting.Effect.3") }));
|
||||||
player.sendMessage(mcLocale.getString("Effects.Template", new Object[] { mcLocale.getString("Woodcutting.Effect.4"), mcLocale.getString("Woodcutting.Effect.5") }));
|
player.sendMessage(LocaleLoader.getString("Effects.Template", new Object[] { LocaleLoader.getString("Woodcutting.Effect.4"), LocaleLoader.getString("Woodcutting.Effect.5") }));
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Skills.Header", new Object[] { mcLocale.getString("Commands.Stats.Self") }));
|
player.sendMessage(LocaleLoader.getString("Skills.Header", new Object[] { LocaleLoader.getString("Commands.Stats.Self") }));
|
||||||
|
|
||||||
if (PP.getSkillLevel(SkillType.WOODCUTTING) < 100) {
|
if (PP.getSkillLevel(SkillType.WOODCUTTING) < 100) {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template.Lock", new Object[] { mcLocale.getString("Woodcutting.Ability.Locked.0") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template.Lock", new Object[] { LocaleLoader.getString("Woodcutting.Ability.Locked.0") }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Ability.Generic.Template", new Object[] { mcLocale.getString("Woodcutting.Ability.0"), mcLocale.getString("Woodcutting.Ability.1") }));
|
player.sendMessage(LocaleLoader.getString("Ability.Generic.Template", new Object[] { LocaleLoader.getString("Woodcutting.Ability.0"), LocaleLoader.getString("Woodcutting.Ability.1") }));
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Woodcutting.Ability.Chance.DDrop", new Object[] { doubleDropChance }));
|
player.sendMessage(LocaleLoader.getString("Woodcutting.Ability.Chance.DDrop", new Object[] { doubleDropChance }));
|
||||||
player.sendMessage(mcLocale.getString("Woodcutting.Ability.Length", new Object[] { treeFellerLength }));
|
player.sendMessage(LocaleLoader.getString("Woodcutting.Ability.Length", new Object[] { treeFellerLength }));
|
||||||
|
|
||||||
Page.grabGuidePageForSkill(SkillType.WOODCUTTING, player, args);
|
Page.grabGuidePageForSkill(SkillType.WOODCUTTING, player, args);
|
||||||
|
|
||||||
|
@ -6,15 +6,15 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.HUDType;
|
import com.gmail.nossr50.datatypes.HUDType;
|
||||||
import com.gmail.nossr50.datatypes.HUDmmo;
|
import com.gmail.nossr50.datatypes.HUDmmo;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class MchudCommand implements CommandExecutor {
|
public class MchudCommand implements CommandExecutor {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -33,7 +33,7 @@ public class MchudCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled()) {
|
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Disabled"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,16 +6,16 @@ import org.bukkit.command.CommandExecutor;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.CommandHelper;
|
import com.gmail.nossr50.commands.CommandHelper;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class XplockCommand implements CommandExecutor {
|
public class XplockCommand implements CommandExecutor {
|
||||||
@Override
|
@Override
|
||||||
@ -27,7 +27,7 @@ public class XplockCommand implements CommandExecutor {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
|
if (!Config.getInstance().spoutEnabled || !Config.getInstance().getSpoutXPBarEnabled() || !Config.getInstance().getCommandXPLockEnabled()) {
|
||||||
sender.sendMessage(mcLocale.getString("Commands.Disabled"));
|
sender.sendMessage(LocaleLoader.getString("Commands.Disabled"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ public class XplockCommand implements CommandExecutor {
|
|||||||
case 0:
|
case 0:
|
||||||
if (PP.getXpBarLocked()) {
|
if (PP.getXpBarLocked()) {
|
||||||
PP.toggleXpBarLocked();
|
PP.toggleXpBarLocked();
|
||||||
player.sendMessage(mcLocale.getString("Commands.xplock.unlocked"));
|
player.sendMessage(LocaleLoader.getString("Commands.xplock.unlocked"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,27 +47,27 @@ public class XplockCommand implements CommandExecutor {
|
|||||||
if (lastGained != null) {
|
if (lastGained != null) {
|
||||||
PP.toggleXpBarLocked();
|
PP.toggleXpBarLocked();
|
||||||
PP.setSkillLock(lastGained);
|
PP.setSkillLock(lastGained);
|
||||||
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] { m.getCapitalized(lastGained.toString()) }));
|
player.sendMessage(LocaleLoader.getString("Commands.xplock.locked", new Object[] { Misc.getCapitalized(lastGained.toString()) }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
case 1:
|
case 1:
|
||||||
if (Skills.isSkill(args[0])) {
|
if (Skills.isSkill(args[0])) {
|
||||||
if (mcPermissions.getInstance().permission(player, "mcmmo.skills." + args[0].toLowerCase())) {
|
if (Permissions.getInstance().permission(player, "mcmmo.skills." + args[0].toLowerCase())) {
|
||||||
PP.setXpBarLocked(true);
|
PP.setXpBarLocked(true);
|
||||||
PP.setSkillLock(Skills.getSkillType(args[0]));
|
PP.setSkillLock(Skills.getSkillType(args[0]));
|
||||||
SpoutStuff.updateXpBar(player);
|
SpoutStuff.updateXpBar(player);
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Commands.xplock.locked", new Object[] { m.getCapitalized(args[0]) }));
|
player.sendMessage(LocaleLoader.getString("Commands.xplock.locked", new Object[] { Misc.getCapitalized(args[0]) }));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.NoPermission"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.NoPermission"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Skill.Invalid"));
|
player.sendMessage(LocaleLoader.getString("Commands.Skill.Invalid"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3,12 +3,12 @@ package com.gmail.nossr50.datatypes;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Excavation;
|
import com.gmail.nossr50.skills.Excavation;
|
||||||
import com.gmail.nossr50.skills.Herbalism;
|
import com.gmail.nossr50.skills.Herbalism;
|
||||||
import com.gmail.nossr50.skills.Mining;
|
import com.gmail.nossr50.skills.Mining;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
|
||||||
public enum AbilityType {
|
public enum AbilityType {
|
||||||
BERSERK(
|
BERSERK(
|
||||||
@ -104,23 +104,23 @@ public enum AbilityType {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityOn() {
|
public String getAbilityOn() {
|
||||||
return mcLocale.getString(this.abilityOn);
|
return LocaleLoader.getString(this.abilityOn);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityOff() {
|
public String getAbilityOff() {
|
||||||
return mcLocale.getString(this.abilityOff);
|
return LocaleLoader.getString(this.abilityOff);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityPlayer(Player player) {
|
public String getAbilityPlayer(Player player) {
|
||||||
return mcLocale.getString(this.abilityPlayer, new Object[] {player.getName()});
|
return LocaleLoader.getString(this.abilityPlayer, new Object[] {player.getName()});
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityPlayerOff(Player player) {
|
public String getAbilityPlayerOff(Player player) {
|
||||||
return mcLocale.getString(this.abilityPlayerOff, new Object[] {player.getName()});
|
return LocaleLoader.getString(this.abilityPlayerOff, new Object[] {player.getName()});
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAbilityRefresh() {
|
public String getAbilityRefresh() {
|
||||||
return mcLocale.getString(this.abilityRefresh);
|
return LocaleLoader.getString(this.abilityRefresh);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -132,31 +132,31 @@ public enum AbilityType {
|
|||||||
public boolean getPermissions(Player player) {
|
public boolean getPermissions(Player player) {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case BERSERK:
|
case BERSERK:
|
||||||
return mcPermissions.getInstance().berserk(player);
|
return Permissions.getInstance().berserk(player);
|
||||||
|
|
||||||
case BLAST_MINING:
|
case BLAST_MINING:
|
||||||
return mcPermissions.getInstance().blastMining(player);
|
return Permissions.getInstance().blastMining(player);
|
||||||
|
|
||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
return mcPermissions.getInstance().gigaDrillBreaker(player);
|
return Permissions.getInstance().gigaDrillBreaker(player);
|
||||||
|
|
||||||
case GREEN_TERRA:
|
case GREEN_TERRA:
|
||||||
return mcPermissions.getInstance().greenTerra(player);
|
return Permissions.getInstance().greenTerra(player);
|
||||||
|
|
||||||
case LEAF_BLOWER:
|
case LEAF_BLOWER:
|
||||||
return mcPermissions.getInstance().leafBlower(player);
|
return Permissions.getInstance().leafBlower(player);
|
||||||
|
|
||||||
case SERRATED_STRIKES:
|
case SERRATED_STRIKES:
|
||||||
return mcPermissions.getInstance().serratedStrikes(player);
|
return Permissions.getInstance().serratedStrikes(player);
|
||||||
|
|
||||||
case SKULL_SPLIITER:
|
case SKULL_SPLIITER:
|
||||||
return mcPermissions.getInstance().skullSplitter(player);
|
return Permissions.getInstance().skullSplitter(player);
|
||||||
|
|
||||||
case SUPER_BREAKER:
|
case SUPER_BREAKER:
|
||||||
return mcPermissions.getInstance().superBreaker(player);
|
return Permissions.getInstance().superBreaker(player);
|
||||||
|
|
||||||
case TREE_FELLER:
|
case TREE_FELLER:
|
||||||
return mcPermissions.getInstance().treeFeller(player);
|
return Permissions.getInstance().treeFeller(player);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -9,11 +9,11 @@ import org.getspout.spoutapi.gui.RenderPriority;
|
|||||||
import org.getspout.spoutapi.gui.Widget;
|
import org.getspout.spoutapi.gui.Widget;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class HUDmmo {
|
public class HUDmmo {
|
||||||
private int center_x = 427 / 2;
|
private int center_x = 427 / 2;
|
||||||
@ -286,7 +286,7 @@ public class HUDmmo {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
((GenericTexture) xpicon).setUrl(m.getCapitalized(theType.toString()) + ".png");
|
((GenericTexture) xpicon).setUrl(Misc.getCapitalized(theType.toString()) + ".png");
|
||||||
xpicon.setDirty(true);
|
xpicon.setDirty(true);
|
||||||
|
|
||||||
((GenericTexture) xpbar).setUrl(getUrlBar(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.STANDARD)));
|
((GenericTexture) xpbar).setUrl(getUrlBar(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.STANDARD)));
|
||||||
@ -314,7 +314,7 @@ public class HUDmmo {
|
|||||||
|
|
||||||
Color color = getRetroColor(theType);
|
Color color = getRetroColor(theType);
|
||||||
|
|
||||||
xpicon.setUrl(m.getCapitalized(theType.toString()) + "_r.png");
|
xpicon.setUrl(Misc.getCapitalized(theType.toString()) + "_r.png");
|
||||||
|
|
||||||
xpfill.setBottomColor(color);
|
xpfill.setBottomColor(color);
|
||||||
xpfill.setTopColor(color);
|
xpfill.setTopColor(color);
|
||||||
|
@ -13,8 +13,8 @@ import org.bukkit.entity.Player;
|
|||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
import com.gmail.nossr50.Users;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.m;
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
|
||||||
public class PlayerProfile {
|
public class PlayerProfile {
|
||||||
@ -205,53 +205,53 @@ public class PlayerProfile {
|
|||||||
if(!character[0].equals(playerName)){continue;}
|
if(!character[0].equals(playerName)){continue;}
|
||||||
|
|
||||||
//Get Mining
|
//Get Mining
|
||||||
if(character.length > 1 && m.isInt(character[1]))
|
if(character.length > 1 && Misc.isInt(character[1]))
|
||||||
skills.put(SkillType.MINING, Integer.valueOf(character[1]));
|
skills.put(SkillType.MINING, Integer.valueOf(character[1]));
|
||||||
//Party
|
//Party
|
||||||
if(character.length > 3)
|
if(character.length > 3)
|
||||||
party = character[3];
|
party = character[3];
|
||||||
//Mining XP
|
//Mining XP
|
||||||
if(character.length > 4 && m.isInt(character[4]))
|
if(character.length > 4 && Misc.isInt(character[4]))
|
||||||
skillsXp.put(SkillType.MINING, Integer.valueOf(character[4]));
|
skillsXp.put(SkillType.MINING, Integer.valueOf(character[4]));
|
||||||
if(character.length > 5 && m.isInt(character[5]))
|
if(character.length > 5 && Misc.isInt(character[5]))
|
||||||
skills.put(SkillType.WOODCUTTING, Integer.valueOf(character[5]));
|
skills.put(SkillType.WOODCUTTING, Integer.valueOf(character[5]));
|
||||||
if(character.length > 6 && m.isInt(character[6]))
|
if(character.length > 6 && Misc.isInt(character[6]))
|
||||||
skillsXp.put(SkillType.WOODCUTTING, Integer.valueOf(character[6]));
|
skillsXp.put(SkillType.WOODCUTTING, Integer.valueOf(character[6]));
|
||||||
if(character.length > 7 && m.isInt(character[7]))
|
if(character.length > 7 && Misc.isInt(character[7]))
|
||||||
skills.put(SkillType.REPAIR, Integer.valueOf(character[7]));
|
skills.put(SkillType.REPAIR, Integer.valueOf(character[7]));
|
||||||
if(character.length > 8 && m.isInt(character[8]))
|
if(character.length > 8 && Misc.isInt(character[8]))
|
||||||
skills.put(SkillType.UNARMED, Integer.valueOf(character[8]));
|
skills.put(SkillType.UNARMED, Integer.valueOf(character[8]));
|
||||||
if(character.length > 9 && m.isInt(character[9]))
|
if(character.length > 9 && Misc.isInt(character[9]))
|
||||||
skills.put(SkillType.HERBALISM, Integer.valueOf(character[9]));
|
skills.put(SkillType.HERBALISM, Integer.valueOf(character[9]));
|
||||||
if(character.length > 10 && m.isInt(character[10]))
|
if(character.length > 10 && Misc.isInt(character[10]))
|
||||||
skills.put(SkillType.EXCAVATION, Integer.valueOf(character[10]));
|
skills.put(SkillType.EXCAVATION, Integer.valueOf(character[10]));
|
||||||
if(character.length > 11 && m.isInt(character[11]))
|
if(character.length > 11 && Misc.isInt(character[11]))
|
||||||
skills.put(SkillType.ARCHERY, Integer.valueOf(character[11]));
|
skills.put(SkillType.ARCHERY, Integer.valueOf(character[11]));
|
||||||
if(character.length > 12 && m.isInt(character[12]))
|
if(character.length > 12 && Misc.isInt(character[12]))
|
||||||
skills.put(SkillType.SWORDS, Integer.valueOf(character[12]));
|
skills.put(SkillType.SWORDS, Integer.valueOf(character[12]));
|
||||||
if(character.length > 13 && m.isInt(character[13]))
|
if(character.length > 13 && Misc.isInt(character[13]))
|
||||||
skills.put(SkillType.AXES, Integer.valueOf(character[13]));
|
skills.put(SkillType.AXES, Integer.valueOf(character[13]));
|
||||||
if(character.length > 14 && m.isInt(character[14]))
|
if(character.length > 14 && Misc.isInt(character[14]))
|
||||||
skills.put(SkillType.ACROBATICS, Integer.valueOf(character[14]));
|
skills.put(SkillType.ACROBATICS, Integer.valueOf(character[14]));
|
||||||
if(character.length > 15 && m.isInt(character[15]))
|
if(character.length > 15 && Misc.isInt(character[15]))
|
||||||
skillsXp.put(SkillType.REPAIR, Integer.valueOf(character[15]));
|
skillsXp.put(SkillType.REPAIR, Integer.valueOf(character[15]));
|
||||||
if(character.length > 16 && m.isInt(character[16]))
|
if(character.length > 16 && Misc.isInt(character[16]))
|
||||||
skillsXp.put(SkillType.UNARMED, Integer.valueOf(character[16]));
|
skillsXp.put(SkillType.UNARMED, Integer.valueOf(character[16]));
|
||||||
if(character.length > 17 && m.isInt(character[17]))
|
if(character.length > 17 && Misc.isInt(character[17]))
|
||||||
skillsXp.put(SkillType.HERBALISM, Integer.valueOf(character[17]));
|
skillsXp.put(SkillType.HERBALISM, Integer.valueOf(character[17]));
|
||||||
if(character.length > 18 && m.isInt(character[18]))
|
if(character.length > 18 && Misc.isInt(character[18]))
|
||||||
skillsXp.put(SkillType.EXCAVATION, Integer.valueOf(character[18]));
|
skillsXp.put(SkillType.EXCAVATION, Integer.valueOf(character[18]));
|
||||||
if(character.length > 19 && m.isInt(character[19]))
|
if(character.length > 19 && Misc.isInt(character[19]))
|
||||||
skillsXp.put(SkillType.ARCHERY, Integer.valueOf(character[19]));
|
skillsXp.put(SkillType.ARCHERY, Integer.valueOf(character[19]));
|
||||||
if(character.length > 20 && m.isInt(character[20]))
|
if(character.length > 20 && Misc.isInt(character[20]))
|
||||||
skillsXp.put(SkillType.SWORDS, Integer.valueOf(character[20]));
|
skillsXp.put(SkillType.SWORDS, Integer.valueOf(character[20]));
|
||||||
if(character.length > 21 && m.isInt(character[21]))
|
if(character.length > 21 && Misc.isInt(character[21]))
|
||||||
skillsXp.put(SkillType.AXES, Integer.valueOf(character[21]));
|
skillsXp.put(SkillType.AXES, Integer.valueOf(character[21]));
|
||||||
if(character.length > 22 && m.isInt(character[22]))
|
if(character.length > 22 && Misc.isInt(character[22]))
|
||||||
skillsXp.put(SkillType.ACROBATICS, Integer.valueOf(character[22]));
|
skillsXp.put(SkillType.ACROBATICS, Integer.valueOf(character[22]));
|
||||||
if(character.length > 24 && m.isInt(character[24]))
|
if(character.length > 24 && Misc.isInt(character[24]))
|
||||||
skills.put(SkillType.TAMING, Integer.valueOf(character[24]));
|
skills.put(SkillType.TAMING, Integer.valueOf(character[24]));
|
||||||
if(character.length > 25 && m.isInt(character[25]))
|
if(character.length > 25 && Misc.isInt(character[25]))
|
||||||
skillsXp.put(SkillType.TAMING, Integer.valueOf(character[25]));
|
skillsXp.put(SkillType.TAMING, Integer.valueOf(character[25]));
|
||||||
if(character.length > 26)
|
if(character.length > 26)
|
||||||
skillsDATS.put(AbilityType.BERSERK, Integer.valueOf(character[26]));
|
skillsDATS.put(AbilityType.BERSERK, Integer.valueOf(character[26]));
|
||||||
@ -1176,7 +1176,7 @@ public class PlayerProfile {
|
|||||||
String memberName = x.getName();
|
String memberName = x.getName();
|
||||||
|
|
||||||
if (!memberName.equals(playerName) && Party.getInstance().isPartyLeader(memberName, getParty())) {
|
if (!memberName.equals(playerName) && Party.getInstance().isPartyLeader(memberName, getParty())) {
|
||||||
if (m.isNear(player.getLocation(), x.getLocation(), 25.0)) {
|
if (Misc.isNear(player.getLocation(), x.getLocation(), 25.0)) {
|
||||||
PlayerProfile PartyLeader = Users.getProfile(x);
|
PlayerProfile PartyLeader = Users.getProfile(x);
|
||||||
int leaderSkill = PartyLeader.getSkillLevel(skillType);
|
int leaderSkill = PartyLeader.getSkillLevel(skillType);
|
||||||
int playerSkill = getSkillLevel(skillType);
|
int playerSkill = getSkillLevel(skillType);
|
||||||
|
@ -2,9 +2,9 @@ package com.gmail.nossr50.datatypes;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public enum SkillType {
|
public enum SkillType {
|
||||||
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
ACROBATICS(Config.getInstance().getLevelCapAcrobatics(), Config.getInstance().getFormulaMultiplierAcrobatics()),
|
||||||
@ -75,40 +75,40 @@ public enum SkillType {
|
|||||||
public boolean getPermissions(Player player) {
|
public boolean getPermissions(Player player) {
|
||||||
switch (this) {
|
switch (this) {
|
||||||
case ACROBATICS:
|
case ACROBATICS:
|
||||||
return mcPermissions.getInstance().acrobatics(player);
|
return Permissions.getInstance().acrobatics(player);
|
||||||
|
|
||||||
case ARCHERY:
|
case ARCHERY:
|
||||||
return mcPermissions.getInstance().archery(player);
|
return Permissions.getInstance().archery(player);
|
||||||
|
|
||||||
case AXES:
|
case AXES:
|
||||||
return mcPermissions.getInstance().axes(player);
|
return Permissions.getInstance().axes(player);
|
||||||
|
|
||||||
case EXCAVATION:
|
case EXCAVATION:
|
||||||
return mcPermissions.getInstance().excavation(player);
|
return Permissions.getInstance().excavation(player);
|
||||||
|
|
||||||
case FISHING:
|
case FISHING:
|
||||||
return mcPermissions.getInstance().fishing(player);
|
return Permissions.getInstance().fishing(player);
|
||||||
|
|
||||||
case HERBALISM:
|
case HERBALISM:
|
||||||
return mcPermissions.getInstance().herbalism(player);
|
return Permissions.getInstance().herbalism(player);
|
||||||
|
|
||||||
case MINING:
|
case MINING:
|
||||||
return mcPermissions.getInstance().mining(player);
|
return Permissions.getInstance().mining(player);
|
||||||
|
|
||||||
case REPAIR:
|
case REPAIR:
|
||||||
return mcPermissions.getInstance().repair(player);
|
return Permissions.getInstance().repair(player);
|
||||||
|
|
||||||
case SWORDS:
|
case SWORDS:
|
||||||
return mcPermissions.getInstance().swords(player);
|
return Permissions.getInstance().swords(player);
|
||||||
|
|
||||||
case TAMING:
|
case TAMING:
|
||||||
return mcPermissions.getInstance().taming(player);
|
return Permissions.getInstance().taming(player);
|
||||||
|
|
||||||
case UNARMED:
|
case UNARMED:
|
||||||
return mcPermissions.getInstance().unarmed(player);
|
return Permissions.getInstance().unarmed(player);
|
||||||
|
|
||||||
case WOODCUTTING:
|
case WOODCUTTING:
|
||||||
return mcPermissions.getInstance().woodcutting(player);
|
return Permissions.getInstance().woodcutting(player);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
@ -3,16 +3,16 @@ package com.gmail.nossr50.datatypes;
|
|||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
|
||||||
public enum ToolType {
|
public enum ToolType {
|
||||||
AXE(mcLocale.getString("Axes.Ability.Lower"), mcLocale.getString("Axes.Ability.Ready")),
|
AXE(LocaleLoader.getString("Axes.Ability.Lower"), LocaleLoader.getString("Axes.Ability.Ready")),
|
||||||
FISTS(mcLocale.getString("Unarmed.Ability.Lower"), mcLocale.getString("Unarmed.Ability.Ready")),
|
FISTS(LocaleLoader.getString("Unarmed.Ability.Lower"), LocaleLoader.getString("Unarmed.Ability.Ready")),
|
||||||
HOE(mcLocale.getString("Herbalism.Ability.Lower"), mcLocale.getString("Herbalism.Ability.Ready")),
|
HOE(LocaleLoader.getString("Herbalism.Ability.Lower"), LocaleLoader.getString("Herbalism.Ability.Ready")),
|
||||||
PICKAXE(mcLocale.getString("Mining.Ability.Lower"), mcLocale.getString("Mining.Ability.Ready")),
|
PICKAXE(LocaleLoader.getString("Mining.Ability.Lower"), LocaleLoader.getString("Mining.Ability.Ready")),
|
||||||
SHOVEL(mcLocale.getString("Excavation.Ability.Lower"), mcLocale.getString("Excavation.Ability.Ready")),
|
SHOVEL(LocaleLoader.getString("Excavation.Ability.Lower"), LocaleLoader.getString("Excavation.Ability.Ready")),
|
||||||
SWORD(mcLocale.getString("Swords.Ability.Lower"), mcLocale.getString("Swords.Ability.Ready"));
|
SWORD(LocaleLoader.getString("Swords.Ability.Lower"), LocaleLoader.getString("Swords.Ability.Ready"));
|
||||||
|
|
||||||
private String lowerTool;
|
private String lowerTool;
|
||||||
private String raiseTool;
|
private String raiseTool;
|
||||||
|
@ -2,11 +2,7 @@ package com.gmail.nossr50.listeners;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.gmail.nossr50.BlockChecks;
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -19,6 +15,10 @@ import com.gmail.nossr50.skills.Repair;
|
|||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.skills.WoodCutting;
|
import com.gmail.nossr50.skills.WoodCutting;
|
||||||
import com.gmail.nossr50.spout.SpoutSounds;
|
import com.gmail.nossr50.spout.SpoutSounds;
|
||||||
|
import com.gmail.nossr50.util.BlockChecks;
|
||||||
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
|
|
||||||
@ -145,7 +145,7 @@ public class BlockListener implements Listener {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* Green Terra */
|
/* Green Terra */
|
||||||
if (PP.getToolPreparationMode(ToolType.HOE) && mcPermissions.getInstance().greenTerra(player) && ((mat.equals(Material.CROPS) && block.getData() == CropState.RIPE.getData()) || Herbalism.canBeGreenTerra(mat))) {
|
if (PP.getToolPreparationMode(ToolType.HOE) && Permissions.getInstance().greenTerra(player) && ((mat.equals(Material.CROPS) && block.getData() == CropState.RIPE.getData()) || Herbalism.canBeGreenTerra(mat))) {
|
||||||
Skills.abilityCheck(player, SkillType.HERBALISM);
|
Skills.abilityCheck(player, SkillType.HERBALISM);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -154,7 +154,7 @@ public class BlockListener implements Listener {
|
|||||||
Herbalism.herbalismProcCheck(block, player, event, plugin);
|
Herbalism.herbalismProcCheck(block, player, event, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(mat)) {
|
if (Permissions.getInstance().herbalism(player) && Herbalism.canBeGreenTerra(mat)) {
|
||||||
Herbalism.herbalismProcCheck(block, player, event, plugin);
|
Herbalism.herbalismProcCheck(block, player, event, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -162,7 +162,7 @@ public class BlockListener implements Listener {
|
|||||||
* MINING
|
* MINING
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mcPermissions.getInstance().mining(player) && Mining.canBeSuperBroken(mat)) {
|
if (Permissions.getInstance().mining(player) && Mining.canBeSuperBroken(mat)) {
|
||||||
if (Config.getInstance().getMiningRequiresTool() && ItemChecks.isMiningPick(inhand)) {
|
if (Config.getInstance().getMiningRequiresTool() && ItemChecks.isMiningPick(inhand)) {
|
||||||
Mining.miningBlockCheck(player, block);
|
Mining.miningBlockCheck(player, block);
|
||||||
}
|
}
|
||||||
@ -175,7 +175,7 @@ public class BlockListener implements Listener {
|
|||||||
* WOOD CUTTING
|
* WOOD CUTTING
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (mcPermissions.getInstance().woodcutting(player) && mat.equals(Material.LOG)) {
|
if (Permissions.getInstance().woodcutting(player) && mat.equals(Material.LOG)) {
|
||||||
if (Config.getInstance().getWoodcuttingRequiresTool() && ItemChecks.isAxe(inhand)) {
|
if (Config.getInstance().getWoodcuttingRequiresTool() && ItemChecks.isAxe(inhand)) {
|
||||||
WoodCutting.woodcuttingBlockCheck(player, block);
|
WoodCutting.woodcuttingBlockCheck(player, block);
|
||||||
}
|
}
|
||||||
@ -184,7 +184,7 @@ public class BlockListener implements Listener {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.getAbilityMode(AbilityType.TREE_FELLER) && mcPermissions.getInstance().treeFeller(player)) {
|
if (PP.getAbilityMode(AbilityType.TREE_FELLER) && Permissions.getInstance().treeFeller(player)) {
|
||||||
WoodCutting.treeFeller(event);
|
WoodCutting.treeFeller(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ public class BlockListener implements Listener {
|
|||||||
* EXCAVATION
|
* EXCAVATION
|
||||||
*/
|
*/
|
||||||
|
|
||||||
if (Excavation.canBeGigaDrillBroken(mat) && mcPermissions.getInstance().excavation(player) && !block.hasMetadata("mcmmoPlacedBlock")) {
|
if (Excavation.canBeGigaDrillBroken(mat) && Permissions.getInstance().excavation(player) && !block.hasMetadata("mcmmoPlacedBlock")) {
|
||||||
if (Config.getInstance().getExcavationRequiresTool() && ItemChecks.isShovel(inhand)) {
|
if (Config.getInstance().getExcavationRequiresTool() && ItemChecks.isShovel(inhand)) {
|
||||||
Excavation.excavationProcCheck(block, player);
|
Excavation.excavationProcCheck(block, player);
|
||||||
}
|
}
|
||||||
@ -229,7 +229,7 @@ public class BlockListener implements Listener {
|
|||||||
if (PP.getToolPreparationMode(ToolType.HOE) && (Herbalism.canBeGreenTerra(mat) || Herbalism.makeMossy(mat))) {
|
if (PP.getToolPreparationMode(ToolType.HOE) && (Herbalism.canBeGreenTerra(mat) || Herbalism.makeMossy(mat))) {
|
||||||
Skills.abilityCheck(player, SkillType.HERBALISM);
|
Skills.abilityCheck(player, SkillType.HERBALISM);
|
||||||
}
|
}
|
||||||
else if (PP.getToolPreparationMode(ToolType.AXE) && mat.equals(Material.LOG) && mcPermissions.getInstance().treeFeller(player)) { //Why are we checking the permissions here?
|
else if (PP.getToolPreparationMode(ToolType.AXE) && mat.equals(Material.LOG) && Permissions.getInstance().treeFeller(player)) { //Why are we checking the permissions here?
|
||||||
Skills.abilityCheck(player, SkillType.WOODCUTTING);
|
Skills.abilityCheck(player, SkillType.WOODCUTTING);
|
||||||
}
|
}
|
||||||
else if (PP.getToolPreparationMode(ToolType.PICKAXE) && Mining.canBeSuperBroken(mat)) {
|
else if (PP.getToolPreparationMode(ToolType.PICKAXE) && Mining.canBeSuperBroken(mat)) {
|
||||||
@ -251,7 +251,7 @@ public class BlockListener implements Listener {
|
|||||||
/*
|
/*
|
||||||
* ABILITY TRIGGER CHECKS
|
* ABILITY TRIGGER CHECKS
|
||||||
*/
|
*/
|
||||||
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && mcPermissions.getInstance().greenTerra(player) && Herbalism.makeMossy(mat)) {
|
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && Permissions.getInstance().greenTerra(player) && Herbalism.makeMossy(mat)) {
|
||||||
Herbalism.greenTerra(player, block);
|
Herbalism.greenTerra(player, block);
|
||||||
}
|
}
|
||||||
else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
||||||
|
@ -22,23 +22,23 @@ import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|||||||
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
import org.bukkit.event.entity.FoodLevelChangeEvent;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
import com.gmail.nossr50.runnables.mcBleedTimer;
|
import com.gmail.nossr50.runnables.BleedTimer;
|
||||||
import com.gmail.nossr50.skills.Acrobatics;
|
import com.gmail.nossr50.skills.Acrobatics;
|
||||||
import com.gmail.nossr50.skills.Archery;
|
import com.gmail.nossr50.skills.Archery;
|
||||||
import com.gmail.nossr50.skills.BlastMining;
|
import com.gmail.nossr50.skills.BlastMining;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.skills.Taming;
|
import com.gmail.nossr50.skills.Taming;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class EntityListener implements Listener {
|
public class EntityListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -76,7 +76,7 @@ public class EntityListener implements Listener {
|
|||||||
if (defender instanceof LivingEntity) {
|
if (defender instanceof LivingEntity) {
|
||||||
LivingEntity livingDefender = (LivingEntity)defender;
|
LivingEntity livingDefender = (LivingEntity)defender;
|
||||||
|
|
||||||
if (!m.isInvincible(livingDefender, event)) {
|
if (!Misc.isInvincible(livingDefender, event)) {
|
||||||
Combat.combatChecks(event, plugin);
|
Combat.combatChecks(event, plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -109,11 +109,11 @@ public class EntityListener implements Listener {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m.isInvincible(player, event)) {
|
if (!Misc.isInvincible(player, event)) {
|
||||||
if (cause == DamageCause.FALL && mcPermissions.getInstance().acrobatics(player)) {
|
if (cause == DamageCause.FALL && Permissions.getInstance().acrobatics(player)) {
|
||||||
Acrobatics.acrobaticsCheck(player, event);
|
Acrobatics.acrobaticsCheck(player, event);
|
||||||
}
|
}
|
||||||
else if (cause == DamageCause.BLOCK_EXPLOSION && mcPermissions.getInstance().demolitionsExpertise(player)) {
|
else if (cause == DamageCause.BLOCK_EXPLOSION && Permissions.getInstance().demolitionsExpertise(player)) {
|
||||||
BlastMining.demolitionsExpertise(player, event);
|
BlastMining.demolitionsExpertise(player, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,7 +126,7 @@ public class EntityListener implements Listener {
|
|||||||
case WOLF:
|
case WOLF:
|
||||||
Wolf wolf = (Wolf) entity;
|
Wolf wolf = (Wolf) entity;
|
||||||
|
|
||||||
if ((!m.isInvincible(wolf, event)) && wolf.isTamed() && (wolf.getOwner() instanceof Player)) {
|
if ((!Misc.isInvincible(wolf, event)) && wolf.isTamed() && (wolf.getOwner() instanceof Player)) {
|
||||||
Taming.preventDamage(event);
|
Taming.preventDamage(event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -147,7 +147,7 @@ public class EntityListener implements Listener {
|
|||||||
x.setFireTicks(0);
|
x.setFireTicks(0);
|
||||||
|
|
||||||
/* Remove bleed track */
|
/* Remove bleed track */
|
||||||
mcBleedTimer.remove(x);
|
BleedTimer.remove(x);
|
||||||
|
|
||||||
Archery.arrowRetrievalCheck(x, plugin);
|
Archery.arrowRetrievalCheck(x, plugin);
|
||||||
|
|
||||||
@ -185,7 +185,7 @@ public class EntityListener implements Listener {
|
|||||||
if (plugin.tntTracker.containsKey(id)) {
|
if (plugin.tntTracker.containsKey(id)) {
|
||||||
Player player = plugin.tntTracker.get(id);
|
Player player = plugin.tntTracker.get(id);
|
||||||
|
|
||||||
if (mcPermissions.getInstance().biggerBombs(player)) {
|
if (Permissions.getInstance().biggerBombs(player)) {
|
||||||
BlastMining.biggerBombs(player, event);
|
BlastMining.biggerBombs(player, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ public class EntityListener implements Listener {
|
|||||||
public void onEntityTame(EntityTameEvent event) {
|
public void onEntityTame(EntityTameEvent event) {
|
||||||
Player player = (Player) event.getOwner();
|
Player player = (Player) event.getOwner();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().taming(player) && !event.getEntity().hasMetadata("mcmmoSummoned")) {
|
if (Permissions.getInstance().taming(player) && !event.getEntity().hasMetadata("mcmmoSummoned")) {
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
EntityType type = event.getEntityType();
|
EntityType type = event.getEntityType();
|
||||||
int xp = 0;
|
int xp = 0;
|
||||||
|
@ -24,13 +24,7 @@ import org.bukkit.event.player.PlayerPickupItemEvent;
|
|||||||
import org.bukkit.event.player.PlayerQuitEvent;
|
import org.bukkit.event.player.PlayerQuitEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.BlockChecks;
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.Item;
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.commands.general.XprateCommand;
|
import com.gmail.nossr50.commands.general.XprateCommand;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.runnables.RemoveProfileFromMemoryTask;
|
import com.gmail.nossr50.runnables.RemoveProfileFromMemoryTask;
|
||||||
@ -40,7 +34,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
|
|||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOAdminChatEvent;
|
||||||
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
import com.gmail.nossr50.events.chat.McMMOPartyChatEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
import com.gmail.nossr50.skills.BlastMining;
|
import com.gmail.nossr50.skills.BlastMining;
|
||||||
import com.gmail.nossr50.skills.Fishing;
|
import com.gmail.nossr50.skills.Fishing;
|
||||||
@ -48,6 +42,12 @@ import com.gmail.nossr50.skills.Herbalism;
|
|||||||
import com.gmail.nossr50.skills.Repair;
|
import com.gmail.nossr50.skills.Repair;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.skills.Taming;
|
import com.gmail.nossr50.skills.Taming;
|
||||||
|
import com.gmail.nossr50.util.BlockChecks;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.Item;
|
||||||
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class PlayerListener implements Listener {
|
public class PlayerListener implements Listener {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -67,16 +67,16 @@ public class PlayerListener implements Listener {
|
|||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
if (PP.getGodMode()) {
|
if (PP.getGodMode()) {
|
||||||
if (!mcPermissions.getInstance().mcgod(player)) {
|
if (!Permissions.getInstance().mcgod(player)) {
|
||||||
PP.toggleGodMode();
|
PP.toggleGodMode();
|
||||||
player.sendMessage(mcLocale.getString("Commands.GodMode.Forbidden"));
|
player.sendMessage(LocaleLoader.getString("Commands.GodMode.Forbidden"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PP.inParty()) {
|
if (PP.inParty()) {
|
||||||
if (!mcPermissions.getInstance().party(player)) {
|
if (!Permissions.getInstance().party(player)) {
|
||||||
PP.removeParty();
|
PP.removeParty();
|
||||||
player.sendMessage(mcLocale.getString("Party.Forbidden"));
|
player.sendMessage(LocaleLoader.getString("Party.Forbidden"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -90,7 +90,7 @@ public class PlayerListener implements Listener {
|
|||||||
public void onPlayerFish(PlayerFishEvent event) {
|
public void onPlayerFish(PlayerFishEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().fishing(player)) {
|
if (Permissions.getInstance().fishing(player)) {
|
||||||
State state = event.getState();
|
State state = event.getState();
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
@ -99,7 +99,7 @@ public class PlayerListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case CAUGHT_ENTITY:
|
case CAUGHT_ENTITY:
|
||||||
if (Users.getProfile(player).getSkillLevel(SkillType.FISHING) >= 150 && mcPermissions.getInstance().shakeMob(player)) {
|
if (Users.getProfile(player).getSkillLevel(SkillType.FISHING) >= 150 && Permissions.getInstance().shakeMob(player)) {
|
||||||
Fishing.shakeMob(event);
|
Fishing.shakeMob(event);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -167,14 +167,14 @@ public class PlayerListener implements Listener {
|
|||||||
public void onPlayerJoin(PlayerJoinEvent event) {
|
public void onPlayerJoin(PlayerJoinEvent event) {
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().motd(player) && Config.getInstance().getMOTDEnabled()) {
|
if (Permissions.getInstance().motd(player) && Config.getInstance().getMOTDEnabled()) {
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.MOTD", new Object[] {plugin.getDescription().getVersion()}));
|
player.sendMessage(LocaleLoader.getString("mcMMO.MOTD", new Object[] {plugin.getDescription().getVersion()}));
|
||||||
player.sendMessage(mcLocale.getString("mcMMO.Wiki"));
|
player.sendMessage(LocaleLoader.getString("mcMMO.Wiki"));
|
||||||
}
|
}
|
||||||
|
|
||||||
//THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY
|
//THIS IS VERY BAD WAY TO DO THINGS, NEED BETTER WAY
|
||||||
if (XprateCommand.xpevent) {
|
if (XprateCommand.xpevent) {
|
||||||
player.sendMessage(mcLocale.getString("XPRate.Event", new Object[] {Config.getInstance().xpGainMultiplier}));
|
player.sendMessage(LocaleLoader.getString("XPRate.Event", new Object[] {Config.getInstance().xpGainMultiplier}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -204,7 +204,7 @@ public class PlayerListener implements Listener {
|
|||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
|
|
||||||
/* REPAIR CHECKS */
|
/* REPAIR CHECKS */
|
||||||
if (mcPermissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId() && (ItemChecks.isTool(is) || ItemChecks.isArmor(is))) {
|
if (Permissions.getInstance().repair(player) && block.getTypeId() == Config.getInstance().getRepairAnvilId() && (ItemChecks.isTool(is) || ItemChecks.isArmor(is))) {
|
||||||
Repair.repairCheck(player, is);
|
Repair.repairCheck(player, is);
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
@ -225,7 +225,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* GREEN THUMB CHECK */
|
/* GREEN THUMB CHECK */
|
||||||
if (mcPermissions.getInstance().greenThumbBlocks(player) && Herbalism.makeMossy(mat) && is.getType().equals(Material.SEEDS)) {
|
if (Permissions.getInstance().greenThumbBlocks(player) && Herbalism.makeMossy(mat) && is.getType().equals(Material.SEEDS)) {
|
||||||
Herbalism.greenThumbBlocks(is, player, block);
|
Herbalism.greenThumbBlocks(is, player, block);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -235,7 +235,7 @@ public class PlayerListener implements Listener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* BLAST MINING CHECK */
|
/* BLAST MINING CHECK */
|
||||||
if (mcPermissions.getInstance().blastMining(player) && is.getTypeId() == Config.getInstance().getDetonatorItemID()) {
|
if (Permissions.getInstance().blastMining(player) && is.getTypeId() == Config.getInstance().getDetonatorItemID()) {
|
||||||
BlastMining.remoteDetonation(player, plugin);
|
BlastMining.remoteDetonation(player, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -258,7 +258,7 @@ public class PlayerListener implements Listener {
|
|||||||
Item.itemchecks(player);
|
Item.itemchecks(player);
|
||||||
|
|
||||||
/* BLAST MINING CHECK */
|
/* BLAST MINING CHECK */
|
||||||
if (mcPermissions.getInstance().blastMining(player) && is.getTypeId() == Config.getInstance().getDetonatorItemID()) {
|
if (Permissions.getInstance().blastMining(player) && is.getTypeId() == Config.getInstance().getDetonatorItemID()) {
|
||||||
BlastMining.remoteDetonation(player, plugin);
|
BlastMining.remoteDetonation(player, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -268,7 +268,7 @@ public class PlayerListener implements Listener {
|
|||||||
case LEFT_CLICK_BLOCK:
|
case LEFT_CLICK_BLOCK:
|
||||||
|
|
||||||
/* CALL OF THE WILD CHECKS */
|
/* CALL OF THE WILD CHECKS */
|
||||||
if (player.isSneaking() && mcPermissions.getInstance().taming(player)) {
|
if (player.isSneaking() && Permissions.getInstance().taming(player)) {
|
||||||
if (is.getType().equals(Material.RAW_FISH)) {
|
if (is.getType().equals(Material.RAW_FISH)) {
|
||||||
Taming.animalSummon(EntityType.OCELOT, player, plugin);
|
Taming.animalSummon(EntityType.OCELOT, player, plugin);
|
||||||
}
|
}
|
||||||
@ -334,7 +334,7 @@ public class PlayerListener implements Listener {
|
|||||||
event.setMessage(chatEvent.getMessage());
|
event.setMessage(chatEvent.getMessage());
|
||||||
|
|
||||||
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
for (Player x : plugin.getServer().getOnlinePlayers()) {
|
||||||
if (x.isOp() || mcPermissions.getInstance().adminChat(x)) {
|
if (x.isOp() || Permissions.getInstance().adminChat(x)) {
|
||||||
intendedRecipients.add(x);
|
intendedRecipients.add(x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6,10 +6,10 @@ import org.getspout.spoutapi.event.input.KeyPressedEvent;
|
|||||||
import org.getspout.spoutapi.gui.ScreenType;
|
import org.getspout.spoutapi.gui.ScreenType;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SpoutInputListener implements Listener {
|
public class SpoutInputListener implements Listener {
|
||||||
private mcMMO plugin;
|
private mcMMO plugin;
|
||||||
|
@ -6,12 +6,12 @@ import org.bukkit.event.Listener;
|
|||||||
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
|
import org.getspout.spoutapi.event.spout.SpoutCraftEnableEvent;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.HUDmmo;
|
import com.gmail.nossr50.datatypes.HUDmmo;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SpoutListener implements Listener {
|
public class SpoutListener implements Listener {
|
||||||
//Why do we have this here? We never use it...
|
//Why do we have this here? We never use it...
|
||||||
|
@ -6,7 +6,6 @@ import org.getspout.spoutapi.event.screen.ButtonClickEvent;
|
|||||||
import org.getspout.spoutapi.event.screen.ScreenCloseEvent;
|
import org.getspout.spoutapi.event.screen.ScreenCloseEvent;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.HUDType;
|
import com.gmail.nossr50.datatypes.HUDType;
|
||||||
import com.gmail.nossr50.datatypes.HUDmmo;
|
import com.gmail.nossr50.datatypes.HUDmmo;
|
||||||
@ -16,6 +15,7 @@ import com.gmail.nossr50.datatypes.buttons.ButtonHUDStyle;
|
|||||||
import com.gmail.nossr50.datatypes.buttons.ButtonPartyToggle;
|
import com.gmail.nossr50.datatypes.buttons.ButtonPartyToggle;
|
||||||
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
import com.gmail.nossr50.datatypes.popups.PopupMMO;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SpoutScreenListener implements Listener {
|
public class SpoutScreenListener implements Listener {
|
||||||
//Why do we have this here? We never use it...
|
//Why do we have this here? We never use it...
|
||||||
|
@ -9,7 +9,7 @@ import org.bukkit.ChatColor;
|
|||||||
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
|
||||||
public class mcLocale {
|
public class LocaleLoader {
|
||||||
private static final String BUNDLE_NAME = "com.gmail.nossr50.locale.locale";
|
private static final String BUNDLE_NAME = "com.gmail.nossr50.locale.locale";
|
||||||
private static ResourceBundle RESOURCE_BUNDLE = null;
|
private static ResourceBundle RESOURCE_BUNDLE = null;
|
||||||
|
|
@ -8,10 +8,14 @@ import com.gmail.nossr50.commands.party.*;
|
|||||||
import com.gmail.nossr50.commands.general.*;
|
import com.gmail.nossr50.commands.general.*;
|
||||||
import com.gmail.nossr50.config.*;
|
import com.gmail.nossr50.config.*;
|
||||||
import com.gmail.nossr50.runnables.*;
|
import com.gmail.nossr50.runnables.*;
|
||||||
|
import com.gmail.nossr50.util.Database;
|
||||||
|
import com.gmail.nossr50.util.Leaderboard;
|
||||||
|
import com.gmail.nossr50.util.Metrics;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.listeners.BlockListener;
|
import com.gmail.nossr50.listeners.BlockListener;
|
||||||
import com.gmail.nossr50.listeners.EntityListener;
|
import com.gmail.nossr50.listeners.EntityListener;
|
||||||
import com.gmail.nossr50.listeners.PlayerListener;
|
import com.gmail.nossr50.listeners.PlayerListener;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
@ -106,11 +110,11 @@ public class mcMMO extends JavaPlugin {
|
|||||||
//Schedule Spout Activation 1 second after start-up
|
//Schedule Spout Activation 1 second after start-up
|
||||||
scheduler.scheduleSyncDelayedTask(this, new SpoutStart(this), 20);
|
scheduler.scheduleSyncDelayedTask(this, new SpoutStart(this), 20);
|
||||||
//Periodic save timer (Saves every 10 minutes)
|
//Periodic save timer (Saves every 10 minutes)
|
||||||
scheduler.scheduleSyncRepeatingTask(this, new mcSaveTimer(this), 0, Config.getInstance().getSaveInterval() * 1200);
|
scheduler.scheduleSyncRepeatingTask(this, new SaveTimer(this), 0, Config.getInstance().getSaveInterval() * 1200);
|
||||||
//Regen & Cooldown timer (Runs every second)
|
//Regen & Cooldown timer (Runs every second)
|
||||||
scheduler.scheduleSyncRepeatingTask(this, new mcTimer(this), 0, 20);
|
scheduler.scheduleSyncRepeatingTask(this, new SkillMonitor(this), 0, 20);
|
||||||
//Bleed timer (Runs every two seconds)
|
//Bleed timer (Runs every two seconds)
|
||||||
scheduler.scheduleSyncRepeatingTask(this, new mcBleedTimer(this), 0, 40);
|
scheduler.scheduleSyncRepeatingTask(this, new BleedTimer(this), 0, 40);
|
||||||
|
|
||||||
registerCommands();
|
registerCommands();
|
||||||
|
|
||||||
@ -183,18 +187,18 @@ public class mcMMO extends JavaPlugin {
|
|||||||
|
|
||||||
//Register aliases with the aliasmap (used in the playercommandpreprocessevent to ugly alias them to actual commands)
|
//Register aliases with the aliasmap (used in the playercommandpreprocessevent to ugly alias them to actual commands)
|
||||||
//Skills commands
|
//Skills commands
|
||||||
aliasMap.put(mcLocale.getString("Acrobatics.SkillName").toLowerCase(), "acrobatics");
|
aliasMap.put(LocaleLoader.getString("Acrobatics.SkillName").toLowerCase(), "acrobatics");
|
||||||
aliasMap.put(mcLocale.getString("Archery.SkillName").toLowerCase(), "archery");
|
aliasMap.put(LocaleLoader.getString("Archery.SkillName").toLowerCase(), "archery");
|
||||||
aliasMap.put(mcLocale.getString("Axes.SkillName").toLowerCase(), "axes");
|
aliasMap.put(LocaleLoader.getString("Axes.SkillName").toLowerCase(), "axes");
|
||||||
aliasMap.put(mcLocale.getString("Excavation.SkillName").toLowerCase(), "excavation");
|
aliasMap.put(LocaleLoader.getString("Excavation.SkillName").toLowerCase(), "excavation");
|
||||||
aliasMap.put(mcLocale.getString("Fishing.SkillName").toLowerCase(), "fishing");
|
aliasMap.put(LocaleLoader.getString("Fishing.SkillName").toLowerCase(), "fishing");
|
||||||
aliasMap.put(mcLocale.getString("Herbalism.SkillName").toLowerCase(), "herbalism");
|
aliasMap.put(LocaleLoader.getString("Herbalism.SkillName").toLowerCase(), "herbalism");
|
||||||
aliasMap.put(mcLocale.getString("Mining.SkillName").toLowerCase(), "mining");
|
aliasMap.put(LocaleLoader.getString("Mining.SkillName").toLowerCase(), "mining");
|
||||||
aliasMap.put(mcLocale.getString("Repair.SkillName").toLowerCase(), "repair");
|
aliasMap.put(LocaleLoader.getString("Repair.SkillName").toLowerCase(), "repair");
|
||||||
aliasMap.put(mcLocale.getString("Swords.SkillName").toLowerCase(), "swords");
|
aliasMap.put(LocaleLoader.getString("Swords.SkillName").toLowerCase(), "swords");
|
||||||
aliasMap.put(mcLocale.getString("Taming.SkillName").toLowerCase(), "taming");
|
aliasMap.put(LocaleLoader.getString("Taming.SkillName").toLowerCase(), "taming");
|
||||||
aliasMap.put(mcLocale.getString("Unarmed.SkillName").toLowerCase(), "unarmed");
|
aliasMap.put(LocaleLoader.getString("Unarmed.SkillName").toLowerCase(), "unarmed");
|
||||||
aliasMap.put(mcLocale.getString("WoodCutting.SkillName").toLowerCase(), "woodcutting");
|
aliasMap.put(LocaleLoader.getString("WoodCutting.SkillName").toLowerCase(), "woodcutting");
|
||||||
|
|
||||||
//Register commands
|
//Register commands
|
||||||
//Skills commands
|
//Skills commands
|
||||||
|
@ -16,10 +16,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Party {
|
public class Party {
|
||||||
public static String pluginPath;
|
public static String pluginPath;
|
||||||
@ -92,7 +92,7 @@ public class Party {
|
|||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (Player p : getOnlineMembers(player)) {
|
for (Player p : getOnlineMembers(player)) {
|
||||||
if (p.getName() != playerName) {
|
if (p.getName() != playerName) {
|
||||||
p.sendMessage(mcLocale.getString("Party.InformedOnJoin", new Object[] {playerName}));
|
p.sendMessage(LocaleLoader.getString("Party.InformedOnJoin", new Object[] {playerName}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -226,7 +226,7 @@ public class Party {
|
|||||||
if (player != null) {
|
if (player != null) {
|
||||||
for (Player p : getOnlineMembers(player)) {
|
for (Player p : getOnlineMembers(player)) {
|
||||||
if (p.getName() != playerName) {
|
if (p.getName() != playerName) {
|
||||||
p.sendMessage(mcLocale.getString("Party.InformedOnQuit", new Object[] {playerName}));
|
p.sendMessage(LocaleLoader.getString("Party.InformedOnQuit", new Object[] {playerName}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -323,10 +323,10 @@ public class Party {
|
|||||||
informPartyMembers(player);
|
informPartyMembers(player);
|
||||||
|
|
||||||
if (!invite) {
|
if (!invite) {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Party.Join", new Object[]{ newParty }));
|
player.sendMessage(LocaleLoader.getString("Commands.Party.Join", new Object[]{ newParty }));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Commands.Invite.Accepted", new Object[]{ PP.getParty() }));
|
player.sendMessage(LocaleLoader.getString("Commands.Invite.Accepted", new Object[]{ PP.getParty() }));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5,13 +5,13 @@ import java.util.HashSet;
|
|||||||
import org.bukkit.entity.LivingEntity;
|
import org.bukkit.entity.LivingEntity;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class mcBleedTimer implements Runnable {
|
public class BleedTimer implements Runnable {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
private static HashSet<LivingEntity> bleedList = new HashSet<LivingEntity>();
|
private static HashSet<LivingEntity> bleedList = new HashSet<LivingEntity>();
|
||||||
@ -20,7 +20,7 @@ public class mcBleedTimer implements Runnable {
|
|||||||
|
|
||||||
private static boolean lock = false;
|
private static boolean lock = false;
|
||||||
|
|
||||||
public mcBleedTimer(final mcMMO plugin) {
|
public BleedTimer(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class mcBleedTimer implements Runnable {
|
|||||||
PP.decreaseBleedTicks();
|
PP.decreaseBleedTicks();
|
||||||
|
|
||||||
if (PP.getBleedTicks() == 0) {
|
if (PP.getBleedTicks() == 0) {
|
||||||
player.sendMessage(mcLocale.getString("Swords.Combat.Bleeding.Stopped"));
|
player.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding.Stopped"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,6 +1,6 @@
|
|||||||
package com.gmail.nossr50.runnables;
|
package com.gmail.nossr50.runnables;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class RemoveProfileFromMemoryTask implements Runnable {
|
public class RemoveProfileFromMemoryTask implements Runnable {
|
||||||
private String playerName = null;
|
private String playerName = null;
|
||||||
|
@ -3,9 +3,9 @@ package com.gmail.nossr50.runnables;
|
|||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
|
||||||
public class SQLConversionTask implements Runnable {
|
public class SQLConversionTask implements Runnable {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
@ -179,34 +179,34 @@ public class SQLConversionTask implements Runnable {
|
|||||||
mcMMO.database.write("UPDATE "
|
mcMMO.database.write("UPDATE "
|
||||||
+ tablePrefix
|
+ tablePrefix
|
||||||
+ "skills SET "
|
+ "skills SET "
|
||||||
+ " taming = taming+" + m.getInt(taming)
|
+ " taming = taming+" + Misc.getInt(taming)
|
||||||
+ ", mining = mining+" + m.getInt(mining)
|
+ ", mining = mining+" + Misc.getInt(mining)
|
||||||
+ ", repair = repair+" + m.getInt(repair)
|
+ ", repair = repair+" + Misc.getInt(repair)
|
||||||
+ ", woodcutting = woodcutting+" + m.getInt(woodcutting)
|
+ ", woodcutting = woodcutting+" + Misc.getInt(woodcutting)
|
||||||
+ ", unarmed = unarmed+" + m.getInt(unarmed)
|
+ ", unarmed = unarmed+" + Misc.getInt(unarmed)
|
||||||
+ ", herbalism = herbalism+" + m.getInt(herbalism)
|
+ ", herbalism = herbalism+" + Misc.getInt(herbalism)
|
||||||
+ ", excavation = excavation+" + m.getInt(excavation)
|
+ ", excavation = excavation+" + Misc.getInt(excavation)
|
||||||
+ ", archery = archery+" + m.getInt(archery)
|
+ ", archery = archery+" + Misc.getInt(archery)
|
||||||
+ ", swords = swords+" + m.getInt(swords)
|
+ ", swords = swords+" + Misc.getInt(swords)
|
||||||
+ ", axes = axes+" + m.getInt(axes)
|
+ ", axes = axes+" + Misc.getInt(axes)
|
||||||
+ ", acrobatics = acrobatics+" + m.getInt(acrobatics)
|
+ ", acrobatics = acrobatics+" + Misc.getInt(acrobatics)
|
||||||
+ ", fishing = fishing+" + m.getInt(fishing)
|
+ ", fishing = fishing+" + Misc.getInt(fishing)
|
||||||
+ " WHERE user_id = " + id);
|
+ " WHERE user_id = " + id);
|
||||||
mcMMO.database.write("UPDATE "
|
mcMMO.database.write("UPDATE "
|
||||||
+ tablePrefix
|
+ tablePrefix
|
||||||
+ "experience SET "
|
+ "experience SET "
|
||||||
+ " taming = " + m.getInt(tamingXP)
|
+ " taming = " + Misc.getInt(tamingXP)
|
||||||
+ ", mining = " + m.getInt(miningXP)
|
+ ", mining = " + Misc.getInt(miningXP)
|
||||||
+ ", repair = " + m.getInt(repairXP)
|
+ ", repair = " + Misc.getInt(repairXP)
|
||||||
+ ", woodcutting = " + m.getInt(woodCuttingXP)
|
+ ", woodcutting = " + Misc.getInt(woodCuttingXP)
|
||||||
+ ", unarmed = " + m.getInt(unarmedXP)
|
+ ", unarmed = " + Misc.getInt(unarmedXP)
|
||||||
+ ", herbalism = " + m.getInt(herbalismXP)
|
+ ", herbalism = " + Misc.getInt(herbalismXP)
|
||||||
+ ", excavation = " + m.getInt(excavationXP)
|
+ ", excavation = " + Misc.getInt(excavationXP)
|
||||||
+ ", archery = " + m.getInt(archeryXP)
|
+ ", archery = " + Misc.getInt(archeryXP)
|
||||||
+ ", swords = " + m.getInt(swordsXP)
|
+ ", swords = " + Misc.getInt(swordsXP)
|
||||||
+ ", axes = " + m.getInt(axesXP)
|
+ ", axes = " + Misc.getInt(axesXP)
|
||||||
+ ", acrobatics = " + m.getInt(acrobaticsXP)
|
+ ", acrobatics = " + Misc.getInt(acrobaticsXP)
|
||||||
+ ", fishing = " + m.getInt(fishingXP)
|
+ ", fishing = " + Misc.getInt(fishingXP)
|
||||||
+ " WHERE user_id = " + id);
|
+ " WHERE user_id = " + id);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -241,34 +241,34 @@ public class SQLConversionTask implements Runnable {
|
|||||||
mcMMO.database.write("UPDATE "
|
mcMMO.database.write("UPDATE "
|
||||||
+ tablePrefix
|
+ tablePrefix
|
||||||
+ "skills SET "
|
+ "skills SET "
|
||||||
+ " taming = taming+" + m.getInt(taming)
|
+ " taming = taming+" + Misc.getInt(taming)
|
||||||
+ ", mining = mining+" + m.getInt(mining)
|
+ ", mining = mining+" + Misc.getInt(mining)
|
||||||
+ ", repair = repair+" + m.getInt(repair)
|
+ ", repair = repair+" + Misc.getInt(repair)
|
||||||
+ ", woodcutting = woodcutting+" + m.getInt(woodcutting)
|
+ ", woodcutting = woodcutting+" + Misc.getInt(woodcutting)
|
||||||
+ ", unarmed = unarmed+" + m.getInt(unarmed)
|
+ ", unarmed = unarmed+" + Misc.getInt(unarmed)
|
||||||
+ ", herbalism = herbalism+" + m.getInt(herbalism)
|
+ ", herbalism = herbalism+" + Misc.getInt(herbalism)
|
||||||
+ ", excavation = excavation+" + m.getInt(excavation)
|
+ ", excavation = excavation+" + Misc.getInt(excavation)
|
||||||
+ ", archery = archery+" + m.getInt(archery)
|
+ ", archery = archery+" + Misc.getInt(archery)
|
||||||
+ ", swords = swords+" + m.getInt(swords)
|
+ ", swords = swords+" + Misc.getInt(swords)
|
||||||
+ ", axes = axes+" + m.getInt(axes)
|
+ ", axes = axes+" + Misc.getInt(axes)
|
||||||
+ ", acrobatics = acrobatics+" + m.getInt(acrobatics)
|
+ ", acrobatics = acrobatics+" + Misc.getInt(acrobatics)
|
||||||
+ ", fishing = fishing+" + m.getInt(fishing)
|
+ ", fishing = fishing+" + Misc.getInt(fishing)
|
||||||
+ " WHERE user_id = " + id);
|
+ " WHERE user_id = " + id);
|
||||||
mcMMO.database.write("UPDATE "
|
mcMMO.database.write("UPDATE "
|
||||||
+ tablePrefix
|
+ tablePrefix
|
||||||
+ "experience SET "
|
+ "experience SET "
|
||||||
+ " taming = " + m.getInt(tamingXP)
|
+ " taming = " + Misc.getInt(tamingXP)
|
||||||
+ ", mining = " + m.getInt(miningXP)
|
+ ", mining = " + Misc.getInt(miningXP)
|
||||||
+ ", repair = " + m.getInt(repairXP)
|
+ ", repair = " + Misc.getInt(repairXP)
|
||||||
+ ", woodcutting = " + m.getInt(woodCuttingXP)
|
+ ", woodcutting = " + Misc.getInt(woodCuttingXP)
|
||||||
+ ", unarmed = " + m.getInt(unarmedXP)
|
+ ", unarmed = " + Misc.getInt(unarmedXP)
|
||||||
+ ", herbalism = " + m.getInt(herbalismXP)
|
+ ", herbalism = " + Misc.getInt(herbalismXP)
|
||||||
+ ", excavation = " + m.getInt(excavationXP)
|
+ ", excavation = " + Misc.getInt(excavationXP)
|
||||||
+ ", archery = " + m.getInt(archeryXP)
|
+ ", archery = " + Misc.getInt(archeryXP)
|
||||||
+ ", swords = " + m.getInt(swordsXP)
|
+ ", swords = " + Misc.getInt(swordsXP)
|
||||||
+ ", axes = " + m.getInt(axesXP)
|
+ ", axes = " + Misc.getInt(axesXP)
|
||||||
+ ", acrobatics = " + m.getInt(acrobaticsXP)
|
+ ", acrobatics = " + Misc.getInt(acrobaticsXP)
|
||||||
+ ", fishing = " + m.getInt(fishingXP)
|
+ ", fishing = " + Misc.getInt(fishingXP)
|
||||||
+ " WHERE user_id = " + id);
|
+ " WHERE user_id = " + id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,10 +2,10 @@ package com.gmail.nossr50.runnables;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Database;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
|
import com.gmail.nossr50.util.Database;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SQLReconnect implements Runnable {
|
public class SQLReconnect implements Runnable {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
@ -2,13 +2,13 @@ package com.gmail.nossr50.runnables;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class mcSaveTimer implements Runnable {
|
public class SaveTimer implements Runnable {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
public mcSaveTimer(final mcMMO plugin) {
|
public SaveTimer(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
@ -2,17 +2,17 @@ package com.gmail.nossr50.runnables;
|
|||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class mcTimer implements Runnable {
|
public class SkillMonitor implements Runnable {
|
||||||
private final mcMMO plugin;
|
private final mcMMO plugin;
|
||||||
|
|
||||||
public mcTimer(final mcMMO plugin) {
|
public SkillMonitor(final mcMMO plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -21,16 +21,9 @@ public class mcTimer implements Runnable {
|
|||||||
long curTime = System.currentTimeMillis();
|
long curTime = System.currentTimeMillis();
|
||||||
|
|
||||||
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
for (Player player : plugin.getServer().getOnlinePlayers()) {
|
||||||
if (player == null) { //Is this even possible?
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
PlayerProfile PP = Users.getProfile(player);
|
PlayerProfile PP = Users.getProfile(player);
|
||||||
|
|
||||||
if (PP == null) { //Is this even possible?
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* MONITOR SKILLS
|
* MONITOR SKILLS
|
||||||
*/
|
*/
|
@ -6,13 +6,13 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Acrobatics {
|
public class Acrobatics {
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ public class Acrobatics {
|
|||||||
int damage = event.getDamage();
|
int damage = event.getDamage();
|
||||||
int health = player.getHealth();
|
int health = player.getHealth();
|
||||||
|
|
||||||
if (!mcPermissions.getInstance().gracefulRoll(player)) {
|
if (!Permissions.getInstance().gracefulRoll(player)) {
|
||||||
gracefulRoll = false;
|
gracefulRoll = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ public class Acrobatics {
|
|||||||
acrovar = acrovar * 2;
|
acrovar = acrovar * 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((acrovar > MAX_BONUS_LEVEL || random.nextInt(1000) <= acrovar) && mcPermissions.getInstance().roll(player)) {
|
if ((acrovar > MAX_BONUS_LEVEL || random.nextInt(1000) <= acrovar) && Permissions.getInstance().roll(player)) {
|
||||||
int threshold = 7;
|
int threshold = 7;
|
||||||
|
|
||||||
if (gracefulRoll) {
|
if (gracefulRoll) {
|
||||||
@ -68,10 +68,10 @@ public class Acrobatics {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (gracefulRoll) {
|
if (gracefulRoll) {
|
||||||
player.sendMessage(mcLocale.getString("Acrobatics.Ability.Proc"));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Ability.Proc"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Acrobatics.Roll.Text"));
|
player.sendMessage(LocaleLoader.getString("Acrobatics.Roll.Text"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -103,12 +103,12 @@ public class Acrobatics {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().acrobatics(defender)) {
|
if (Permissions.getInstance().acrobatics(defender)) {
|
||||||
int skillLevel = PPd.getSkillLevel(SkillType.ACROBATICS);
|
int skillLevel = PPd.getSkillLevel(SkillType.ACROBATICS);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(4000) <= skillCheck && mcPermissions.getInstance().dodge(defender)) {
|
if (random.nextInt(4000) <= skillCheck && Permissions.getInstance().dodge(defender)) {
|
||||||
defender.sendMessage(mcLocale.getString("Acrobatics.Combat.Proc"));
|
defender.sendMessage(LocaleLoader.getString("Acrobatics.Combat.Proc"));
|
||||||
|
|
||||||
if (System.currentTimeMillis() >= (5000 + PPd.getRespawnATS()) && defender.getHealth() >= 1) {
|
if (System.currentTimeMillis() >= (5000 + PPd.getRespawnATS()) && defender.getHealth() >= 1) {
|
||||||
PPd.addXP(SkillType.ACROBATICS, damage * DODGE_MODIFIER);
|
PPd.addXP(SkillType.ACROBATICS, damage * DODGE_MODIFIER);
|
||||||
|
@ -8,14 +8,14 @@ import org.bukkit.entity.Entity;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Archery {
|
public class Archery {
|
||||||
|
|
||||||
@ -52,7 +52,7 @@ public class Archery {
|
|||||||
|
|
||||||
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
|
int skillLevel = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
|
||||||
Location loc = defender.getLocation();
|
Location loc = defender.getLocation();
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(10) > 5) {
|
if (random.nextInt(10) > 5) {
|
||||||
loc.setPitch(90);
|
loc.setPitch(90);
|
||||||
@ -61,11 +61,11 @@ public class Archery {
|
|||||||
loc.setPitch(-90);
|
loc.setPitch(-90);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (random.nextInt(2000) <= skillCheck && mcPermissions.getInstance().daze(attacker)) {
|
if (random.nextInt(2000) <= skillCheck && Permissions.getInstance().daze(attacker)) {
|
||||||
defender.teleport(loc);
|
defender.teleport(loc);
|
||||||
Combat.dealDamage(defender, 4);
|
Combat.dealDamage(defender, 4);
|
||||||
defender.sendMessage(mcLocale.getString("Combat.TouchedFuzzy"));
|
defender.sendMessage(LocaleLoader.getString("Combat.TouchedFuzzy"));
|
||||||
attacker.sendMessage(mcLocale.getString("Combat.TargetDazed"));
|
attacker.sendMessage(LocaleLoader.getString("Combat.TargetDazed"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ public class Archery {
|
|||||||
*/
|
*/
|
||||||
public static void arrowRetrievalCheck(Entity entity, mcMMO plugin) {
|
public static void arrowRetrievalCheck(Entity entity, mcMMO plugin) {
|
||||||
if (plugin.arrowTracker.containsKey(entity)) {
|
if (plugin.arrowTracker.containsKey(entity)) {
|
||||||
m.mcDropItems(entity.getLocation(), new ItemStack(Material.ARROW), plugin.arrowTracker.get(entity));
|
Misc.mcDropItems(entity.getLocation(), new ItemStack(Material.ARROW), plugin.arrowTracker.get(entity));
|
||||||
}
|
}
|
||||||
|
|
||||||
plugin.arrowTracker.remove(entity);
|
plugin.arrowTracker.remove(entity);
|
||||||
|
@ -11,12 +11,12 @@ import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Axes {
|
public class Axes {
|
||||||
|
|
||||||
@ -72,7 +72,7 @@ public class Axes {
|
|||||||
|
|
||||||
PlayerProfile PPa = Users.getProfile(attacker);
|
PlayerProfile PPa = Users.getProfile(attacker);
|
||||||
int skillLevel = PPa.getSkillLevel(SkillType.AXES);
|
int skillLevel = PPa.getSkillLevel(SkillType.AXES);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(2000) <= skillCheck && !entity.isDead()){
|
if (random.nextInt(2000) <= skillCheck && !entity.isDead()){
|
||||||
int damage = event.getDamage();
|
int damage = event.getDamage();
|
||||||
@ -80,12 +80,12 @@ public class Axes {
|
|||||||
if (entity instanceof Player){
|
if (entity instanceof Player){
|
||||||
event.setDamage((int) (damage * PVP_MODIFIER));
|
event.setDamage((int) (damage * PVP_MODIFIER));
|
||||||
Player player = (Player) entity;
|
Player player = (Player) entity;
|
||||||
player.sendMessage(mcLocale.getString("Axes.Combat.CritStruck"));
|
player.sendMessage(LocaleLoader.getString("Axes.Combat.CritStruck"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
event.setDamage(damage * PVE_MODIFIER);
|
event.setDamage(damage * PVE_MODIFIER);
|
||||||
}
|
}
|
||||||
attacker.sendMessage(mcLocale.getString("Axes.Combat.CriticalHit"));
|
attacker.sendMessage(LocaleLoader.getString("Axes.Combat.CriticalHit"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ public class Axes {
|
|||||||
if (random.nextInt(100) <= GREATER_IMPACT_CHANCE) {
|
if (random.nextInt(100) <= GREATER_IMPACT_CHANCE) {
|
||||||
event.setDamage(event.getDamage() + 2);
|
event.setDamage(event.getDamage() + 2);
|
||||||
target.setVelocity(attacker.getLocation().getDirection().normalize().multiply(GREATER_IMPACT_MULTIPLIER));
|
target.setVelocity(attacker.getLocation().getDirection().normalize().multiply(GREATER_IMPACT_MULTIPLIER));
|
||||||
attacker.sendMessage(mcLocale.getString("Axes.Combat.GI.Proc"));
|
attacker.sendMessage(LocaleLoader.getString("Axes.Combat.GI.Proc"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,14 +15,14 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
|||||||
import org.bukkit.event.entity.EntityExplodeEvent;
|
import org.bukkit.event.entity.EntityExplodeEvent;
|
||||||
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
import org.bukkit.event.entity.ExplosionPrimeEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.BlockChecks;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.BlockChecks;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class BlastMining {
|
public class BlastMining {
|
||||||
|
|
||||||
@ -256,24 +256,24 @@ public class BlastMining {
|
|||||||
|
|
||||||
Block block = player.getTargetBlock(transparent, BLOCKS_AWAY);
|
Block block = player.getTargetBlock(transparent, BLOCKS_AWAY);
|
||||||
|
|
||||||
if (block.getType().equals(Material.TNT) && m.blockBreakSimulate(block, player, true) && PP.getSkillLevel(SkillType.MINING) >= 125) {
|
if (block.getType().equals(Material.TNT) && Misc.blockBreakSimulate(block, player, true) && PP.getSkillLevel(SkillType.MINING) >= 125) {
|
||||||
final double MAX_DISTANCE_AWAY = 10.0;
|
final double MAX_DISTANCE_AWAY = 10.0;
|
||||||
AbilityType ability = AbilityType.BLAST_MINING;
|
AbilityType ability = AbilityType.BLAST_MINING;
|
||||||
|
|
||||||
/* Check Cooldown */
|
/* Check Cooldown */
|
||||||
if(!Skills.cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
if(!Skills.cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + Skills.calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Send message to nearby players */
|
/* Send message to nearby players */
|
||||||
for(Player y : player.getWorld().getPlayers()) {
|
for(Player y : player.getWorld().getPlayers()) {
|
||||||
if(y != player && m.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
if(y != player && Misc.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
||||||
y.sendMessage(ability.getAbilityPlayer(player));
|
y.sendMessage(ability.getAbilityPlayer(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Mining.Blast.Boom"));
|
player.sendMessage(LocaleLoader.getString("Mining.Blast.Boom"));
|
||||||
|
|
||||||
/* Create the TNT entity */
|
/* Create the TNT entity */
|
||||||
TNTPrimed tnt = player.getWorld().spawn(block.getLocation(), TNTPrimed.class);
|
TNTPrimed tnt = player.getWorld().spawn(block.getLocation(), TNTPrimed.class);
|
||||||
|
@ -11,10 +11,10 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.spout.SpoutSounds;
|
import com.gmail.nossr50.spout.SpoutSounds;
|
||||||
import com.gmail.nossr50.Users;
|
import com.gmail.nossr50.util.Misc;
|
||||||
import com.gmail.nossr50.m;
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.LoadTreasures;
|
import com.gmail.nossr50.config.LoadTreasures;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -68,7 +68,7 @@ public class Excavation {
|
|||||||
|
|
||||||
int xp = Config.getInstance().getExcavationBaseXP();
|
int xp = Config.getInstance().getExcavationBaseXP();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().excavationTreasures(player)) {
|
if (Permissions.getInstance().excavationTreasures(player)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case DIRT:
|
case DIRT:
|
||||||
treasures = LoadTreasures.excavationFromDirt;
|
treasures = LoadTreasures.excavationFromDirt;
|
||||||
@ -114,7 +114,7 @@ public class Excavation {
|
|||||||
//Drop items
|
//Drop items
|
||||||
for (ItemStack x : is) {
|
for (ItemStack x : is) {
|
||||||
if (x != null) {
|
if (x != null) {
|
||||||
m.mcDropItem(loc, x);
|
Misc.mcDropItem(loc, x);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,16 +17,16 @@ import org.bukkit.event.player.PlayerFishEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.material.Wool;
|
import org.bukkit.material.Wool;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.config.LoadTreasures;
|
import com.gmail.nossr50.config.LoadTreasures;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
import com.gmail.nossr50.datatypes.treasure.FishingTreasure;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Fishing {
|
public class Fishing {
|
||||||
|
|
||||||
@ -136,7 +136,7 @@ public class Fishing {
|
|||||||
boolean enchanted = false;
|
boolean enchanted = false;
|
||||||
ItemStack fishingResults = theCatch.getItemStack();
|
ItemStack fishingResults = theCatch.getItemStack();
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Fishing.ItemFound"));
|
player.sendMessage(LocaleLoader.getString("Fishing.ItemFound"));
|
||||||
if (ItemChecks.isArmor(fishingResults) || ItemChecks.isTool(fishingResults)) {
|
if (ItemChecks.isArmor(fishingResults) || ItemChecks.isTool(fishingResults)) {
|
||||||
if (random.nextInt(100) <= ENCHANTMENT_CHANCE) {
|
if (random.nextInt(100) <= ENCHANTMENT_CHANCE) {
|
||||||
for (Enchantment newEnchant : Enchantment.values()) {
|
for (Enchantment newEnchant : Enchantment.values()) {
|
||||||
@ -166,7 +166,7 @@ public class Fishing {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (enchanted) {
|
if (enchanted) {
|
||||||
player.sendMessage(mcLocale.getString("Fishing.MagicFound"));
|
player.sendMessage(LocaleLoader.getString("Fishing.MagicFound"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -185,91 +185,91 @@ public class Fishing {
|
|||||||
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case BLAZE:
|
case BLAZE:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.BLAZE_ROD));
|
Misc.mcDropItem(loc, new ItemStack(Material.BLAZE_ROD));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CAVE_SPIDER:
|
case CAVE_SPIDER:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE));
|
Misc.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.STRING));
|
Misc.mcDropItem(loc, new ItemStack(Material.STRING));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CHICKEN:
|
case CHICKEN:
|
||||||
if (DROP_NUMBER > 66) {
|
if (DROP_NUMBER > 66) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.FEATHER));
|
Misc.mcDropItem(loc, new ItemStack(Material.FEATHER));
|
||||||
}
|
}
|
||||||
else if (DROP_NUMBER > 33) {
|
else if (DROP_NUMBER > 33) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.RAW_CHICKEN));
|
Misc.mcDropItem(loc, new ItemStack(Material.RAW_CHICKEN));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.EGG));
|
Misc.mcDropItem(loc, new ItemStack(Material.EGG));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COW:
|
case COW:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 99) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET));
|
Misc.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET));
|
||||||
}
|
}
|
||||||
else if (DROP_NUMBER > 50) {
|
else if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.LEATHER));
|
Misc.mcDropItem(loc, new ItemStack(Material.LEATHER));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.RAW_BEEF));
|
Misc.mcDropItem(loc, new ItemStack(Material.RAW_BEEF));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CREEPER:
|
case CREEPER:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.SULPHUR));
|
Misc.mcDropItem(loc, new ItemStack(Material.SULPHUR));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ENDERMAN:
|
case ENDERMAN:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.ENDER_PEARL));
|
Misc.mcDropItem(loc, new ItemStack(Material.ENDER_PEARL));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GHAST:
|
case GHAST:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.SULPHUR));
|
Misc.mcDropItem(loc, new ItemStack(Material.SULPHUR));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.GHAST_TEAR));
|
Misc.mcDropItem(loc, new ItemStack(Material.GHAST_TEAR));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MAGMA_CUBE:
|
case MAGMA_CUBE:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.MAGMA_CREAM));
|
Misc.mcDropItem(loc, new ItemStack(Material.MAGMA_CREAM));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MUSHROOM_COW:
|
case MUSHROOM_COW:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 99) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET));
|
Misc.mcDropItem(loc, new ItemStack(Material.MILK_BUCKET));
|
||||||
}
|
}
|
||||||
else if (DROP_NUMBER > 98) {
|
else if (DROP_NUMBER > 98) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.MUSHROOM_SOUP));
|
Misc.mcDropItem(loc, new ItemStack(Material.MUSHROOM_SOUP));
|
||||||
}
|
}
|
||||||
else if (DROP_NUMBER > 66) {
|
else if (DROP_NUMBER > 66) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.LEATHER));
|
Misc.mcDropItem(loc, new ItemStack(Material.LEATHER));
|
||||||
}
|
}
|
||||||
else if (DROP_NUMBER > 33) {
|
else if (DROP_NUMBER > 33) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.RAW_BEEF));
|
Misc.mcDropItem(loc, new ItemStack(Material.RAW_BEEF));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItems(loc, new ItemStack(Material.RED_MUSHROOM), 3);
|
Misc.mcDropItems(loc, new ItemStack(Material.RED_MUSHROOM), 3);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PIG:
|
case PIG:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.PORK));
|
Misc.mcDropItem(loc, new ItemStack(Material.PORK));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PIG_ZOMBIE:
|
case PIG_ZOMBIE:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH));
|
Misc.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.GOLD_NUGGET));
|
Misc.mcDropItem(loc, new ItemStack(Material.GOLD_NUGGET));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -283,48 +283,48 @@ public class Fishing {
|
|||||||
ItemStack theWool = wool.toItemStack();
|
ItemStack theWool = wool.toItemStack();
|
||||||
theWool.setAmount(1 + random.nextInt(6));
|
theWool.setAmount(1 + random.nextInt(6));
|
||||||
|
|
||||||
m.mcDropItem(loc, theWool);
|
Misc.mcDropItem(loc, theWool);
|
||||||
sheep.setSheared(true);
|
sheep.setSheared(true);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SKELETON:
|
case SKELETON:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.BONE));
|
Misc.mcDropItem(loc, new ItemStack(Material.BONE));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItems(loc, new ItemStack(Material.ARROW), 3);
|
Misc.mcDropItems(loc, new ItemStack(Material.ARROW), 3);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SLIME:
|
case SLIME:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.SLIME_BALL));
|
Misc.mcDropItem(loc, new ItemStack(Material.SLIME_BALL));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SNOWMAN:
|
case SNOWMAN:
|
||||||
if (DROP_NUMBER > 99) {
|
if (DROP_NUMBER > 99) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.PUMPKIN));
|
Misc.mcDropItem(loc, new ItemStack(Material.PUMPKIN));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItems(loc, new ItemStack(Material.SNOW_BALL), 5);
|
Misc.mcDropItems(loc, new ItemStack(Material.SNOW_BALL), 5);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SPIDER:
|
case SPIDER:
|
||||||
if (DROP_NUMBER > 50) {
|
if (DROP_NUMBER > 50) {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE));
|
Misc.mcDropItem(loc, new ItemStack(Material.SPIDER_EYE));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, new ItemStack(Material.STRING));
|
Misc.mcDropItem(loc, new ItemStack(Material.STRING));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SQUID:
|
case SQUID:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x0));
|
Misc.mcDropItem(loc, new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x0));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ZOMBIE:
|
case ZOMBIE:
|
||||||
m.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH));
|
Misc.mcDropItem(loc, new ItemStack(Material.ROTTEN_FLESH));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
@ -11,16 +11,16 @@ import org.bukkit.event.block.BlockBreakEvent;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.inventory.PlayerInventory;
|
import org.bukkit.inventory.PlayerInventory;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.GreenThumbTimer;
|
import com.gmail.nossr50.runnables.GreenThumbTimer;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Herbalism {
|
public class Herbalism {
|
||||||
|
|
||||||
@ -44,7 +44,7 @@ public class Herbalism {
|
|||||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||||
player.updateInventory();
|
player.updateInventory();
|
||||||
|
|
||||||
if (m.blockBreakSimulate(block, player, false)) {
|
if (Misc.blockBreakSimulate(block, player, false)) {
|
||||||
if (Config.getInstance().getHerbalismGreenThumbSmoothbrickToMossy() && type.equals(Material.SMOOTH_BRICK)) {
|
if (Config.getInstance().getHerbalismGreenThumbSmoothbrickToMossy() && type.equals(Material.SMOOTH_BRICK)) {
|
||||||
block.setData((byte) 0x1); //Set type of the brick to mossy
|
block.setData((byte) 0x1); //Set type of the brick to mossy
|
||||||
}
|
}
|
||||||
@ -156,7 +156,7 @@ public class Herbalism {
|
|||||||
mat = Material.WHEAT;
|
mat = Material.WHEAT;
|
||||||
xp = Config.getInstance().getHerbalismXPWheat();
|
xp = Config.getInstance().getHerbalismXPWheat();
|
||||||
|
|
||||||
if (Config.getInstance().getHerbalismWheatRegrowth() && mcPermissions.getInstance().greenThumbWheat(player)) {
|
if (Config.getInstance().getHerbalismWheatRegrowth() && Permissions.getInstance().greenThumbWheat(player)) {
|
||||||
greenThumbWheat(block, player, event, plugin);
|
greenThumbWheat(block, player, event, plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -227,26 +227,26 @@ public class Herbalism {
|
|||||||
|
|
||||||
if (mat == null) {
|
if (mat == null) {
|
||||||
return;
|
return;
|
||||||
} else if (mcPermissions.getInstance().herbalismDoubleDrops(player)) {
|
} else if (Permissions.getInstance().herbalismDoubleDrops(player)) {
|
||||||
ItemStack is = new ItemStack(mat);
|
ItemStack is = new ItemStack(mat);
|
||||||
|
|
||||||
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
|
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
|
||||||
if (type.equals(Material.CACTUS)) {
|
if (type.equals(Material.CACTUS)) {
|
||||||
m.mcDropItems(loc, is, catciDrops);
|
Misc.mcDropItems(loc, is, catciDrops);
|
||||||
}
|
}
|
||||||
else if (type.equals(Material.MELON_BLOCK)) {
|
else if (type.equals(Material.MELON_BLOCK)) {
|
||||||
m.mcDropItems(loc, is, 3);
|
Misc.mcDropItems(loc, is, 3);
|
||||||
m.mcRandomDropItems(loc, is, 50, 4);
|
Misc.mcRandomDropItems(loc, is, 50, 4);
|
||||||
}
|
}
|
||||||
else if (type.equals(Material.NETHER_WARTS)) {
|
else if (type.equals(Material.NETHER_WARTS)) {
|
||||||
m.mcDropItems(loc, is, 2);
|
Misc.mcDropItems(loc, is, 2);
|
||||||
m.mcRandomDropItems(loc, is, 50, 3);
|
Misc.mcRandomDropItems(loc, is, 50, 3);
|
||||||
}
|
}
|
||||||
else if (type.equals(Material.SUGAR_CANE_BLOCK)) {
|
else if (type.equals(Material.SUGAR_CANE_BLOCK)) {
|
||||||
m.mcDropItems(loc, is, caneDrops);
|
Misc.mcDropItems(loc, is, caneDrops);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m.mcDropItem(loc, is);
|
Misc.mcDropItem(loc, is);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -275,8 +275,8 @@ public class Herbalism {
|
|||||||
if (hasSeeds && PP.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1500) <= herbLevel)) {
|
if (hasSeeds && PP.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1500) <= herbLevel)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
m.mcDropItem(loc, new ItemStack(Material.WHEAT));
|
Misc.mcDropItem(loc, new ItemStack(Material.WHEAT));
|
||||||
m.mcRandomDropItems(loc, new ItemStack(Material.SEEDS), 50, 3);
|
Misc.mcRandomDropItems(loc, new ItemStack(Material.SEEDS), 50, 3);
|
||||||
|
|
||||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, PP), 1);
|
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, new GreenThumbTimer(block, PP), 1);
|
||||||
|
|
||||||
@ -305,7 +305,7 @@ public class Herbalism {
|
|||||||
greenTerra(player, block);
|
greenTerra(player, block);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("mcPlayerListener.GreenThumbFail"));
|
player.sendMessage(LocaleLoader.getString("mcPlayerListener.GreenThumbFail"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,11 +11,11 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.getspout.spoutapi.sound.SoundEffect;
|
import org.getspout.spoutapi.sound.SoundEffect;
|
||||||
import org.bukkit.enchantments.Enchantment;
|
import org.bukkit.enchantments.Enchantment;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.spout.SpoutSounds;
|
import com.gmail.nossr50.spout.SpoutSounds;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
@ -38,40 +38,40 @@ public class Mining {
|
|||||||
switch (type) {
|
switch (type) {
|
||||||
case COAL_ORE:
|
case COAL_ORE:
|
||||||
item = new ItemStack(Material.COAL, 1, (short) 0, CoalType.COAL.getData());
|
item = new ItemStack(Material.COAL, 1, (short) 0, CoalType.COAL.getData());
|
||||||
m.mcDropItem(loc, item);
|
Misc.mcDropItem(loc, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case DIAMOND_ORE:
|
case DIAMOND_ORE:
|
||||||
item = new ItemStack(Material.DIAMOND);
|
item = new ItemStack(Material.DIAMOND);
|
||||||
m.mcDropItem(loc, item);
|
Misc.mcDropItem(loc, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLOWING_REDSTONE_ORE:
|
case GLOWING_REDSTONE_ORE:
|
||||||
case REDSTONE_ORE:
|
case REDSTONE_ORE:
|
||||||
item = new ItemStack(Material.REDSTONE);
|
item = new ItemStack(Material.REDSTONE);
|
||||||
m.mcDropItems(loc, item, 4);
|
Misc.mcDropItems(loc, item, 4);
|
||||||
m.mcRandomDropItem(loc, item, 50);
|
Misc.mcRandomDropItem(loc, item, 50);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case GLOWSTONE:
|
case GLOWSTONE:
|
||||||
item = new ItemStack(Material.GLOWSTONE_DUST);
|
item = new ItemStack(Material.GLOWSTONE_DUST);
|
||||||
m.mcDropItems(loc, item, 2);
|
Misc.mcDropItems(loc, item, 2);
|
||||||
m.mcRandomDropItems(loc, item, 50, 2);
|
Misc.mcRandomDropItems(loc, item, 50, 2);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LAPIS_ORE:
|
case LAPIS_ORE:
|
||||||
item = new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x4);
|
item = new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x4);
|
||||||
m.mcDropItems(loc, item, 4);
|
Misc.mcDropItems(loc, item, 4);
|
||||||
m.mcRandomDropItems(loc, item, 50, 4);
|
Misc.mcRandomDropItems(loc, item, 50, 4);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case STONE:
|
case STONE:
|
||||||
item = new ItemStack(Material.COBBLESTONE);
|
item = new ItemStack(Material.COBBLESTONE);
|
||||||
m.mcDropItem(loc, item);
|
Misc.mcDropItem(loc, item);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
m.mcDropItem(loc, item);
|
Misc.mcDropItem(loc, item);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -167,9 +167,9 @@ public class Mining {
|
|||||||
|
|
||||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
|
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
|
||||||
|
|
||||||
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().miningDoubleDrops(player)) {
|
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && Permissions.getInstance().miningDoubleDrops(player)) {
|
||||||
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||||
m.mcDropItem(block.getLocation(), new ItemStack(block.getType()));
|
Misc.mcDropItem(block.getLocation(), new ItemStack(block.getType()));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
miningDrops(block);
|
miningDrops(block);
|
||||||
@ -215,7 +215,7 @@ public class Mining {
|
|||||||
*/
|
*/
|
||||||
public static void SuperBreakerBlockCheck(Player player, Block block) {
|
public static void SuperBreakerBlockCheck(Player player, Block block) {
|
||||||
Material type = block.getType();
|
Material type = block.getType();
|
||||||
int tier = m.getTier(player.getItemInHand());
|
int tier = Misc.getTier(player.getItemInHand());
|
||||||
int durabilityLoss = Config.getInstance().getAbilityToolDamage();
|
int durabilityLoss = Config.getInstance().getAbilityToolDamage();
|
||||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||||
|
|
||||||
|
@ -14,17 +14,17 @@ import org.bukkit.inventory.PlayerInventory;
|
|||||||
import org.getspout.spoutapi.SpoutManager;
|
import org.getspout.spoutapi.SpoutManager;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.spout.SpoutSounds;
|
import com.gmail.nossr50.spout.SpoutSounds;
|
||||||
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.events.skills.McMMOPlayerRepairCheckEvent;
|
import com.gmail.nossr50.events.skills.McMMOPlayerRepairCheckEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
public class Repair {
|
public class Repair {
|
||||||
|
|
||||||
@ -47,20 +47,20 @@ public class Repair {
|
|||||||
/*
|
/*
|
||||||
* REPAIR ARMOR
|
* REPAIR ARMOR
|
||||||
*/
|
*/
|
||||||
if (ItemChecks.isArmor(is) && Config.getInstance().getRepairArmorAllowed() && mcPermissions.getInstance().armorRepair(player)) {
|
if (ItemChecks.isArmor(is) && Config.getInstance().getRepairArmorAllowed() && Permissions.getInstance().armorRepair(player)) {
|
||||||
if (ItemChecks.isDiamondArmor(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && mcPermissions.getInstance().diamondRepair(player)) {
|
if (ItemChecks.isDiamondArmor(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && Permissions.getInstance().diamondRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isIronArmor(is) && inventory.contains(Config.getInstance().getRepairIronMaterial()) && skillLevel >= Config.getInstance().getRepairIronLevelRequirement() && mcPermissions.getInstance().ironRepair(player)) {
|
else if (ItemChecks.isIronArmor(is) && inventory.contains(Config.getInstance().getRepairIronMaterial()) && skillLevel >= Config.getInstance().getRepairIronLevelRequirement() && Permissions.getInstance().ironRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairIronMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairIronMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, true);
|
xpHandler(player, PP, is, durabilityBefore, 2, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isGoldArmor(is) && inventory.contains(Config.getInstance().getRepairGoldMaterial()) && skillLevel >= Config.getInstance().getRepairGoldLevelRequirement() && mcPermissions.getInstance().goldRepair(player)) {
|
else if (ItemChecks.isGoldArmor(is) && inventory.contains(Config.getInstance().getRepairGoldMaterial()) && skillLevel >= Config.getInstance().getRepairGoldLevelRequirement() && Permissions.getInstance().goldRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 4, true);
|
xpHandler(player, PP, is, durabilityBefore, 4, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(Config.getInstance().getRepairLeatherMaterial()) && mcPermissions.getInstance().leatherRepair(player)) {
|
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(Config.getInstance().getRepairLeatherMaterial()) && Permissions.getInstance().leatherRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairLeatherMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairLeatherMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||||
}
|
}
|
||||||
@ -72,28 +72,28 @@ public class Repair {
|
|||||||
/*
|
/*
|
||||||
* REPAIR TOOLS
|
* REPAIR TOOLS
|
||||||
*/
|
*/
|
||||||
else if (ItemChecks.isTool(is) && Config.getInstance().getRepairToolsAllowed() && mcPermissions.getInstance().toolRepair(player)) {
|
else if (ItemChecks.isTool(is) && Config.getInstance().getRepairToolsAllowed() && Permissions.getInstance().toolRepair(player)) {
|
||||||
if (ItemChecks.isStoneTool(is) && inventory.contains(Config.getInstance().getRepairStoneMaterial()) && skillLevel >= Config.getInstance().getRepairStoneLevelRequirement() && mcPermissions.getInstance().stoneRepair(player)) {
|
if (ItemChecks.isStoneTool(is) && inventory.contains(Config.getInstance().getRepairStoneMaterial()) && skillLevel >= Config.getInstance().getRepairStoneLevelRequirement() && Permissions.getInstance().stoneRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStoneMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStoneMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isWoodTool(is) && inventory.contains(Config.getInstance().getRepairWoodMaterial()) && mcPermissions.getInstance().woodRepair(player)) {
|
else if (ItemChecks.isWoodTool(is) && inventory.contains(Config.getInstance().getRepairWoodMaterial()) && Permissions.getInstance().woodRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairWoodMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairWoodMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isIronTool(is) && inventory.contains(Config.getInstance().getRepairIronMaterial()) && skillLevel >= Config.getInstance().getRepairIronLevelRequirement() && mcPermissions.getInstance().ironRepair(player)) {
|
else if (ItemChecks.isIronTool(is) && inventory.contains(Config.getInstance().getRepairIronMaterial()) && skillLevel >= Config.getInstance().getRepairIronLevelRequirement() && Permissions.getInstance().ironRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairIronMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairIronMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isDiamondTool(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && mcPermissions.getInstance().diamondRepair(player)) {
|
else if (ItemChecks.isDiamondTool(is) && inventory.contains(Config.getInstance().getRepairDiamondMaterial()) && skillLevel >= Config.getInstance().getRepairDiamondLevelRequirement() && Permissions.getInstance().diamondRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairDiamondMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isGoldTool(is) && inventory.contains(Config.getInstance().getRepairGoldMaterial()) && skillLevel >= Config.getInstance().getRepairGoldLevelRequirement() && mcPermissions.getInstance().goldRepair(player)) {
|
else if (ItemChecks.isGoldTool(is) && inventory.contains(Config.getInstance().getRepairGoldMaterial()) && skillLevel >= Config.getInstance().getRepairGoldLevelRequirement() && Permissions.getInstance().goldRepair(player)) {
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairGoldMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isStringTool(is) && inventory.contains(Config.getInstance().getRepairStringMaterial()) && skillLevel >= Config.getInstance().getRepairStringLevelRequirement() && mcPermissions.getInstance().stringRepair(player)){
|
else if (ItemChecks.isStringTool(is) && inventory.contains(Config.getInstance().getRepairStringMaterial()) && skillLevel >= Config.getInstance().getRepairStringLevelRequirement() && Permissions.getInstance().stringRepair(player)){
|
||||||
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStringMaterial()));
|
repairItem(player, is, new ItemStack(Config.getInstance().getRepairStringMaterial()));
|
||||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ public class Repair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.FullDurability"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.FullDurability"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -188,11 +188,11 @@ public class Repair {
|
|||||||
|
|
||||||
int rank = getArcaneForgingRank(Users.getProfile(player));
|
int rank = getArcaneForgingRank(Users.getProfile(player));
|
||||||
|
|
||||||
if (rank == 0 || !mcPermissions.getInstance().arcaneForging(player)) {
|
if (rank == 0 || !Permissions.getInstance().arcaneForging(player)) {
|
||||||
for (Enchantment x : enchants.keySet()) {
|
for (Enchantment x : enchants.keySet()) {
|
||||||
is.removeEnchantment(x);
|
is.removeEnchantment(x);
|
||||||
}
|
}
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Lost"));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Lost"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -219,13 +219,13 @@ public class Repair {
|
|||||||
Map<Enchantment, Integer> newEnchants = is.getEnchantments();
|
Map<Enchantment, Integer> newEnchants = is.getEnchantments();
|
||||||
|
|
||||||
if (newEnchants.isEmpty()) {
|
if (newEnchants.isEmpty()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Fail"));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Fail"));
|
||||||
}
|
}
|
||||||
else if (downgraded || newEnchants.size() < enchants.size()) {
|
else if (downgraded || newEnchants.size() < enchants.size()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Downgrade"));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Downgrade"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Arcane.Perfect"));
|
player.sendMessage(LocaleLoader.getString("Repair.Arcane.Perfect"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -352,49 +352,49 @@ public class Repair {
|
|||||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
||||||
|
|
||||||
if (is.getAmount() != 1) {
|
if (is.getAmount() != 1) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.StackedItems"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.StackedItems"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (ItemChecks.isDiamondTool(is) || ItemChecks.isDiamondArmor(is)) {
|
if (ItemChecks.isDiamondTool(is) || ItemChecks.isDiamondArmor(is)) {
|
||||||
if (skillLevel < Config.getInstance().getRepairDiamondLevelRequirement()) {
|
if (skillLevel < Config.getInstance().getRepairDiamondLevelRequirement()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptDiamond"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptDiamond"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.BLUE + m.prettyItemString(Config.getInstance().getRepairDiamondMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.BLUE + Misc.prettyItemString(Config.getInstance().getRepairDiamondMaterial()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isIronTool(is) || ItemChecks.isIronArmor(is)) {
|
else if (ItemChecks.isIronTool(is) || ItemChecks.isIronArmor(is)) {
|
||||||
if (skillLevel < Config.getInstance().getRepairIronLevelRequirement()) {
|
if (skillLevel < Config.getInstance().getRepairIronLevelRequirement()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptIron"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptIron"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(Config.getInstance().getRepairIronMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + Misc.prettyItemString(Config.getInstance().getRepairIronMaterial()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isGoldTool(is) || ItemChecks.isGoldArmor(is)) {
|
else if (ItemChecks.isGoldTool(is) || ItemChecks.isGoldArmor(is)) {
|
||||||
if (skillLevel < Config.getInstance().getRepairGoldLevelRequirement()) {
|
if (skillLevel < Config.getInstance().getRepairGoldLevelRequirement()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptGold"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptGold"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GOLD + m.prettyItemString(Config.getInstance().getRepairGoldMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.GOLD + Misc.prettyItemString(Config.getInstance().getRepairGoldMaterial()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isStoneTool(is)) {
|
else if (ItemChecks.isStoneTool(is)) {
|
||||||
if (skillLevel < Config.getInstance().getRepairStoneLevelRequirement()) {
|
if (skillLevel < Config.getInstance().getRepairStoneLevelRequirement()) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.AdeptStone"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.AdeptStone"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.GRAY + m.prettyItemString(Config.getInstance().getRepairStoneMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.GRAY + Misc.prettyItemString(Config.getInstance().getRepairStoneMaterial()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isWoodTool(is)) {
|
else if (ItemChecks.isWoodTool(is)) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.DARK_GREEN + m.prettyItemString(Config.getInstance().getRepairWoodMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.DARK_GREEN + Misc.prettyItemString(Config.getInstance().getRepairWoodMaterial()));
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isLeatherArmor(is)) {
|
else if (ItemChecks.isLeatherArmor(is)) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(Config.getInstance().getRepairLeatherMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + Misc.prettyItemString(Config.getInstance().getRepairLeatherMaterial()));
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isStringTool(is)) {
|
else if (ItemChecks.isStringTool(is)) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + m.prettyItemString(Config.getInstance().getRepairStringMaterial()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore") + " " + ChatColor.YELLOW + Misc.prettyItemString(Config.getInstance().getRepairStringMaterial()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -410,8 +410,8 @@ public class Repair {
|
|||||||
|
|
||||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
||||||
|
|
||||||
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().repairBonus(player)) {
|
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && Permissions.getInstance().repairBonus(player)) {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Skills.FeltEasy"));
|
player.sendMessage(LocaleLoader.getString("Repair.Skills.FeltEasy"));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -445,7 +445,7 @@ public class Repair {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Handle the enchants */
|
/* Handle the enchants */
|
||||||
if (Config.getInstance().getArcaneForgingEnchantLossEnabled() && !mcPermissions.getInstance().arcaneBypass(player)) {
|
if (Config.getInstance().getArcaneForgingEnchantLossEnabled() && !Permissions.getInstance().arcaneBypass(player)) {
|
||||||
addEnchants(player, item);
|
addEnchants(player, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -470,7 +470,7 @@ public class Repair {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Repair.Listener.Anvil"));
|
player.sendMessage(LocaleLoader.getString("Repair.Listener.Anvil"));
|
||||||
}
|
}
|
||||||
|
|
||||||
PP.togglePlacedAnvil();
|
PP.togglePlacedAnvil();
|
||||||
|
@ -9,20 +9,20 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.getspout.spoutapi.SpoutManager;
|
import org.getspout.spoutapi.SpoutManager;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Leaderboard;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.spout.SpoutStuff;
|
import com.gmail.nossr50.spout.SpoutStuff;
|
||||||
|
import com.gmail.nossr50.util.Leaderboard;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.PlayerStat;
|
import com.gmail.nossr50.datatypes.PlayerStat;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.datatypes.ToolType;
|
import com.gmail.nossr50.datatypes.ToolType;
|
||||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
public class Skills {
|
public class Skills {
|
||||||
|
|
||||||
@ -106,7 +106,7 @@ public class Skills {
|
|||||||
if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
||||||
if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) {
|
if (skill != SkillType.WOODCUTTING && skill != SkillType.AXES) {
|
||||||
if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -146,7 +146,7 @@ public class Skills {
|
|||||||
player.sendMessage(ability.getAbilityOff());
|
player.sendMessage(ability.getAbilityOff());
|
||||||
|
|
||||||
for (Player y : player.getWorld().getPlayers()) {
|
for (Player y : player.getWorld().getPlayers()) {
|
||||||
if (y != player && m.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
if (y != player && Misc.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
||||||
y.sendMessage(ability.getAbilityPlayerOff(player));
|
y.sendMessage(ability.getAbilityPlayerOff(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public class Skills {
|
|||||||
if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
if (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||||
|
|
||||||
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||||
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (m.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
|
if ((skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) && (Misc.getPowerLevelCap() >= PP.getPowerLevel() + 1)) {
|
||||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||||
skillups++;
|
skillups++;
|
||||||
PP.skillUp(skillType, 1);
|
PP.skillUp(skillType, 1);
|
||||||
@ -206,7 +206,7 @@ public class Skills {
|
|||||||
ProcessLeaderboardUpdate(SkillType.ALL, player);
|
ProcessLeaderboardUpdate(SkillType.ALL, player);
|
||||||
}
|
}
|
||||||
|
|
||||||
String capitalized = m.getCapitalized(skillType.toString());
|
String capitalized = Misc.getCapitalized(skillType.toString());
|
||||||
|
|
||||||
/* Spout Stuff */
|
/* Spout Stuff */
|
||||||
if (Config.getInstance().spoutEnabled && player instanceof SpoutPlayer) {
|
if (Config.getInstance().spoutEnabled && player instanceof SpoutPlayer) {
|
||||||
@ -225,11 +225,11 @@ public class Skills {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString(capitalized + ".Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
|
player.sendMessage(LocaleLoader.getString(capitalized + ".Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString(capitalized + ".Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
|
player.sendMessage(LocaleLoader.getString(capitalized + ".Skillup", new Object[] {String.valueOf(skillups), PP.getSkillLevel(skillType)}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -296,11 +296,11 @@ public class Skills {
|
|||||||
* @return true if the player has combat skills, false otherwise
|
* @return true if the player has combat skills, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean hasCombatSkills(Player player) {
|
public static boolean hasCombatSkills(Player player) {
|
||||||
if (mcPermissions.getInstance().axes(player)
|
if (Permissions.getInstance().axes(player)
|
||||||
|| mcPermissions.getInstance().archery(player)
|
|| Permissions.getInstance().archery(player)
|
||||||
|| mcPermissions.getInstance().swords(player)
|
|| Permissions.getInstance().swords(player)
|
||||||
|| mcPermissions.getInstance().taming(player)
|
|| Permissions.getInstance().taming(player)
|
||||||
|| mcPermissions.getInstance().unarmed(player)) {
|
|| Permissions.getInstance().unarmed(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -315,11 +315,11 @@ public class Skills {
|
|||||||
* @return true if the player has gathering skills, false otherwise
|
* @return true if the player has gathering skills, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean hasGatheringSkills(Player player) {
|
public static boolean hasGatheringSkills(Player player) {
|
||||||
if (mcPermissions.getInstance().excavation(player)
|
if (Permissions.getInstance().excavation(player)
|
||||||
|| mcPermissions.getInstance().fishing(player)
|
|| Permissions.getInstance().fishing(player)
|
||||||
|| mcPermissions.getInstance().herbalism(player)
|
|| Permissions.getInstance().herbalism(player)
|
||||||
|| mcPermissions.getInstance().mining(player)
|
|| Permissions.getInstance().mining(player)
|
||||||
|| mcPermissions.getInstance().woodcutting(player)) {
|
|| Permissions.getInstance().woodcutting(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -334,7 +334,7 @@ public class Skills {
|
|||||||
* @return true if the player has misc skills, false otherwise
|
* @return true if the player has misc skills, false otherwise
|
||||||
*/
|
*/
|
||||||
public static boolean hasMiscSkills(Player player) {
|
public static boolean hasMiscSkills(Player player) {
|
||||||
if (mcPermissions.getInstance().acrobatics(player) || mcPermissions.getInstance().repair(player)) {
|
if (Permissions.getInstance().acrobatics(player) || Permissions.getInstance().repair(player)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@ -377,7 +377,7 @@ public class Skills {
|
|||||||
*/
|
*/
|
||||||
if (type == SkillType.WOODCUTTING || type == SkillType.AXES) {
|
if (type == SkillType.WOODCUTTING || type == SkillType.AXES) {
|
||||||
if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
if (!PP.getAbilityMode(ability) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
player.sendMessage(LocaleLoader.getString("Skills.TooTired") + ChatColor.YELLOW + " (" + calculateTimeLeft(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown()) + "s)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -388,7 +388,7 @@ public class Skills {
|
|||||||
player.sendMessage(ability.getAbilityOn());
|
player.sendMessage(ability.getAbilityOn());
|
||||||
|
|
||||||
for (Player y : player.getWorld().getPlayers()) {
|
for (Player y : player.getWorld().getPlayers()) {
|
||||||
if (y != player && m.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
if (y != player && Misc.isNear(player.getLocation(), y.getLocation(), MAX_DISTANCE_AWAY)) {
|
||||||
y.sendMessage(ability.getAbilityPlayer(player));
|
y.sendMessage(ability.getAbilityPlayer(player));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -420,7 +420,7 @@ public class Skills {
|
|||||||
case GIGA_DRILL_BREAKER:
|
case GIGA_DRILL_BREAKER:
|
||||||
case SUPER_BREAKER:
|
case SUPER_BREAKER:
|
||||||
case LEAF_BLOWER:
|
case LEAF_BLOWER:
|
||||||
if (!m.blockBreakSimulate(block, player, true)) {
|
if (!Misc.blockBreakSimulate(block, player, true)) {
|
||||||
activate = false;
|
activate = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -9,17 +9,17 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.entity.Wolf;
|
import org.bukkit.entity.Wolf;
|
||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.ItemChecks;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
import com.gmail.nossr50.runnables.mcBleedTimer;
|
import com.gmail.nossr50.runnables.BleedTimer;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.ItemChecks;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Swords {
|
public class Swords {
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class Swords {
|
|||||||
|
|
||||||
PlayerProfile PPa = Users.getProfile(attacker);
|
PlayerProfile PPa = Users.getProfile(attacker);
|
||||||
int skillLevel = PPa.getSkillLevel(SkillType.SWORDS);
|
int skillLevel = PPa.getSkillLevel(SkillType.SWORDS);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(1000) <= skillCheck && !entity.isDead()) {
|
if (random.nextInt(1000) <= skillCheck && !entity.isDead()) {
|
||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
@ -71,9 +71,9 @@ public class Swords {
|
|||||||
Users.getProfile(target).addBleedTicks(bleedTicks);
|
Users.getProfile(target).addBleedTicks(bleedTicks);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mcBleedTimer.add(entity);
|
BleedTimer.add(entity);
|
||||||
}
|
}
|
||||||
attacker.sendMessage(mcLocale.getString("Swords.Combat.Bleeding"));
|
attacker.sendMessage(LocaleLoader.getString("Swords.Combat.Bleeding"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -95,19 +95,19 @@ public class Swords {
|
|||||||
Player defender = (Player) target;
|
Player defender = (Player) target;
|
||||||
PlayerProfile PPd = Users.getProfile(defender);
|
PlayerProfile PPd = Users.getProfile(defender);
|
||||||
|
|
||||||
if (ItemChecks.isSword(defender.getItemInHand()) && mcPermissions.getInstance().counterAttack(defender)) {
|
if (ItemChecks.isSword(defender.getItemInHand()) && Permissions.getInstance().counterAttack(defender)) {
|
||||||
final int MAX_BONUS_LEVEL = 600;
|
final int MAX_BONUS_LEVEL = 600;
|
||||||
final int COUNTER_ATTACK_MODIFIER = 2;
|
final int COUNTER_ATTACK_MODIFIER = 2;
|
||||||
|
|
||||||
int skillLevel = PPd.getSkillLevel(SkillType.SWORDS);
|
int skillLevel = PPd.getSkillLevel(SkillType.SWORDS);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(2000) <= skillCheck) {
|
if (random.nextInt(2000) <= skillCheck) {
|
||||||
Combat.dealDamage((LivingEntity) attacker, event.getDamage() / COUNTER_ATTACK_MODIFIER);
|
Combat.dealDamage((LivingEntity) attacker, event.getDamage() / COUNTER_ATTACK_MODIFIER);
|
||||||
defender.sendMessage(mcLocale.getString("Swords.Combat.Countered"));
|
defender.sendMessage(LocaleLoader.getString("Swords.Combat.Countered"));
|
||||||
|
|
||||||
if (attacker instanceof Player) {
|
if (attacker instanceof Player) {
|
||||||
((Player) attacker).sendMessage(mcLocale.getString("Swords.Combat.Counter.Hit"));
|
((Player) attacker).sendMessage(LocaleLoader.getString("Swords.Combat.Counter.Hit"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -18,15 +18,15 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
|||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
import org.bukkit.metadata.FixedMetadataValue;
|
import org.bukkit.metadata.FixedMetadataValue;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.runnables.mcBleedTimer;
|
import com.gmail.nossr50.runnables.BleedTimer;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Taming {
|
public class Taming {
|
||||||
|
|
||||||
@ -94,14 +94,14 @@ public class Taming {
|
|||||||
if (entity instanceof Player) {
|
if (entity instanceof Player) {
|
||||||
Player target = (Player) entity;
|
Player target = (Player) entity;
|
||||||
|
|
||||||
target.sendMessage(mcLocale.getString("Combat.StruckByGore"));
|
target.sendMessage(LocaleLoader.getString("Combat.StruckByGore"));
|
||||||
Users.getProfile(target).addBleedTicks(2);
|
Users.getProfile(target).addBleedTicks(2);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
mcBleedTimer.add((LivingEntity) entity);
|
BleedTimer.add((LivingEntity) entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
master.sendMessage(mcLocale.getString("Combat.Gore"));
|
master.sendMessage(LocaleLoader.getString("Combat.Gore"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -147,20 +147,20 @@ public class Taming {
|
|||||||
case CONTACT:
|
case CONTACT:
|
||||||
case LAVA:
|
case LAVA:
|
||||||
case FIRE:
|
case FIRE:
|
||||||
if (mcPermissions.getInstance().environmentallyAware(master)) {
|
if (Permissions.getInstance().environmentallyAware(master)) {
|
||||||
if (skillLevel >= ENVIRONMENTALLY_AWARE_LEVEL) {
|
if (skillLevel >= ENVIRONMENTALLY_AWARE_LEVEL) {
|
||||||
if (event.getDamage() >= wolf.getHealth()) {
|
if (event.getDamage() >= wolf.getHealth()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
wolf.teleport(master.getLocation());
|
wolf.teleport(master.getLocation());
|
||||||
master.sendMessage(mcLocale.getString("Taming.Listener.Wolf"));
|
master.sendMessage(LocaleLoader.getString("Taming.Listener.Wolf"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FALL:
|
case FALL:
|
||||||
if (mcPermissions.getInstance().environmentallyAware(master)) {
|
if (Permissions.getInstance().environmentallyAware(master)) {
|
||||||
if (skillLevel >= ENVIRONMENTALLY_AWARE_LEVEL) {
|
if (skillLevel >= ENVIRONMENTALLY_AWARE_LEVEL) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
@ -169,7 +169,7 @@ public class Taming {
|
|||||||
|
|
||||||
/* Thick Fur */
|
/* Thick Fur */
|
||||||
case FIRE_TICK:
|
case FIRE_TICK:
|
||||||
if (mcPermissions.getInstance().thickFur(master)) {
|
if (Permissions.getInstance().thickFur(master)) {
|
||||||
if(skillLevel >= THICK_FUR_LEVEL) {
|
if(skillLevel >= THICK_FUR_LEVEL) {
|
||||||
wolf.setFireTicks(0);
|
wolf.setFireTicks(0);
|
||||||
}
|
}
|
||||||
@ -178,7 +178,7 @@ public class Taming {
|
|||||||
|
|
||||||
case ENTITY_ATTACK:
|
case ENTITY_ATTACK:
|
||||||
case PROJECTILE:
|
case PROJECTILE:
|
||||||
if (mcPermissions.getInstance().thickFur(master)) {
|
if (Permissions.getInstance().thickFur(master)) {
|
||||||
if (skillLevel >= THICK_FUR_LEVEL) {
|
if (skillLevel >= THICK_FUR_LEVEL) {
|
||||||
event.setDamage(event.getDamage() / THICK_FUR_MODIFIER);
|
event.setDamage(event.getDamage() / THICK_FUR_MODIFIER);
|
||||||
}
|
}
|
||||||
@ -188,7 +188,7 @@ public class Taming {
|
|||||||
/* Shock Proof */
|
/* Shock Proof */
|
||||||
case ENTITY_EXPLOSION:
|
case ENTITY_EXPLOSION:
|
||||||
case BLOCK_EXPLOSION:
|
case BLOCK_EXPLOSION:
|
||||||
if (mcPermissions.getInstance().shockProof(master)) {
|
if (Permissions.getInstance().shockProof(master)) {
|
||||||
if (skillLevel >= SHOCK_PROOF_LEVEL) {
|
if (skillLevel >= SHOCK_PROOF_LEVEL) {
|
||||||
event.setDamage(event.getDamage() / SHOCK_PROOF_MODIFIER);
|
event.setDamage(event.getDamage() / SHOCK_PROOF_MODIFIER);
|
||||||
}
|
}
|
||||||
@ -232,11 +232,11 @@ public class Taming {
|
|||||||
if (x.getType().equals(type)) {
|
if (x.getType().equals(type)) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case WOLF:
|
case WOLF:
|
||||||
player.sendMessage(mcLocale.getString("Taming.Summon.Fail.Wolf"));
|
player.sendMessage(LocaleLoader.getString("Taming.Summon.Fail.Wolf"));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
case OCELOT:
|
case OCELOT:
|
||||||
player.sendMessage(mcLocale.getString("Taming.Summon.Fail.Ocelot"));
|
player.sendMessage(LocaleLoader.getString("Taming.Summon.Fail.Ocelot"));
|
||||||
return;
|
return;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
@ -258,10 +258,10 @@ public class Taming {
|
|||||||
}
|
}
|
||||||
|
|
||||||
player.setItemInHand(new ItemStack(summonItem, item.getAmount() - summonAmount));
|
player.setItemInHand(new ItemStack(summonItem, item.getAmount() - summonAmount));
|
||||||
player.sendMessage(mcLocale.getString("Taming.Summon.Complete"));
|
player.sendMessage(LocaleLoader.getString("Taming.Summon.Complete"));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(summonItem.getId()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + Misc.prettyItemString(summonItem.getId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -276,15 +276,15 @@ public class Taming {
|
|||||||
public static void beastLore(EntityDamageByEntityEvent event, LivingEntity target, Player inspector) {
|
public static void beastLore(EntityDamageByEntityEvent event, LivingEntity target, Player inspector) {
|
||||||
if (target instanceof Tameable) {
|
if (target instanceof Tameable) {
|
||||||
Tameable beast = (Tameable) target;
|
Tameable beast = (Tameable) target;
|
||||||
String message = mcLocale.getString("Combat.BeastLore") + " ";
|
String message = LocaleLoader.getString("Combat.BeastLore") + " ";
|
||||||
int health = target.getHealth();
|
int health = target.getHealth();
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
|
||||||
if (beast.isTamed()) {
|
if (beast.isTamed()) {
|
||||||
message = message.concat(mcLocale.getString("Combat.BeastLoreOwner", new Object[] {getOwnerName(beast)}) + " ");
|
message = message.concat(LocaleLoader.getString("Combat.BeastLoreOwner", new Object[] {getOwnerName(beast)}) + " ");
|
||||||
}
|
}
|
||||||
|
|
||||||
message = message.concat(mcLocale.getString("Combat.BeastLoreHealth", new Object[] {health, target.getMaxHealth()}));
|
message = message.concat(LocaleLoader.getString("Combat.BeastLoreHealth", new Object[] {health, target.getMaxHealth()}));
|
||||||
inspector.sendMessage(message);
|
inspector.sendMessage(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -8,12 +8,12 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class Unarmed {
|
public class Unarmed {
|
||||||
|
|
||||||
@ -49,15 +49,15 @@ public class Unarmed {
|
|||||||
|
|
||||||
PlayerProfile PPa = Users.getProfile(attacker);
|
PlayerProfile PPa = Users.getProfile(attacker);
|
||||||
int skillLevel = PPa.getSkillLevel(SkillType.UNARMED);
|
int skillLevel = PPa.getSkillLevel(SkillType.UNARMED);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
ItemStack inHand = defender.getItemInHand();
|
ItemStack inHand = defender.getItemInHand();
|
||||||
|
|
||||||
if (!inHand.getType().equals(Material.AIR)) {
|
if (!inHand.getType().equals(Material.AIR)) {
|
||||||
if (random.nextInt(3000) <= skillCheck && ironGrip(defender, attacker)) {
|
if (random.nextInt(3000) <= skillCheck && ironGrip(defender, attacker)) {
|
||||||
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
|
defender.sendMessage(LocaleLoader.getString("Skills.Disarmed"));
|
||||||
|
|
||||||
m.mcDropItem(defender.getLocation(), inHand);
|
Misc.mcDropItem(defender.getLocation(), inHand);
|
||||||
defender.setItemInHand(new ItemStack(Material.AIR));
|
defender.setItemInHand(new ItemStack(Material.AIR));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -73,11 +73,11 @@ public class Unarmed {
|
|||||||
final int MAX_BONUS_LEVEL = 1000;
|
final int MAX_BONUS_LEVEL = 1000;
|
||||||
|
|
||||||
int skillLevel = Users.getProfile(defender).getSkillLevel(SkillType.UNARMED);
|
int skillLevel = Users.getProfile(defender).getSkillLevel(SkillType.UNARMED);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(2000) <= skillCheck && mcPermissions.getInstance().deflect(defender)) {
|
if (random.nextInt(2000) <= skillCheck && Permissions.getInstance().deflect(defender)) {
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect"));
|
defender.sendMessage(LocaleLoader.getString("Combat.ArrowDeflect"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ public class Unarmed {
|
|||||||
|
|
||||||
PlayerProfile PPd = Users.getProfile(defender);
|
PlayerProfile PPd = Users.getProfile(defender);
|
||||||
int skillLevel = PPd.getSkillLevel(SkillType.UNARMED);
|
int skillLevel = PPd.getSkillLevel(SkillType.UNARMED);
|
||||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
int skillCheck = Misc.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||||
|
|
||||||
if (random.nextInt(1000) <= skillCheck) {
|
if (random.nextInt(1000) <= skillCheck) {
|
||||||
defender.sendMessage(ChatColor.GREEN + "Your iron grip kept you from being disarmed!"); //TODO: Use locale
|
defender.sendMessage(ChatColor.GREEN + "Your iron grip kept you from being disarmed!"); //TODO: Use locale
|
||||||
|
@ -11,17 +11,17 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
import org.bukkit.material.Tree;
|
import org.bukkit.material.Tree;
|
||||||
import org.bukkit.event.block.BlockBreakEvent;
|
import org.bukkit.event.block.BlockBreakEvent;
|
||||||
|
|
||||||
import com.gmail.nossr50.Combat;
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.mcPermissions;
|
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.spout.SpoutSounds;
|
import com.gmail.nossr50.spout.SpoutSounds;
|
||||||
|
import com.gmail.nossr50.util.Combat;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Permissions;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
import org.getspout.spoutapi.sound.SoundEffect;
|
import org.getspout.spoutapi.sound.SoundEffect;
|
||||||
|
|
||||||
@ -54,7 +54,7 @@ public class WoodCutting {
|
|||||||
*/
|
*/
|
||||||
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP) {
|
private static void removeBlocks(ArrayList<Block> toBeFelled, Player player, PlayerProfile PP) {
|
||||||
if (toBeFelled.size() >= Config.getInstance().getTreeFellerThreshold()) {
|
if (toBeFelled.size() >= Config.getInstance().getTreeFellerThreshold()) {
|
||||||
player.sendMessage(mcLocale.getString("Woodcutting.Skills.TreeFellerThreshold"));
|
player.sendMessage(LocaleLoader.getString("Woodcutting.Skills.TreeFellerThreshold"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +67,7 @@ public class WoodCutting {
|
|||||||
|
|
||||||
/* This is to prevent using wood axes everytime you tree fell */
|
/* This is to prevent using wood axes everytime you tree fell */
|
||||||
if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) {
|
if ((inHand.getDurability() + durabilityLoss >= inHand.getType().getMaxDurability()) || inHand.getType().equals(Material.AIR)) {
|
||||||
player.sendMessage(mcLocale.getString("Woodcutting.Skills.TreeFeller.Splinter"));
|
player.sendMessage(LocaleLoader.getString("Woodcutting.Skills.TreeFeller.Splinter"));
|
||||||
|
|
||||||
int health = player.getHealth();
|
int health = player.getHealth();
|
||||||
|
|
||||||
@ -85,7 +85,7 @@ public class WoodCutting {
|
|||||||
ItemStack jungle = new ItemStack(Material.LOG, 1, (short) 0, TreeSpecies.JUNGLE.getData());
|
ItemStack jungle = new ItemStack(Material.LOG, 1, (short) 0, TreeSpecies.JUNGLE.getData());
|
||||||
|
|
||||||
for (Block x : toBeFelled) {
|
for (Block x : toBeFelled) {
|
||||||
if (m.blockBreakSimulate(x, player, true)) {
|
if (Misc.blockBreakSimulate(x, player, true)) {
|
||||||
if (x.getType() == Material.LOG) {
|
if (x.getType() == Material.LOG) {
|
||||||
Tree tree = (Tree) x.getState().getData();
|
Tree tree = (Tree) x.getState().getData();
|
||||||
TreeSpecies species = tree.getSpecies();
|
TreeSpecies species = tree.getSpecies();
|
||||||
@ -141,13 +141,13 @@ public class WoodCutting {
|
|||||||
x.setType(Material.AIR);
|
x.setType(Material.AIR);
|
||||||
|
|
||||||
/* Drop the block */
|
/* Drop the block */
|
||||||
m.mcDropItem(x.getLocation(), item);
|
Misc.mcDropItem(x.getLocation(), item);
|
||||||
}
|
}
|
||||||
else if (x.getType() == Material.LEAVES) {
|
else if (x.getType() == Material.LEAVES) {
|
||||||
final int SAPLING_DROP_CHANCE = 10;
|
final int SAPLING_DROP_CHANCE = 10;
|
||||||
|
|
||||||
item = new ItemStack(Material.SAPLING, 1, (short) 0, (byte) (x.getData() & 3)); //Drop the right type of sapling
|
item = new ItemStack(Material.SAPLING, 1, (short) 0, (byte) (x.getData() & 3)); //Drop the right type of sapling
|
||||||
m.mcRandomDropItem(x.getLocation(), item, SAPLING_DROP_CHANCE);
|
Misc.mcRandomDropItem(x.getLocation(), item, SAPLING_DROP_CHANCE);
|
||||||
|
|
||||||
//Remove the block
|
//Remove the block
|
||||||
x.setData((byte) 0);
|
x.setData((byte) 0);
|
||||||
@ -258,9 +258,9 @@ public class WoodCutting {
|
|||||||
byte type = block.getData();
|
byte type = block.getData();
|
||||||
Material mat = Material.getMaterial(block.getTypeId());
|
Material mat = Material.getMaterial(block.getTypeId());
|
||||||
|
|
||||||
if ((skillLevel > MAX_SKILL_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().woodcuttingDoubleDrops(player)) {
|
if ((skillLevel > MAX_SKILL_LEVEL || random.nextInt(1000) <= skillLevel) && Permissions.getInstance().woodcuttingDoubleDrops(player)) {
|
||||||
ItemStack item = new ItemStack(mat, 1, (short) 0, type);
|
ItemStack item = new ItemStack(mat, 1, (short) 0, type);
|
||||||
m.mcDropItem(block.getLocation(), item);
|
Misc.mcDropItem(block.getLocation(), item);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -20,8 +20,6 @@ import org.getspout.spoutapi.SpoutManager;
|
|||||||
import org.getspout.spoutapi.keyboard.Keyboard;
|
import org.getspout.spoutapi.keyboard.Keyboard;
|
||||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||||
|
|
||||||
import com.gmail.nossr50.Users;
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.mcMMO;
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.HUDmmo;
|
import com.gmail.nossr50.datatypes.HUDmmo;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -30,6 +28,8 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.listeners.SpoutInputListener;
|
import com.gmail.nossr50.listeners.SpoutInputListener;
|
||||||
import com.gmail.nossr50.listeners.SpoutListener;
|
import com.gmail.nossr50.listeners.SpoutListener;
|
||||||
import com.gmail.nossr50.listeners.SpoutScreenListener;
|
import com.gmail.nossr50.listeners.SpoutScreenListener;
|
||||||
|
import com.gmail.nossr50.util.Misc;
|
||||||
|
import com.gmail.nossr50.util.Users;
|
||||||
|
|
||||||
public class SpoutStuff {
|
public class SpoutStuff {
|
||||||
private static mcMMO plugin = mcMMO.p;
|
private static mcMMO plugin = mcMMO.p;
|
||||||
@ -118,8 +118,8 @@ public class SpoutStuff {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
String standardFileName = m.getCapitalized(y.toString())+".png";
|
String standardFileName = Misc.getCapitalized(y.toString())+".png";
|
||||||
String retroFileName = m.getCapitalized(y.toString())+"_r.png";
|
String retroFileName = Misc.getCapitalized(y.toString())+"_r.png";
|
||||||
|
|
||||||
writeFile(standardFileName, hudStandardDirectory);
|
writeFile(standardFileName, hudStandardDirectory);
|
||||||
writeFile(retroFileName, hudRetroDirectory);
|
writeFile(retroFileName, hudRetroDirectory);
|
||||||
@ -179,8 +179,8 @@ public class SpoutStuff {
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
files.add(new File(hudStandardDirectory + m.getCapitalized(y.toString()) + ".png"));
|
files.add(new File(hudStandardDirectory + Misc.getCapitalized(y.toString()) + ".png"));
|
||||||
files.add(new File(hudRetroDirectory + m.getCapitalized(y.toString()) + "_r.png"));
|
files.add(new File(hudRetroDirectory + Misc.getCapitalized(y.toString()) + "_r.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Blank icons */
|
/* Blank icons */
|
||||||
@ -544,7 +544,7 @@ public class SpoutStuff {
|
|||||||
}
|
}
|
||||||
|
|
||||||
//TODO: Use Locale
|
//TODO: Use Locale
|
||||||
sPlayer.sendNotification(ChatColor.GREEN + "Level Up!", ChatColor.YELLOW + m.getCapitalized(skillType.toString()) + ChatColor.DARK_AQUA + " (" + ChatColor.GREEN + PP.getSkillLevel(skillType) + ChatColor.DARK_AQUA + ")", mat);
|
sPlayer.sendNotification(ChatColor.GREEN + "Level Up!", ChatColor.YELLOW + Misc.getCapitalized(skillType.toString()) + ChatColor.DARK_AQUA + " (" + ChatColor.GREEN + PP.getSkillLevel(skillType) + ChatColor.DARK_AQUA + ")", mat);
|
||||||
SpoutSounds.playLevelUpNoise(sPlayer, plugin);
|
SpoutSounds.playLevelUpNoise(sPlayer, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
import org.bukkit.entity.AnimalTamer;
|
import org.bukkit.entity.AnimalTamer;
|
||||||
@ -15,6 +15,7 @@ import org.bukkit.event.entity.EntityDamageEvent;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.AbilityType;
|
import com.gmail.nossr50.datatypes.AbilityType;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -22,10 +23,10 @@ import com.gmail.nossr50.datatypes.SkillType;
|
|||||||
import com.gmail.nossr50.datatypes.ToolType;
|
import com.gmail.nossr50.datatypes.ToolType;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.party.Party;
|
import com.gmail.nossr50.party.Party;
|
||||||
import com.gmail.nossr50.runnables.GainXp;
|
import com.gmail.nossr50.runnables.GainXp;
|
||||||
import com.gmail.nossr50.runnables.mcBleedTimer;
|
import com.gmail.nossr50.runnables.BleedTimer;
|
||||||
import com.gmail.nossr50.skills.Acrobatics;
|
import com.gmail.nossr50.skills.Acrobatics;
|
||||||
import com.gmail.nossr50.skills.Archery;
|
import com.gmail.nossr50.skills.Archery;
|
||||||
import com.gmail.nossr50.skills.Axes;
|
import com.gmail.nossr50.skills.Axes;
|
||||||
@ -60,52 +61,52 @@ public class Combat {
|
|||||||
|
|
||||||
combatAbilityChecks(attacker);
|
combatAbilityChecks(attacker);
|
||||||
|
|
||||||
if (ItemChecks.isSword(itemInHand) && mcPermissions.getInstance().swords(attacker)) {
|
if (ItemChecks.isSword(itemInHand) && Permissions.getInstance().swords(attacker)) {
|
||||||
if (!mcBleedTimer.contains(target) && mcPermissions.getInstance().swordsBleed(attacker)) {
|
if (!BleedTimer.contains(target) && Permissions.getInstance().swordsBleed(attacker)) {
|
||||||
Swords.bleedCheck(attacker, target, plugin);
|
Swords.bleedCheck(attacker, target, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES) && mcPermissions.getInstance().serratedStrikes(attacker)) {
|
if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES) && Permissions.getInstance().serratedStrikes(attacker)) {
|
||||||
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.SWORDS);
|
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.SWORDS);
|
||||||
}
|
}
|
||||||
|
|
||||||
startGainXp(attacker, PPa, target, SkillType.SWORDS, plugin);
|
startGainXp(attacker, PPa, target, SkillType.SWORDS, plugin);
|
||||||
}
|
}
|
||||||
else if (ItemChecks.isAxe(itemInHand) && mcPermissions.getInstance().axes(attacker)) {
|
else if (ItemChecks.isAxe(itemInHand) && Permissions.getInstance().axes(attacker)) {
|
||||||
if (mcPermissions.getInstance().axeBonus(attacker)) {
|
if (Permissions.getInstance().axeBonus(attacker)) {
|
||||||
Axes.axesBonus(attacker, event);
|
Axes.axesBonus(attacker, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().criticalHit(attacker)) {
|
if (Permissions.getInstance().criticalHit(attacker)) {
|
||||||
Axes.axeCriticalCheck(attacker, event);
|
Axes.axeCriticalCheck(attacker, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().impact(attacker)) {
|
if (Permissions.getInstance().impact(attacker)) {
|
||||||
Axes.impact(attacker, target, event);
|
Axes.impact(attacker, target, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER) && mcPermissions.getInstance().skullSplitter(attacker)) {
|
if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER) && Permissions.getInstance().skullSplitter(attacker)) {
|
||||||
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.AXES);
|
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.AXES);
|
||||||
}
|
}
|
||||||
|
|
||||||
startGainXp(attacker, PPa, target, SkillType.AXES, plugin);
|
startGainXp(attacker, PPa, target, SkillType.AXES, plugin);
|
||||||
}
|
}
|
||||||
else if (itemInHand.getType().equals(Material.AIR) && mcPermissions.getInstance().unarmed(attacker)) {
|
else if (itemInHand.getType().equals(Material.AIR) && Permissions.getInstance().unarmed(attacker)) {
|
||||||
if (mcPermissions.getInstance().unarmedBonus(attacker)) {
|
if (Permissions.getInstance().unarmedBonus(attacker)) {
|
||||||
Unarmed.unarmedBonus(PPa, event);
|
Unarmed.unarmedBonus(PPa, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (PPa.getAbilityMode(AbilityType.BERSERK) && mcPermissions.getInstance().berserk(attacker)) {
|
if (PPa.getAbilityMode(AbilityType.BERSERK) && Permissions.getInstance().berserk(attacker)) {
|
||||||
event.setDamage((int) (event.getDamage() * 1.5));
|
event.setDamage((int) (event.getDamage() * 1.5));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (targetType.equals(EntityType.PLAYER) && mcPermissions.getInstance().disarm(attacker)) {
|
if (targetType.equals(EntityType.PLAYER) && Permissions.getInstance().disarm(attacker)) {
|
||||||
Unarmed.disarmProcCheck(attacker, (Player) target);
|
Unarmed.disarmProcCheck(attacker, (Player) target);
|
||||||
}
|
}
|
||||||
|
|
||||||
startGainXp(attacker, PPa, target, SkillType.UNARMED, plugin);
|
startGainXp(attacker, PPa, target, SkillType.UNARMED, plugin);
|
||||||
}
|
}
|
||||||
else if (itemInHand.getType().equals(Material.BONE) && mcPermissions.getInstance().beastLore(attacker)) {
|
else if (itemInHand.getType().equals(Material.BONE) && Permissions.getInstance().beastLore(attacker)) {
|
||||||
Taming.beastLore(event, target, attacker);
|
Taming.beastLore(event, target, attacker);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -117,16 +118,16 @@ public class Combat {
|
|||||||
Player master = (Player) wolf.getOwner();
|
Player master = (Player) wolf.getOwner();
|
||||||
PlayerProfile PPo = Users.getProfile(master);
|
PlayerProfile PPo = Users.getProfile(master);
|
||||||
|
|
||||||
if (mcPermissions.getInstance().taming(master)) {
|
if (Permissions.getInstance().taming(master)) {
|
||||||
if (mcPermissions.getInstance().fastFoodService(master)) {
|
if (Permissions.getInstance().fastFoodService(master)) {
|
||||||
Taming.fastFoodService(PPo, wolf, event);
|
Taming.fastFoodService(PPo, wolf, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().sharpenedclaws(master)) {
|
if (Permissions.getInstance().sharpenedclaws(master)) {
|
||||||
Taming.sharpenedClaws(PPo, event);
|
Taming.sharpenedClaws(PPo, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mcPermissions.getInstance().gore(master)) {
|
if (Permissions.getInstance().gore(master)) {
|
||||||
Taming.gore(PPo, event, master, plugin);
|
Taming.gore(PPo, event, master, plugin);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -182,7 +183,7 @@ public class Combat {
|
|||||||
if (target instanceof Player) {
|
if (target instanceof Player) {
|
||||||
Player defender = (Player) target;
|
Player defender = (Player) target;
|
||||||
|
|
||||||
if (mcPermissions.getInstance().unarmed(defender) && defender.getItemInHand().getType().equals(Material.AIR)) {
|
if (Permissions.getInstance().unarmed(defender) && defender.getItemInHand().getType().equals(Material.AIR)) {
|
||||||
Unarmed.deflectCheck(defender, event);
|
Unarmed.deflectCheck(defender, event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -192,7 +193,7 @@ public class Combat {
|
|||||||
PlayerProfile PPa = Users.getProfile(attacker);
|
PlayerProfile PPa = Users.getProfile(attacker);
|
||||||
int damage = event.getDamage();
|
int damage = event.getDamage();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().archery(attacker) && damage > 0) {
|
if (Permissions.getInstance().archery(attacker) && damage > 0) {
|
||||||
|
|
||||||
/*Archery needs a damage bonus to be viable in PVP*/
|
/*Archery needs a damage bonus to be viable in PVP*/
|
||||||
int skillLvl = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
|
int skillLvl = Users.getProfile(attacker).getSkillLevel(SkillType.ARCHERY);
|
||||||
@ -208,7 +209,7 @@ public class Combat {
|
|||||||
int archeryBonus = (int)(event.getDamage() * dmgBonusPercent);
|
int archeryBonus = (int)(event.getDamage() * dmgBonusPercent);
|
||||||
event.setDamage(event.getDamage() + archeryBonus);
|
event.setDamage(event.getDamage() + archeryBonus);
|
||||||
|
|
||||||
if (mcPermissions.getInstance().trackArrows(attacker)) {
|
if (Permissions.getInstance().trackArrows(attacker)) {
|
||||||
Archery.trackArrows(pluginx, target, PPa);
|
Archery.trackArrows(pluginx, target, PPa);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ public class Combat {
|
|||||||
* @param type The type of skill being used
|
* @param type The type of skill being used
|
||||||
*/
|
*/
|
||||||
private static void applyAbilityAoE(Player attacker, LivingEntity target, int damage, mcMMO plugin, SkillType type) {
|
private static void applyAbilityAoE(Player attacker, LivingEntity target, int damage, mcMMO plugin, SkillType type) {
|
||||||
int numberOfTargets = m.getTier(attacker.getItemInHand()); //The higher the weapon tier, the more targets you hit
|
int numberOfTargets = Misc.getTier(attacker.getItemInHand()); //The higher the weapon tier, the more targets you hit
|
||||||
int damageAmount = 0;
|
int damageAmount = 0;
|
||||||
|
|
||||||
if (type.equals(SkillType.AXES)) {
|
if (type.equals(SkillType.AXES)) {
|
||||||
@ -352,10 +353,10 @@ public class Combat {
|
|||||||
String message = "";
|
String message = "";
|
||||||
|
|
||||||
if (type.equals(SkillType.AXES)) {
|
if (type.equals(SkillType.AXES)) {
|
||||||
message = mcLocale.getString("Axes.Combat.Cleave.Struck");
|
message = LocaleLoader.getString("Axes.Combat.Cleave.Struck");
|
||||||
}
|
}
|
||||||
else if (type.equals(SkillType.SWORDS)) {
|
else if (type.equals(SkillType.SWORDS)) {
|
||||||
message = mcLocale.getString("Swords.Combat.SS.Struck");
|
message = LocaleLoader.getString("Swords.Combat.SS.Struck");
|
||||||
}
|
}
|
||||||
|
|
||||||
dealDamage(defender, damageAmount, attacker);
|
dealDamage(defender, damageAmount, attacker);
|
||||||
@ -372,7 +373,7 @@ public class Combat {
|
|||||||
LivingEntity livingEntity = (LivingEntity) entity;
|
LivingEntity livingEntity = (LivingEntity) entity;
|
||||||
|
|
||||||
if (type.equals(SkillType.SWORDS)) {
|
if (type.equals(SkillType.SWORDS)) {
|
||||||
mcBleedTimer.add(livingEntity);
|
BleedTimer.add(livingEntity);
|
||||||
}
|
}
|
||||||
|
|
||||||
dealDamage(livingEntity, damageAmount, attacker);
|
dealDamage(livingEntity, damageAmount, attacker);
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import java.sql.Connection;
|
import java.sql.Connection;
|
||||||
import java.sql.DriverManager;
|
import java.sql.DriverManager;
|
||||||
@ -9,6 +9,7 @@ import java.util.HashMap;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.DatabaseUpdate;
|
import com.gmail.nossr50.datatypes.DatabaseUpdate;
|
||||||
import com.gmail.nossr50.runnables.SQLReconnect;
|
import com.gmail.nossr50.runnables.SQLReconnect;
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Material;
|
import org.bukkit.Material;
|
||||||
@ -6,7 +6,7 @@ import org.bukkit.block.Block;
|
|||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
import com.gmail.nossr50.skills.Skills;
|
import com.gmail.nossr50.skills.Skills;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
@ -32,13 +32,13 @@ public class Item {
|
|||||||
Block block = player.getLocation().getBlock();
|
Block block = player.getLocation().getBlock();
|
||||||
int amount = is.getAmount();
|
int amount = is.getAmount();
|
||||||
|
|
||||||
if (mcPermissions.getInstance().chimaeraWing(player) && is.getTypeId() == Config.getInstance().getChimaeraItemId()) {
|
if (Permissions.getInstance().chimaeraWing(player) && is.getTypeId() == Config.getInstance().getChimaeraItemId()) {
|
||||||
if (Skills.cooldownOver(PP.getRecentlyHurt(), 60) && amount >= Config.getInstance().getChimaeraCost()) {
|
if (Skills.cooldownOver(PP.getRecentlyHurt(), 60) && amount >= Config.getInstance().getChimaeraCost()) {
|
||||||
player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost()));
|
player.setItemInHand(new ItemStack(Config.getInstance().getChimaeraItemId(), amount - Config.getInstance().getChimaeraCost()));
|
||||||
|
|
||||||
for (int y = 0; block.getY() + y < player.getWorld().getMaxHeight(); y++) {
|
for (int y = 0; block.getY() + y < player.getWorld().getMaxHeight(); y++) {
|
||||||
if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) {
|
if (!block.getRelative(0, y, 0).getType().equals(Material.AIR)) {
|
||||||
player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Fail"));
|
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Fail"));
|
||||||
player.teleport(block.getRelative(0, y - 1, 0).getLocation());
|
player.teleport(block.getRelative(0, y - 1, 0).getLocation());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -51,13 +51,13 @@ public class Item {
|
|||||||
player.teleport(player.getWorld().getSpawnLocation());
|
player.teleport(player.getWorld().getSpawnLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
player.sendMessage(mcLocale.getString("Item.ChimaeraWing.Pass"));
|
player.sendMessage(LocaleLoader.getString("Item.ChimaeraWing.Pass"));
|
||||||
}
|
}
|
||||||
else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60) && is.getAmount() >= Config.getInstance().getChimaeraCost()) {
|
else if (!Skills.cooldownOver(PP.getRecentlyHurt(), 60) && is.getAmount() >= Config.getInstance().getChimaeraCost()) {
|
||||||
player.sendMessage(mcLocale.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)}));
|
player.sendMessage(LocaleLoader.getString("Item.Injured.Wait", new Object[] {Skills.calculateTimeLeft(PP.getRecentlyHurt(), 60)}));
|
||||||
}
|
}
|
||||||
else if (is.getAmount() <= Config.getInstance().getChimaeraCost()) {
|
else if (is.getAmount() <= Config.getInstance().getChimaeraCost()) {
|
||||||
player.sendMessage(mcLocale.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + m.prettyItemString(Config.getInstance().getChimaeraItemId()));
|
player.sendMessage(LocaleLoader.getString("Skills.NeedMore")+ " " + ChatColor.GRAY + Misc.prettyItemString(Config.getInstance().getChimaeraItemId()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import java.io.BufferedReader;
|
import java.io.BufferedReader;
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
@ -7,6 +7,7 @@ import java.io.FileWriter;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.datatypes.PlayerStat;
|
import com.gmail.nossr50.datatypes.PlayerStat;
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
@ -56,62 +57,62 @@ public class Leaderboard {
|
|||||||
players.add(p);
|
players.add(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 1 && m.isInt(character[1])) {
|
if (character.length > 1 && Misc.isInt(character[1])) {
|
||||||
Mining.add(p, Integer.valueOf(character[1]));
|
Mining.add(p, Integer.valueOf(character[1]));
|
||||||
powerLevel += Integer.valueOf(character[1]);
|
powerLevel += Integer.valueOf(character[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 5 && m.isInt(character[5])) {
|
if (character.length > 5 && Misc.isInt(character[5])) {
|
||||||
WoodCutting.add(p, Integer.valueOf(character[5]));
|
WoodCutting.add(p, Integer.valueOf(character[5]));
|
||||||
powerLevel += Integer.valueOf(character[5]);
|
powerLevel += Integer.valueOf(character[5]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 7 && m.isInt(character[7])) {
|
if (character.length > 7 && Misc.isInt(character[7])) {
|
||||||
Repair.add(p, Integer.valueOf(character[7]));
|
Repair.add(p, Integer.valueOf(character[7]));
|
||||||
powerLevel += Integer.valueOf(character[7]);
|
powerLevel += Integer.valueOf(character[7]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 8 && m.isInt(character[8])) {
|
if (character.length > 8 && Misc.isInt(character[8])) {
|
||||||
Unarmed.add(p, Integer.valueOf(character[8]));
|
Unarmed.add(p, Integer.valueOf(character[8]));
|
||||||
powerLevel += Integer.valueOf(character[8]);
|
powerLevel += Integer.valueOf(character[8]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 9 && m.isInt(character[9])) {
|
if (character.length > 9 && Misc.isInt(character[9])) {
|
||||||
Herbalism.add(p, Integer.valueOf(character[9]));
|
Herbalism.add(p, Integer.valueOf(character[9]));
|
||||||
powerLevel += Integer.valueOf(character[9]);
|
powerLevel += Integer.valueOf(character[9]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 10 && m.isInt(character[10])) {
|
if (character.length > 10 && Misc.isInt(character[10])) {
|
||||||
Excavation.add(p, Integer.valueOf(character[10]));
|
Excavation.add(p, Integer.valueOf(character[10]));
|
||||||
powerLevel += Integer.valueOf(character[10]);
|
powerLevel += Integer.valueOf(character[10]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 11 && m.isInt(character[11])) {
|
if (character.length > 11 && Misc.isInt(character[11])) {
|
||||||
Archery.add(p, Integer.valueOf(character[11]));
|
Archery.add(p, Integer.valueOf(character[11]));
|
||||||
powerLevel += Integer.valueOf(character[11]);
|
powerLevel += Integer.valueOf(character[11]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 12 && m.isInt(character[12])) {
|
if (character.length > 12 && Misc.isInt(character[12])) {
|
||||||
Swords.add(p, Integer.valueOf(character[12]));
|
Swords.add(p, Integer.valueOf(character[12]));
|
||||||
powerLevel += Integer.valueOf(character[12]);
|
powerLevel += Integer.valueOf(character[12]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 13 && m.isInt(character[13])) {
|
if (character.length > 13 && Misc.isInt(character[13])) {
|
||||||
Axes.add(p, Integer.valueOf(character[13]));
|
Axes.add(p, Integer.valueOf(character[13]));
|
||||||
powerLevel += Integer.valueOf(character[13]);
|
powerLevel += Integer.valueOf(character[13]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 14 && m.isInt(character[14])) {
|
if (character.length > 14 && Misc.isInt(character[14])) {
|
||||||
Acrobatics.add(p, Integer.valueOf(character[14]));
|
Acrobatics.add(p, Integer.valueOf(character[14]));
|
||||||
powerLevel += Integer.valueOf(character[14]);
|
powerLevel += Integer.valueOf(character[14]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 24 && m.isInt(character[24])) {
|
if (character.length > 24 && Misc.isInt(character[24])) {
|
||||||
Taming.add(p, Integer.valueOf(character[24]));
|
Taming.add(p, Integer.valueOf(character[24]));
|
||||||
powerLevel += Integer.valueOf(character[24]);
|
powerLevel += Integer.valueOf(character[24]);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (character.length > 34 && m.isInt(character[34])) {
|
if (character.length > 34 && Misc.isInt(character[34])) {
|
||||||
Fishing.add(p, Integer.valueOf(character[34]));
|
Fishing.add(p, Integer.valueOf(character[34]));
|
||||||
powerLevel += Integer.valueOf(character[34]);
|
powerLevel += Integer.valueOf(character[34]);
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
/*
|
/*
|
||||||
* Copyright 2011 Tyler Blair. All rights reserved.
|
* Copyright 2011 Tyler Blair. All rights reserved.
|
||||||
*
|
*
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
@ -10,12 +10,13 @@ import org.bukkit.entity.Player;
|
|||||||
import org.bukkit.event.entity.EntityDamageEvent;
|
import org.bukkit.event.entity.EntityDamageEvent;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.config.Config;
|
import com.gmail.nossr50.config.Config;
|
||||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||||
|
|
||||||
public class m {
|
public class Misc {
|
||||||
|
|
||||||
private static Random random = new Random();
|
private static Random random = new Random();
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ public class m {
|
|||||||
int size = 1;
|
int size = 1;
|
||||||
|
|
||||||
for (String s : substrings) {
|
for (String s : substrings) {
|
||||||
prettyString = prettyString.concat(m.getCapitalized(s));
|
prettyString = prettyString.concat(Misc.getCapitalized(s));
|
||||||
|
|
||||||
if (size < substrings.length) {
|
if (size < substrings.length) {
|
||||||
prettyString = prettyString.concat(" ");
|
prettyString = prettyString.concat(" ");
|
@ -5,15 +5,14 @@ import java.util.ArrayList;
|
|||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
import com.gmail.nossr50.m;
|
|
||||||
import com.gmail.nossr50.datatypes.SkillType;
|
import com.gmail.nossr50.datatypes.SkillType;
|
||||||
import com.gmail.nossr50.locale.mcLocale;
|
import com.gmail.nossr50.locale.LocaleLoader;
|
||||||
|
|
||||||
public class Page {
|
public class Page {
|
||||||
|
|
||||||
public static int getTotalPageNumber(String address)
|
public static int getTotalPageNumber(String address)
|
||||||
{
|
{
|
||||||
String[] addressSplit = mcLocale.getString(address).split("\n");
|
String[] addressSplit = LocaleLoader.getString(address).split("\n");
|
||||||
if(addressSplit.length <= 8)
|
if(addressSplit.length <= 8)
|
||||||
return 1;
|
return 1;
|
||||||
else
|
else
|
||||||
@ -31,7 +30,7 @@ public class Page {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<String> allStrings = new ArrayList<String>();
|
ArrayList<String> allStrings = new ArrayList<String>();
|
||||||
String split[] = mcLocale.getString(address).split("\n");
|
String split[] = LocaleLoader.getString(address).split("\n");
|
||||||
|
|
||||||
allStrings.add(ChatColor.GOLD+"-="+ChatColor.GREEN+header+ChatColor.GOLD+"=-"); //So stylish
|
allStrings.add(ChatColor.GOLD+"-="+ChatColor.GREEN+header+ChatColor.GOLD+"=-"); //So stylish
|
||||||
|
|
||||||
@ -59,7 +58,7 @@ public class Page {
|
|||||||
|
|
||||||
public static void grabGuidePageForSkill(SkillType skilltype, Player player, String[] args)
|
public static void grabGuidePageForSkill(SkillType skilltype, Player player, String[] args)
|
||||||
{
|
{
|
||||||
String capitalized = m.getCapitalized(skilltype.toString());
|
String capitalized = Misc.getCapitalized(skilltype.toString());
|
||||||
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]"); //TODO: Needs more locale.
|
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]"); //TODO: Needs more locale.
|
||||||
if (args.length >= 1)
|
if (args.length >= 1)
|
||||||
{
|
{
|
||||||
@ -68,10 +67,10 @@ public class Page {
|
|||||||
|
|
||||||
String address = "Guides."+capitalized;
|
String address = "Guides."+capitalized;
|
||||||
|
|
||||||
if(args.length > 1 && m.isInt(args[1]) && m.getInt(args[1]) <= Page.getTotalPageNumber(address))
|
if(args.length > 1 && Misc.isInt(args[1]) && Misc.getInt(args[1]) <= Page.getTotalPageNumber(address))
|
||||||
{
|
{
|
||||||
Page.clearChat(player);
|
Page.clearChat(player);
|
||||||
for(String target : Page.grabPageContents(capitalized+" Guide", address, m.getInt(args[1])))
|
for(String target : Page.grabPageContents(capitalized+" Guide", address, Misc.getInt(args[1])))
|
||||||
{
|
{
|
||||||
player.sendMessage(target);
|
player.sendMessage(target);
|
||||||
}
|
}
|
||||||
@ -83,11 +82,11 @@ public class Page {
|
|||||||
player.sendMessage(target);
|
player.sendMessage(target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(args.length > 1 && m.getInt(args[1]) > Page.getTotalPageNumber(address))
|
else if(args.length > 1 && Misc.getInt(args[1]) > Page.getTotalPageNumber(address))
|
||||||
{
|
{
|
||||||
player.sendMessage("That page doesn't exist, there are only "+Page.getTotalPageNumber(address)+" total pages"); //TODO: Needs more locale.
|
player.sendMessage("That page doesn't exist, there are only "+Page.getTotalPageNumber(address)+" total pages"); //TODO: Needs more locale.
|
||||||
}
|
}
|
||||||
else if(args.length > 1 && !m.isInt(args[1]))
|
else if(args.length > 1 && !Misc.isInt(args[1]))
|
||||||
{
|
{
|
||||||
player.sendMessage("Not a valid page number!"); //TODO: Needs more locale.
|
player.sendMessage("Not a valid page number!"); //TODO: Needs more locale.
|
||||||
}
|
}
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
public class mcPermissions {
|
public class Permissions {
|
||||||
private static volatile mcPermissions instance;
|
private static volatile Permissions instance;
|
||||||
|
|
||||||
public boolean permission(Player player, String perm) {
|
public boolean permission(Player player, String perm) {
|
||||||
return player.hasPermission(perm);
|
return player.hasPermission(perm);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static mcPermissions getInstance() {
|
public static Permissions getInstance() {
|
||||||
if (instance == null) {
|
if (instance == null) {
|
||||||
instance = new mcPermissions();
|
instance = new Permissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
return instance;
|
return instance;
|
@ -1,4 +1,4 @@
|
|||||||
package com.gmail.nossr50;
|
package com.gmail.nossr50.util;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileWriter;
|
import java.io.FileWriter;
|
||||||
@ -7,6 +7,8 @@ import java.util.HashMap;
|
|||||||
|
|
||||||
import org.bukkit.OfflinePlayer;
|
import org.bukkit.OfflinePlayer;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
import com.gmail.nossr50.mcMMO;
|
||||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||||
|
|
||||||
public class Users {
|
public class Users {
|
Loading…
Reference in New Issue
Block a user