mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2026-02-19 02:12:58 +01:00
Compare commits
41 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a5af583a29 | ||
|
|
4d4638feea | ||
|
|
ef3d76fb9f | ||
|
|
5e12979f09 | ||
|
|
cd64b60ece | ||
|
|
13951e5806 | ||
|
|
6cfc8c7a52 | ||
|
|
fd6610f966 | ||
|
|
aaa63a7f5d | ||
|
|
f786c4db50 | ||
|
|
87a0c0b0b6 | ||
|
|
8cfae368c3 | ||
|
|
f19b8a88d5 | ||
|
|
ac384c5d95 | ||
|
|
83c326fb39 | ||
|
|
be31d03733 | ||
|
|
0fcba5f1ee | ||
|
|
d1041c30db | ||
|
|
1642c61b7f | ||
|
|
2ff5f2eb46 | ||
|
|
af4ba976d9 | ||
|
|
3fc5a167a4 | ||
|
|
933449f16b | ||
|
|
dd170ec7ef | ||
|
|
2d3b01ba34 | ||
|
|
6a8737547f | ||
|
|
ae8997b4f3 | ||
|
|
65e3384a96 | ||
|
|
945fb5ed55 | ||
|
|
ca2949dcaf | ||
|
|
7b22c6232d | ||
|
|
3ec5894249 | ||
|
|
77462888ff | ||
|
|
0ee05687d9 | ||
|
|
d8dbce7cc9 | ||
|
|
adea5a5674 | ||
|
|
443b4a193c | ||
|
|
46c31e1abb | ||
|
|
46cdfe992f | ||
|
|
752cc88270 | ||
|
|
d1f13ddec0 |
@@ -7,6 +7,21 @@ Key:
|
||||
! Change
|
||||
- Removal
|
||||
|
||||
Version 1.3.04-dev
|
||||
+ Added McMMOPlayerRepairEvent for API usage - fires after completion of a repair.
|
||||
+ Added McMMOPlayerRepairCheckEvent for API usage - fires before repair process begins, can be cancelled.
|
||||
+ Added ability to get skill level from McMMOPlayerExperience events
|
||||
+ Added McMMOPartyTeleportEvent for API usage - fires before a successful teleportation would occur.
|
||||
+ Added McMMOPartyChangeEvent for API usage - fires whenever a player joins or leaves a party
|
||||
= Fixed Shake ability dropping bonemeal instead of ink for squids.
|
||||
= Fixed Green Terra & Super Breaker awarding 4x drops at high levels.
|
||||
= Fixed summoned ocelots never changing skins.
|
||||
= Fixed bug with Disarm not working
|
||||
= Fixed some API functions not being visible
|
||||
= Fixed bug where /ptp worked on dead party members
|
||||
! Changed MySQL to reload all player information on reconnection
|
||||
! Changed event package structure - be sure to update these if you're using the API in your plugin
|
||||
|
||||
Version 1.3.03
|
||||
+ Added Ocelots to Taming XP tables
|
||||
+ Added ability to summon Ocelots with Call of the Wild
|
||||
|
||||
2
pom.xml
2
pom.xml
@@ -2,7 +2,7 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>com.gmail.nossr50.mcMMO</groupId>
|
||||
<artifactId>mcMMO</artifactId>
|
||||
<version>1.3.03</version>
|
||||
<version>1.3.04</version>
|
||||
<name>mcMMO</name>
|
||||
<url>https://github.com/mcMMO-Dev/mcMMO</url>
|
||||
<issueManagement>
|
||||
|
||||
@@ -16,10 +16,12 @@ import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.events.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.datatypes.ToolType;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
import com.gmail.nossr50.runnables.GainXp;
|
||||
@@ -63,7 +65,7 @@ public class Combat {
|
||||
Swords.bleedCheck(attacker, target, plugin);
|
||||
}
|
||||
|
||||
if (PPa.getSerratedStrikesMode()) {
|
||||
if (PPa.getAbilityMode(AbilityType.SERRATED_STRIKES)) {
|
||||
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.SWORDS);
|
||||
}
|
||||
|
||||
@@ -82,7 +84,7 @@ public class Combat {
|
||||
Axes.impact(attacker, target, event);
|
||||
}
|
||||
|
||||
if (PPa.getSkullSplitterMode()) {
|
||||
if (PPa.getAbilityMode(AbilityType.SKULL_SPLIITER)) {
|
||||
applyAbilityAoE(attacker, target, event.getDamage(), plugin, SkillType.AXES);
|
||||
}
|
||||
|
||||
@@ -93,7 +95,7 @@ public class Combat {
|
||||
Unarmed.unarmedBonus(PPa, event);
|
||||
}
|
||||
|
||||
if (PPa.getBerserkMode() && mcPermissions.getInstance().berserk(attacker)) {
|
||||
if (PPa.getAbilityMode(AbilityType.BERSERK) && mcPermissions.getInstance().berserk(attacker)) {
|
||||
event.setDamage((int) (event.getDamage() * 1.5));
|
||||
}
|
||||
|
||||
@@ -155,13 +157,13 @@ public class Combat {
|
||||
public static void combatAbilityChecks(Player attacker) {
|
||||
PlayerProfile PPa = Users.getProfile(attacker);
|
||||
|
||||
if (PPa.getAxePreparationMode()) {
|
||||
if (PPa.getToolPreparationMode(ToolType.AXE)) {
|
||||
Skills.abilityCheck(attacker, SkillType.AXES);
|
||||
}
|
||||
else if (PPa.getSwordsPreparationMode()) {
|
||||
else if (PPa.getToolPreparationMode(ToolType.SWORD)) {
|
||||
Skills.abilityCheck(attacker, SkillType.SWORDS);
|
||||
}
|
||||
else if (PPa.getFistsPreparationMode()) {
|
||||
else if (PPa.getToolPreparationMode(ToolType.FISTS)) {
|
||||
Skills.abilityCheck(attacker, SkillType.UNARMED);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -10,9 +10,11 @@ import java.util.ArrayList;
|
||||
import java.util.Properties;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.DatabaseUpdate;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
|
||||
public class Database {
|
||||
|
||||
@@ -253,6 +255,15 @@ public class Database {
|
||||
public void run() {
|
||||
if (!isConnected()) {
|
||||
connect();
|
||||
if(isConnected()) {
|
||||
for(PlayerProfile x : Users.players.values()) {
|
||||
x.save(); //Save all profiles
|
||||
}
|
||||
Users.players.clear(); //Clear the profiles
|
||||
for(Player x : Bukkit.getOnlinePlayers()) {
|
||||
Users.addUser(x); //Add in new profiles, forcing them to 'load' again from MySQL
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}, 20*60);
|
||||
|
||||
@@ -29,13 +29,13 @@ public class AddlevelsCommand implements CommandExecutor{
|
||||
}
|
||||
|
||||
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
|
||||
sender.sendMessage("This command requires permissions.");
|
||||
sender.sendMessage("This command requires permissions."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
if (args.length < 2) {
|
||||
System.out.println("Usage is /addlevels playername skillname levels");
|
||||
System.out.println("Usage is /addlevels playername skillname levels"); //TODO: Needs more locale.
|
||||
return true;
|
||||
} else if (args.length == 3) {
|
||||
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
|
||||
@@ -44,7 +44,7 @@ public class AddlevelsCommand implements CommandExecutor{
|
||||
System.out.println(args[1] + " has been modified for " + plugin.getServer().getPlayer(args[0]).getName() + ".");
|
||||
}
|
||||
} else {
|
||||
System.out.println("Usage is /addlevels playername skillname levels");
|
||||
System.out.println("Usage is /addlevels playername skillname levels"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -57,23 +57,23 @@ public class AddlevelsCommand implements CommandExecutor{
|
||||
return true;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname levels");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname levels"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
|
||||
int levels = Integer.valueOf(args[2]);
|
||||
Users.getProfile(plugin.getServer().getPlayer(args[0])).addLevels(Skills.getSkillType(args[1]), levels);
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified.");
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified."); //TODO: Needs more locale.
|
||||
}
|
||||
} else if (args.length == 2) {
|
||||
if (m.isInt(args[1]) && Skills.isSkill(args[0])) {
|
||||
int levels = Integer.valueOf(args[1]);
|
||||
PP.addLevels(Skills.getSkillType(args[0]), levels);
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified."); //TODO: Needs more locale.
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname newvalue");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addlevels playername skillname newvalue"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -28,7 +28,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
|
||||
sender.sendMessage("This command requires permissions.");
|
||||
sender.sendMessage("This command requires permissions."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -42,14 +42,14 @@ public class AddxpCommand implements CommandExecutor {
|
||||
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
|
||||
int newvalue = Integer.valueOf(args[2]);
|
||||
Users.getProfile(plugin.getServer().getPlayer(args[0])).addXPOverrideNoBonus(Skills.getSkillType(args[1]), newvalue);
|
||||
plugin.getServer().getPlayer(args[0]).sendMessage(ChatColor.GREEN + "Experience granted!");
|
||||
plugin.getServer().getPlayer(args[0]).sendMessage(ChatColor.GREEN + "Experience granted!"); //TODO: Needs more locale.
|
||||
System.out.println(args[1] + " has been modified for " + plugin.getServer().getPlayer(args[0]).getName() + ".");
|
||||
Skills.XpCheckAll(plugin.getServer().getPlayer(args[0]));
|
||||
}
|
||||
} else {
|
||||
// No console aliasing yet
|
||||
// System.out.println("Usage is /"+LoadProperties.addxp+" playername skillname xp");
|
||||
System.out.println("Usage is /addxp playername skillname xp");
|
||||
System.out.println("Usage is /addxp playername skillname xp"); //TODO: Needs more locale.
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -59,15 +59,15 @@ public class AddxpCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 2) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
if (args.length == 3) {
|
||||
if ((plugin.getServer().getPlayer(args[0]) != null) && m.isInt(args[2]) && Skills.isSkill(args[1])) {
|
||||
int newvalue = Integer.valueOf(args[2]);
|
||||
Users.getProfile(plugin.getServer().getPlayer(args[0])).addXP(Skills.getSkillType(args[1]), newvalue, plugin.getServer().getPlayer(args[0]));
|
||||
plugin.getServer().getPlayer(args[0]).sendMessage(ChatColor.GREEN + "Experience granted!");
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified.");
|
||||
plugin.getServer().getPlayer(args[0]).sendMessage(ChatColor.GREEN + "Experience granted!"); //TODO: Needs more locale.
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified."); //TODO: Needs more locale.
|
||||
Skills.XpCheckAll(plugin.getServer().getPlayer(args[0]));
|
||||
}
|
||||
} else if (args.length == 2 && m.isInt(args[1]) && Skills.isSkill(args[0])) {
|
||||
@@ -75,7 +75,7 @@ public class AddxpCommand implements CommandExecutor {
|
||||
Users.getProfile(player).addXP(Skills.getSkillType(args[0]), newvalue, player);
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /addxp playername skillname xp"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -36,7 +36,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
sender.sendMessage(ChatColor.RED + "Proper usage is /inspect <playername>");
|
||||
sender.sendMessage(ChatColor.RED + "Proper usage is /inspect <playername>"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -49,12 +49,12 @@ public class InspectCommand implements CommandExecutor {
|
||||
//If they are not an Op they have to be close
|
||||
if(sender instanceof Player && !player.isOp() && !m.isNear(player.getLocation(), target.getLocation(), 5))
|
||||
{
|
||||
sender.sendMessage("You are too far away to inspect that player!");
|
||||
sender.sendMessage("You are too far away to inspect that player!"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for " + ChatColor.YELLOW + target.getName());
|
||||
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for " + ChatColor.YELLOW + target.getName()); //TODO: Needs more locale.
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().excavation(target))
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
|
||||
if (mcPermissions.getInstance().fishing(target))
|
||||
@@ -66,7 +66,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
if (mcPermissions.getInstance().woodcutting(target))
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillLevel(SkillType.WOODCUTTING), PPt.getSkillXpLevel(SkillType.WOODCUTTING), PPt.getXpToLevel(SkillType.WOODCUTTING)));
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().axes(target))
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES)));
|
||||
if (mcPermissions.getInstance().archery(target))
|
||||
@@ -78,7 +78,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
if (mcPermissions.getInstance().unarmed(target))
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillLevel(SkillType.UNARMED), PPt.getSkillXpLevel(SkillType.UNARMED), PPt.getXpToLevel(SkillType.UNARMED)));
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().acrobatics(target))
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
|
||||
if (mcPermissions.getInstance().repair(target))
|
||||
@@ -88,7 +88,7 @@ public class InspectCommand implements CommandExecutor {
|
||||
} else {
|
||||
if(sender instanceof Player && !player.isOp())
|
||||
{
|
||||
sender.sendMessage("That player is offline, inspecting offline players is limited to Ops!");
|
||||
sender.sendMessage("That player is offline, inspecting offline players is limited to Ops!"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -96,27 +96,27 @@ public class InspectCommand implements CommandExecutor {
|
||||
|
||||
if(!PPt.isLoaded())
|
||||
{
|
||||
sender.sendMessage("Player does not exist in the database!");
|
||||
sender.sendMessage("Player does not exist in the database!"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for Offline Player " + ChatColor.YELLOW + args[0]);
|
||||
sender.sendMessage(ChatColor.GREEN + "mcMMO Stats for Offline Player " + ChatColor.YELLOW + args[0]); //TODO: Needs more locale.
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=GATHERING SKILLS=-"); //TODO: Needs more locale.
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PPt.getSkillLevel(SkillType.EXCAVATION), PPt.getSkillXpLevel(SkillType.EXCAVATION), PPt.getXpToLevel(SkillType.EXCAVATION)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.FishingSkill"), PPt.getSkillLevel(SkillType.FISHING), PPt.getSkillXpLevel(SkillType.FISHING), PPt.getXpToLevel(SkillType.FISHING)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.HerbalismSkill"), PPt.getSkillLevel(SkillType.HERBALISM), PPt.getSkillXpLevel(SkillType.HERBALISM), PPt.getXpToLevel(SkillType.HERBALISM)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.MiningSkill"), PPt.getSkillLevel(SkillType.MINING), PPt.getSkillXpLevel(SkillType.MINING), PPt.getXpToLevel(SkillType.MINING)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PPt.getSkillLevel(SkillType.WOODCUTTING), PPt.getSkillXpLevel(SkillType.WOODCUTTING), PPt.getXpToLevel(SkillType.WOODCUTTING)));
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=COMBAT SKILLS=-"); //TODO: Needs more locale.
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PPt.getSkillLevel(SkillType.AXES), PPt.getSkillXpLevel(SkillType.AXES), PPt.getXpToLevel(SkillType.AXES)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ArcherySkill"), PPt.getSkillLevel(SkillType.ARCHERY), PPt.getSkillXpLevel(SkillType.ARCHERY), PPt.getXpToLevel(SkillType.ARCHERY)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.SwordsSkill"), PPt.getSkillLevel(SkillType.SWORDS), PPt.getSkillXpLevel(SkillType.SWORDS), PPt.getXpToLevel(SkillType.SWORDS)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.TamingSkill"), PPt.getSkillLevel(SkillType.TAMING), PPt.getSkillXpLevel(SkillType.TAMING), PPt.getXpToLevel(SkillType.TAMING)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.UnarmedSkill"), PPt.getSkillLevel(SkillType.UNARMED), PPt.getSkillXpLevel(SkillType.UNARMED), PPt.getXpToLevel(SkillType.UNARMED)));
|
||||
|
||||
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-");
|
||||
sender.sendMessage(ChatColor.GOLD + "-=MISC SKILLS=-"); //TODO: Needs more locale.
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PPt.getSkillLevel(SkillType.ACROBATICS), PPt.getSkillXpLevel(SkillType.ACROBATICS), PPt.getXpToLevel(SkillType.ACROBATICS)));
|
||||
sender.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.RepairSkill"), PPt.getSkillLevel(SkillType.REPAIR), PPt.getSkillXpLevel(SkillType.REPAIR), PPt.getXpToLevel(SkillType.REPAIR)));
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ public class McstatsCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public class McstatsCommand implements CommandExecutor {
|
||||
ChatColor header = ChatColor.GOLD;
|
||||
|
||||
if (Skills.hasGatheringSkills(player)) {
|
||||
player.sendMessage(header + "-=GATHERING SKILLS=-");
|
||||
player.sendMessage(header + "-=GATHERING SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().excavation(player))
|
||||
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.ExcavationSkill"), PP.getSkillLevel(SkillType.EXCAVATION), PP.getSkillXpLevel(SkillType.EXCAVATION), PP.getXpToLevel(SkillType.EXCAVATION)));
|
||||
if (mcPermissions.getInstance().fishing(player))
|
||||
@@ -51,7 +51,7 @@ public class McstatsCommand implements CommandExecutor {
|
||||
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.WoodcuttingSkill"), PP.getSkillLevel(SkillType.WOODCUTTING), PP.getSkillXpLevel(SkillType.WOODCUTTING), PP.getXpToLevel(SkillType.WOODCUTTING)));
|
||||
}
|
||||
if (Skills.hasCombatSkills(player)) {
|
||||
player.sendMessage(header + "-=COMBAT SKILLS=-");
|
||||
player.sendMessage(header + "-=COMBAT SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().axes(player))
|
||||
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AxesSkill"), PP.getSkillLevel(SkillType.AXES), PP.getSkillXpLevel(SkillType.AXES), PP.getXpToLevel(SkillType.AXES)));
|
||||
if (mcPermissions.getInstance().archery(player))
|
||||
@@ -65,7 +65,7 @@ public class McstatsCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (Skills.hasMiscSkills(player)) {
|
||||
player.sendMessage(header + "-=MISC SKILLS=-");
|
||||
player.sendMessage(header + "-=MISC SKILLS=-"); //TODO: Needs more locale.
|
||||
if (mcPermissions.getInstance().acrobatics(player))
|
||||
player.sendMessage(Skills.getSkillStats(mcLocale.getString("mcPlayerListener.AcrobaticsSkill"), PP.getSkillLevel(SkillType.ACROBATICS), PP.getSkillXpLevel(SkillType.ACROBATICS), PP.getXpToLevel(SkillType.ACROBATICS)));
|
||||
if (mcPermissions.getInstance().repair(player))
|
||||
|
||||
@@ -24,7 +24,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (player != null && !mcPermissions.getInstance().mmoedit(player)) {
|
||||
sender.sendMessage("This command requires permissions.");
|
||||
sender.sendMessage("This command requires permissions."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
{
|
||||
if (args.length < 2)
|
||||
{
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue");
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue"); //TODO: Needs more locale.
|
||||
return true;
|
||||
} else if (args.length == 3)
|
||||
{
|
||||
@@ -47,7 +47,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
|
||||
if(!PPt.isLoaded())
|
||||
{
|
||||
sender.sendMessage("Player does not exist in the database!");
|
||||
sender.sendMessage("Player does not exist in the database!"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -55,11 +55,11 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
{
|
||||
int newvalue = Integer.valueOf(args[2]);
|
||||
Users.getOfflineProfile(args[0]).modifyskill(Skills.getSkillType(args[1]), newvalue);
|
||||
System.out.println(args[1] + " has been modified for " + args[0] + ".");
|
||||
System.out.println(args[1] + " has been modified for " + args[0] + "."); //TODO: Needs more locale.
|
||||
}
|
||||
} else
|
||||
{
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue");
|
||||
System.out.println("Usage is /mmoedit playername skillname newvalue"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -73,7 +73,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
|
||||
if (args.length < 2)
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
if (args.length == 3)
|
||||
@@ -89,7 +89,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
|
||||
if(!PPt.isLoaded())
|
||||
{
|
||||
sender.sendMessage("Player does not exist in the database!");
|
||||
sender.sendMessage("Player does not exist in the database!"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
{
|
||||
int newvalue = Integer.valueOf(args[2]);
|
||||
PPt.modifyskill(Skills.getSkillType(args[1]), newvalue);
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified for "+args[0]);
|
||||
player.sendMessage(ChatColor.RED + args[1] + " has been modified for "+args[0]); //TODO: Needs more locale.
|
||||
}
|
||||
} else if (args.length == 2)
|
||||
{
|
||||
@@ -106,11 +106,11 @@ public class MmoeditCommand implements CommandExecutor {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
int newvalue = Integer.valueOf(args[1]);
|
||||
PP.modifyskill(Skills.getSkillType(args[0]), newvalue);
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified.");
|
||||
player.sendMessage(ChatColor.RED + args[0] + " has been modified."); //TODO: Needs more locale.
|
||||
}
|
||||
} else
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /mmoedit playername skillname newvalue"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -17,7 +17,7 @@ public class MmoupdateCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -27,13 +27,13 @@ public class MmoupdateCommand implements CommandExecutor {
|
||||
player.sendMessage(ChatColor.YELLOW + "[mcMMO] " + ChatColor.DARK_RED + mcLocale.getString("mcPlayerListener.NoPermission"));
|
||||
return true;
|
||||
}
|
||||
player.sendMessage(ChatColor.GRAY + "Starting conversion...");
|
||||
player.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
|
||||
Users.clearUsers();
|
||||
convertToMySQL();
|
||||
for (Player x : Bukkit.getServer().getOnlinePlayers()) {
|
||||
Users.addUser(x);
|
||||
}
|
||||
player.sendMessage(ChatColor.GREEN + "Conversion finished!");
|
||||
player.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -60,11 +60,11 @@ public class XprateCommand implements CommandExecutor {
|
||||
if(xpevent = true)
|
||||
for(Player x : Bukkit.getServer().getOnlinePlayers())
|
||||
{
|
||||
x.sendMessage(ChatColor.GOLD+"XP EVENT FOR mcMMO HAS STARTED!");
|
||||
x.sendMessage(ChatColor.GOLD+"mcMMO XP RATE IS NOW "+LoadProperties.xpGainMultiplier+"x!!");
|
||||
x.sendMessage(ChatColor.GOLD+"XP EVENT FOR mcMMO HAS STARTED!"); //TODO: Needs more locale.
|
||||
x.sendMessage(ChatColor.GOLD+"mcMMO XP RATE IS NOW "+LoadProperties.xpGainMultiplier+"x!!"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
System.out.println("The XP RATE was modified to "+LoadProperties.xpGainMultiplier);
|
||||
System.out.println("The XP RATE was modified to "+LoadProperties.xpGainMultiplier); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class McabilityCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ public class MccCommand implements CommandExecutor {
|
||||
|
||||
Player player = (Player) sender;
|
||||
|
||||
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---");
|
||||
player.sendMessage(ChatColor.RED + "---[]" + ChatColor.YELLOW + "mcMMO Commands" + ChatColor.RED + "[]---"); //TODO: Needs more locale.
|
||||
|
||||
if (mcPermissions.getInstance().party(player)) {
|
||||
player.sendMessage(mcLocale.getString("m.mccPartyCommands"));
|
||||
@@ -37,11 +37,11 @@ public class MccCommand implements CommandExecutor {
|
||||
player.sendMessage("/ptp " + mcLocale.getString("m.mccPartyTeleport"));
|
||||
}
|
||||
player.sendMessage(mcLocale.getString("m.mccOtherCommands"));
|
||||
player.sendMessage("/mcstats " + ChatColor.RED + " " + mcLocale.getString("m.mccStats"));
|
||||
player.sendMessage("/mcstats " + ChatColor.RED + mcLocale.getString("m.mccStats"));
|
||||
player.sendMessage("/mctop <skillname> <page> " + ChatColor.RED + mcLocale.getString("m.mccLeaderboards"));
|
||||
|
||||
if (mcPermissions.getInstance().mcAbility(player))
|
||||
player.sendMessage("/mcability" + ChatColor.RED + " " + mcLocale.getString("m.mccToggleAbility"));
|
||||
player.sendMessage("/mcability " + ChatColor.RED + mcLocale.getString("m.mccToggleAbility"));
|
||||
|
||||
if (mcPermissions.getInstance().adminChat(player))
|
||||
player.sendMessage("/a " + ChatColor.RED + mcLocale.getString("m.mccAdminToggle"));
|
||||
@@ -50,10 +50,10 @@ public class MccCommand implements CommandExecutor {
|
||||
player.sendMessage("/inspect " + mcLocale.getString("m.mccInspect"));
|
||||
|
||||
if (mcPermissions.getInstance().mmoedit(player))
|
||||
player.sendMessage("/mmoedit" + mcLocale.getString("m.mccMmoedit"));
|
||||
player.sendMessage("/mmoedit " + mcLocale.getString("m.mccMmoedit"));
|
||||
|
||||
if (mcPermissions.getInstance().mcgod(player))
|
||||
player.sendMessage("/mcgod" + ChatColor.RED + " " + mcLocale.getString("m.mccMcGod"));
|
||||
player.sendMessage("/mcgod " + ChatColor.RED + mcLocale.getString("m.mccMcGod"));
|
||||
|
||||
player.sendMessage(mcLocale.getString("m.mccSkillInfo"));
|
||||
player.sendMessage("/mcmmo " + mcLocale.getString("m.mccModDescription"));
|
||||
|
||||
@@ -16,7 +16,7 @@ public class McgodCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class McmmoCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ public class McmmoCommand implements CommandExecutor {
|
||||
if (LoadProperties.spoutEnabled && player instanceof SpoutPlayer) {
|
||||
SpoutPlayer sPlayer = (SpoutPlayer) player;
|
||||
if (LoadProperties.donateMessage)
|
||||
sPlayer.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"theno1yeti@gmail.com");
|
||||
sPlayer.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"theno1yeti@gmail.com"); //Where'd our notification go?
|
||||
} else {
|
||||
if (LoadProperties.donateMessage)
|
||||
player.sendMessage(ChatColor.YELLOW + "[mcMMO]"+ChatColor.GOLD+" Donate! Paypal "+ChatColor.GREEN+"theno1yeti@gmail.com");
|
||||
|
||||
@@ -9,7 +9,9 @@ import org.bukkit.entity.Player;
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.ToolType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class McrefreshCommand implements CommandExecutor {
|
||||
@@ -23,7 +25,7 @@ public class McrefreshCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -35,7 +37,7 @@ public class McrefreshCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length >= 1 && (plugin.getServer().getPlayer(args[0]) != null)) {
|
||||
player.sendMessage("You have refreshed " + args[0] + "'s cooldowns!");
|
||||
player.sendMessage("You have refreshed " + args[0] + "'s cooldowns!"); //TODO: Needs more locale.
|
||||
player = plugin.getServer().getPlayer(args[0]);
|
||||
}
|
||||
|
||||
@@ -44,21 +46,20 @@ public class McrefreshCommand implements CommandExecutor {
|
||||
*/
|
||||
PP = Users.getProfile(player);
|
||||
PP.setRecentlyHurt((long) 0);
|
||||
PP.setHoePreparationMode(false);
|
||||
PP.setAxePreparationMode(false);
|
||||
PP.setFistsPreparationMode(false);
|
||||
PP.setSwordsPreparationMode(false);
|
||||
PP.setPickaxePreparationMode(false);
|
||||
|
||||
PP.setToolPreparationMode(ToolType.AXE, false);
|
||||
PP.setToolPreparationMode(ToolType.FISTS, false);
|
||||
PP.setToolPreparationMode(ToolType.HOE, false);
|
||||
PP.setToolPreparationMode(ToolType.PICKAXE, false);
|
||||
PP.setToolPreparationMode(ToolType.SWORD, false);
|
||||
|
||||
//RESET COOLDOWNS
|
||||
PP.resetCooldowns();
|
||||
PP.setGreenTerraMode(false);
|
||||
PP.setGigaDrillBreakerMode(false);
|
||||
PP.setSerratedStrikesMode(false);
|
||||
PP.setSuperBreakerMode(false);
|
||||
PP.setTreeFellerMode(false);
|
||||
PP.setBerserkMode(false);
|
||||
PP.setAbilityMode(AbilityType.GREEN_TERRA, false);
|
||||
PP.setAbilityMode(AbilityType.GIGA_DRILL_BREAKER, false);
|
||||
PP.setAbilityMode(AbilityType.SERRATED_STRIKES, false);
|
||||
PP.setAbilityMode(AbilityType.SUPER_BREAKER, false);
|
||||
PP.setAbilityMode(AbilityType.TREE_FELLER, false);
|
||||
PP.setAbilityMode(AbilityType.BERSERK, false);
|
||||
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.AbilitiesRefreshed"));
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
|
||||
if(args.length == 0)
|
||||
{
|
||||
sender.sendMessage("Correct usage is /mcremove [Player Name]");
|
||||
sender.sendMessage("Correct usage is /mcremove [Player Name]"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -66,7 +66,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
+LoadProperties.MySQLtablePrefix+"experience WHERE "
|
||||
+LoadProperties.MySQLtablePrefix+"experience.user_id="+userId);
|
||||
|
||||
sender.sendMessage("User "+playerName+" removed from MySQL DB!");
|
||||
sender.sendMessage("User "+playerName+" removed from MySQL DB!"); //TODO: Needs more locale.
|
||||
} else {
|
||||
//FlatFile removal
|
||||
//TODO: Properly remove users from FlatFile, it's going to be a huge bitch with how our FlatFile system works. Let's adopt SQLite support.
|
||||
@@ -76,13 +76,13 @@ public class McremoveCommand implements CommandExecutor {
|
||||
if(targetPlayer.isOnline())
|
||||
{
|
||||
Users.getProfile(targetPlayer).resetAllData();
|
||||
sender.sendMessage("User "+playerName+" removed from FlatFile DB!");
|
||||
sender.sendMessage("User "+playerName+" removed from FlatFile DB!"); //TODO: Needs more locale.
|
||||
} else {
|
||||
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
|
||||
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
} else {
|
||||
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online.");
|
||||
sender.sendMessage("[mcMMO] This command is not fully functional for FlatFile yet, the player needs to be online."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -93,7 +93,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
Player targetPlayer = Bukkit.getServer().getPlayer(playerName);
|
||||
if(targetPlayer.isOnline())
|
||||
{
|
||||
targetPlayer.kickPlayer("[mcMMO] Stats have been reset! Rejoin!");
|
||||
targetPlayer.kickPlayer("[mcMMO] Stats have been reset! Rejoin!"); //TODO: Needs more locale.
|
||||
Users.removeUserByName(playerName);
|
||||
} else {
|
||||
Users.removeUser(targetPlayer);
|
||||
@@ -102,7 +102,7 @@ public class McremoveCommand implements CommandExecutor {
|
||||
Users.removeUserByName(playerName);
|
||||
}
|
||||
|
||||
sender.sendMessage("[mcMMO] mcremove operation completed.");
|
||||
sender.sendMessage("[mcMMO] mcremove operation completed."); //TODO: Needs more locale.
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@@ -9,6 +10,8 @@ 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.events.party.McMMOPartyChangeEvent;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
|
||||
@@ -17,7 +20,7 @@ public class AcceptCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -33,10 +36,25 @@ public class AcceptCommand implements CommandExecutor {
|
||||
Party Pinstance = Party.getInstance();
|
||||
|
||||
if (PP.inParty()) {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, PP.getParty(), PP.getInvite(), EventReason.CHANGED_PARTIES);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Pinstance.removeFromParty(player, PP);
|
||||
}
|
||||
PP.acceptInvite();
|
||||
Pinstance.addToParty(player, PP, PP.getParty(), true);
|
||||
else {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, null, PP.getInvite(), EventReason.JOINED_PARTY);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
PP.acceptInvite();
|
||||
Pinstance.addToParty(player, PP, PP.getParty(), true);
|
||||
|
||||
} else {
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.NoInvites"));
|
||||
|
||||
@@ -24,7 +24,7 @@ public class InviteCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class InviteCommand implements CommandExecutor {
|
||||
return true;
|
||||
}
|
||||
if (args.length < 1) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /invite <playername>");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /invite <playername>"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
if (PP.inParty() && args.length >= 1 && (plugin.getServer().getPlayer(args[0]) != null)) {
|
||||
@@ -53,10 +53,8 @@ public class InviteCommand implements CommandExecutor {
|
||||
PPt.modifyInvite(PP.getParty());
|
||||
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.InviteSuccess"));
|
||||
// target.sendMessage(ChatColor.RED+"ALERT: "+ChatColor.GREEN+"You have received a party invite for "+PPt.getInvite()+" from "+player.getName());
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite1", new Object[] { PPt.getInvite(), player.getName() }));
|
||||
// target.sendMessage(ChatColor.YELLOW+"Type "+ChatColor.GREEN+LoadProperties.accept+ChatColor.YELLOW+" to accept the invite");
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite2", new Object[] { "/accept" }));
|
||||
target.sendMessage(mcLocale.getString("mcPlayerListener.ReceivedInvite2", new Object[] { "accept" }));
|
||||
} else {
|
||||
player.sendMessage(mcLocale.getString("Party.Locked"));
|
||||
return true;
|
||||
|
||||
@@ -10,6 +10,8 @@ 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.events.party.McMMOPartyChangeEvent;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyChangeEvent.EventReason;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
|
||||
@@ -18,7 +20,7 @@ public class PartyCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,9 +39,9 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
|
||||
if (args.length == 0 && !PP.inParty()) {
|
||||
player.sendMessage(mcLocale.getString("Party.Help1", new Object[] { "/party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "/party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help3", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help1", new Object[] { "party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "party "}));
|
||||
player.sendMessage(mcLocale.getString("Party.Help3", new Object[] { "party " }));
|
||||
return true;
|
||||
} else if (args.length == 0 && PP.inParty()) {
|
||||
String tempList = "";
|
||||
@@ -109,18 +111,26 @@ public class PartyCommand implements CommandExecutor {
|
||||
return true;
|
||||
} else if (args.length == 1) {
|
||||
if (args[0].equals("q") && PP.inParty()) {
|
||||
Pinstance.removeFromParty(player, PP);
|
||||
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, PP.getParty(), null, EventReason.LEFT_PARTY);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Pinstance.removeFromParty(player, PP);
|
||||
player.sendMessage(mcLocale.getString("mcPlayerListener.LeftParty"));
|
||||
return true;
|
||||
|
||||
} else if (args[0].equalsIgnoreCase("?")) {
|
||||
player.sendMessage(mcLocale.getString("Party.Help4", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help5", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help6", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help7", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help8", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help9", new Object[] { "/party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help4", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help2", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help5", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help6", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help7", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help8", new Object[] { "party " }));
|
||||
player.sendMessage(mcLocale.getString("Party.Help9", new Object[] { "party " }));
|
||||
} else if (args[0].equalsIgnoreCase("lock")) {
|
||||
if (PP.inParty()) {
|
||||
if (Pinstance.isPartyLeader(player.getName(), PP.getParty())) {
|
||||
@@ -148,8 +158,23 @@ public class PartyCommand implements CommandExecutor {
|
||||
// Pinstance.dump(player);
|
||||
} else {
|
||||
if (PP.inParty()) {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, PP.getParty(), args[0], EventReason.CHANGED_PARTIES);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Pinstance.removeFromParty(player, PP);
|
||||
}
|
||||
else {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, null, args[0], EventReason.JOINED_PARTY);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
Pinstance.addToParty(player, PP, args[0], false);
|
||||
return true;
|
||||
}
|
||||
@@ -186,6 +211,13 @@ public class PartyCommand implements CommandExecutor {
|
||||
}
|
||||
PlayerProfile tPP = Users.getProfile(tPlayer);
|
||||
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, tPP.getParty(), null, EventReason.KICKED_FROM_PARTY);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Pinstance.removeFromParty(tPlayer, tPP);
|
||||
|
||||
tPlayer.sendMessage(mcLocale.getString("mcPlayerListener.LeftParty"));
|
||||
@@ -213,10 +245,22 @@ public class PartyCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("Party.NotOwner"));
|
||||
}
|
||||
} else {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, PP.getParty(), args[0], EventReason.CHANGED_PARTIES);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
Pinstance.removeFromParty(player, PP);
|
||||
Pinstance.addToParty(player, PP, args[0], false, args[1]);
|
||||
}
|
||||
} else if (args.length == 2 && !PP.inParty()) {
|
||||
McMMOPartyChangeEvent event = new McMMOPartyChangeEvent(player, null, args[0], EventReason.JOINED_PARTY);
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (event.isCancelled()) {
|
||||
return true;
|
||||
}
|
||||
Pinstance.addToParty(player, PP, args[0], false, args[1]);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.commands.party;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.command.Command;
|
||||
import org.bukkit.command.CommandExecutor;
|
||||
@@ -11,6 +12,7 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.events.party.McMMOPartyTeleportEvent;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
|
||||
@@ -25,7 +27,7 @@ public class PtpCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -39,34 +41,45 @@ public class PtpCommand implements CommandExecutor {
|
||||
|
||||
if(!Party.getInstance().isParty(PP.getParty()))
|
||||
{
|
||||
player.sendMessage(ChatColor.RED+"You are not in a party!");
|
||||
player.sendMessage(ChatColor.RED+"You are not in a party!"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if(PP.getRecentlyHurt()+(LoadProperties.ptpCommandCooldown*1000) > System.currentTimeMillis())
|
||||
{
|
||||
player.sendMessage(ChatColor.RED+"You've been hurt in the last " + LoadProperties.ptpCommandCooldown + " seconds and cannnot teleport.");
|
||||
player.sendMessage(ChatColor.RED+"You've been hurt in the last " + LoadProperties.ptpCommandCooldown + " seconds and cannnot teleport."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (args.length < 1) {
|
||||
player.sendMessage(ChatColor.RED + "Usage is /ptp <playername>");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /ptp <playername>"); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (plugin.getServer().getPlayer(args[0]) == null) {
|
||||
player.sendMessage("That is not a valid player");
|
||||
player.sendMessage("That is not a valid player"); //TODO: Needs more locale.
|
||||
}
|
||||
|
||||
if (plugin.getServer().getPlayer(args[0]) != null) {
|
||||
Player target = plugin.getServer().getPlayer(args[0]);
|
||||
PlayerProfile PPt = Users.getProfile(target);
|
||||
|
||||
if (target.isDead()) {
|
||||
player.sendMessage(ChatColor.RED + "You can't teleport to dead players."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (PP.getParty().equals(PPt.getParty())) {
|
||||
player.teleport(target);
|
||||
player.sendMessage(ChatColor.GREEN + "You have teleported to " + target.getName());
|
||||
target.sendMessage(ChatColor.GREEN + player.getName() + " has teleported to you.");
|
||||
McMMOPartyTeleportEvent event = new McMMOPartyTeleportEvent(player, target, PP.getParty());
|
||||
Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
if (!event.isCancelled()) {
|
||||
player.teleport(target);
|
||||
player.sendMessage(ChatColor.GREEN + "You have teleported to " + target.getName()); //TODO: Needs more locale.
|
||||
target.sendMessage(ChatColor.GREEN + player.getName() + " has teleported to you."); //TODO: Needs more locale.
|
||||
}
|
||||
} else {
|
||||
player.sendMessage(ChatColor.RED + "That player is in a different party than you.");
|
||||
player.sendMessage(ChatColor.RED + "That player is in a different party than you."); //TODO: Needs more locale.
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class AcrobaticsCommand implements CommandExecutor {
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player))
|
||||
{
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ArcheryCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ public class AxesCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class ExcavationCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class FishingCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class HerbalismCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class MiningCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ public class RepairCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class SwordsCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ public class TamingCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public class UnarmedCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -58,7 +58,6 @@ public class UnarmedCommand implements CommandExecutor {
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed1_0"), mcLocale.getString("m.EffectsUnarmed1_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed2_0"), mcLocale.getString("m.EffectsUnarmed2_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed3_0"), mcLocale.getString("m.EffectsUnarmed3_1") }));
|
||||
//player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed4_0"), mcLocale.getString("m.EffectsUnarmed4_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.EffectsTemplate", new Object[] { mcLocale.getString("m.EffectsUnarmed5_0"), mcLocale.getString("m.EffectsUnarmed5_1") }));
|
||||
player.sendMessage(mcLocale.getString("m.SkillHeader", new Object[] { mcLocale.getString("m.YourStats") }));
|
||||
player.sendMessage(mcLocale.getString("m.UnarmedArrowDeflectChance", new Object[] { arrowpercentage }));
|
||||
|
||||
@@ -16,7 +16,7 @@ public class WoodcuttingCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,12 +16,12 @@ public class MchudCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!LoadProperties.spoutEnabled) {
|
||||
sender.sendMessage("This command is not enabled.");
|
||||
sender.sendMessage("This command is not enabled."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -19,12 +19,12 @@ public class XplockCommand implements CommandExecutor {
|
||||
@Override
|
||||
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
|
||||
if (!LoadProperties.spoutEnabled || !LoadProperties.xpbar || !LoadProperties.xplockEnable) {
|
||||
sender.sendMessage("This command is not enabled.");
|
||||
sender.sendMessage("This command is not enabled."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!(sender instanceof Player)) {
|
||||
sender.sendMessage("This command does not support console useage.");
|
||||
sender.sendMessage("This command does not support console useage."); //TODO: Needs more locale.
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,163 +61,6 @@ public enum AbilityType {
|
||||
return this.abilityRefresh;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the mode of this ability.
|
||||
*
|
||||
* @param PP PlayerProfile of the player using the ability
|
||||
* @return true if the ability is enabled, false otherwise
|
||||
*/
|
||||
public boolean getMode(PlayerProfile PP) {
|
||||
switch (this) {
|
||||
case BERSERK:
|
||||
return PP.getBerserkMode();
|
||||
|
||||
case SUPER_BREAKER:
|
||||
return PP.getSuperBreakerMode();
|
||||
|
||||
case GIGA_DRILL_BREAKER:
|
||||
return PP.getGigaDrillBreakerMode();
|
||||
|
||||
case GREEN_TERRA:
|
||||
return PP.getGreenTerraMode();
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
return PP.getSkullSplitterMode();
|
||||
|
||||
case TREE_FELLER:
|
||||
return PP.getTreeFellerMode();
|
||||
|
||||
case SERRATED_STRIKES:
|
||||
return PP.getSerratedStrikesMode();
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the mode of this ability.
|
||||
*
|
||||
* @param PP PlayerProfile of the player using the ability
|
||||
* @param bool Mode to set the ability to
|
||||
*/
|
||||
public void setMode(PlayerProfile PP, boolean bool) {
|
||||
switch (this) {
|
||||
case BERSERK:
|
||||
PP.setBerserkMode(bool);
|
||||
break;
|
||||
|
||||
case SUPER_BREAKER:
|
||||
PP.setSuperBreakerMode(bool);
|
||||
break;
|
||||
|
||||
case GIGA_DRILL_BREAKER:
|
||||
PP.setGigaDrillBreakerMode(bool);
|
||||
break;
|
||||
|
||||
case GREEN_TERRA:
|
||||
PP.setGreenTerraMode(bool);
|
||||
break;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
PP.setSkullSplitterMode(bool);
|
||||
break;
|
||||
|
||||
case TREE_FELLER:
|
||||
PP.setTreeFellerMode(bool);
|
||||
break;
|
||||
|
||||
case SERRATED_STRIKES:
|
||||
PP.setSerratedStrikesMode(bool);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the informed state of this ability
|
||||
*
|
||||
* @param PP PlayerProfile of the player using the ability
|
||||
* @return true if the ability is informed, false otherwise
|
||||
*/
|
||||
public boolean getInformed(PlayerProfile PP) {
|
||||
switch (this) {
|
||||
case BERSERK:
|
||||
return PP.getBerserkInformed();
|
||||
|
||||
case BLAST_MINING:
|
||||
return PP.getBlastMiningInformed();
|
||||
|
||||
case SUPER_BREAKER:
|
||||
return PP.getSuperBreakerInformed();
|
||||
|
||||
case GIGA_DRILL_BREAKER:
|
||||
return PP.getGigaDrillBreakerInformed();
|
||||
|
||||
case GREEN_TERRA:
|
||||
return PP.getGreenTerraInformed();
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
return PP.getSkullSplitterInformed();
|
||||
|
||||
case TREE_FELLER:
|
||||
return PP.getTreeFellerInformed();
|
||||
|
||||
case SERRATED_STRIKES:
|
||||
return PP.getSerratedStrikesInformed();
|
||||
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the informed state of this ability.
|
||||
*
|
||||
* @param PP PlayerProfile of the player using the ability
|
||||
* @param bool Informed state to set the ability to
|
||||
*/
|
||||
public void setInformed(PlayerProfile PP, boolean bool) {
|
||||
switch (this) {
|
||||
case BERSERK:
|
||||
PP.setBerserkInformed(bool);
|
||||
break;
|
||||
|
||||
case BLAST_MINING:
|
||||
PP.setBlastMiningInformed(bool);
|
||||
break;
|
||||
|
||||
case SUPER_BREAKER:
|
||||
PP.setSuperBreakerInformed(bool);
|
||||
break;
|
||||
|
||||
case GIGA_DRILL_BREAKER:
|
||||
PP.setGigaDrillBreakerInformed(bool);
|
||||
break;
|
||||
|
||||
case GREEN_TERRA:
|
||||
PP.setGreenTerraInformed(bool);
|
||||
break;
|
||||
|
||||
case SKULL_SPLIITER:
|
||||
PP.setSkullSplitterInformed(bool);
|
||||
break;
|
||||
|
||||
case TREE_FELLER:
|
||||
PP.setTreeFellerInformed(bool);
|
||||
break;
|
||||
|
||||
case SERRATED_STRIKES:
|
||||
PP.setSerratedStrikesInformed(bool);
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the permissions for this ability.
|
||||
*
|
||||
@@ -288,4 +131,4 @@ public enum AbilityType {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -16,285 +16,353 @@ import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
|
||||
public class HUDmmo
|
||||
{
|
||||
int center_x = 427/2;
|
||||
int center_y = 240/2;
|
||||
|
||||
String playerName = null;
|
||||
Widget xpbar = null;
|
||||
GenericGradient xpfill = null;
|
||||
GenericGradient xpbg = null;
|
||||
GenericGradient xpicon_bg = null;
|
||||
GenericGradient xpicon_border = null;
|
||||
GenericTexture xpicon = null;
|
||||
mcMMO plugin = (mcMMO) Bukkit.getServer().getPluginManager().getPlugin("mcMMO");
|
||||
|
||||
public HUDmmo(Player player)
|
||||
{
|
||||
playerName = player.getName();
|
||||
initializeHUD(player);
|
||||
}
|
||||
|
||||
public void initializeHUD(Player player)
|
||||
{
|
||||
//PlayerProfile PP = Users.getProfile(player);
|
||||
HUDType type = Users.getProfile(player).getHUDType();
|
||||
|
||||
//if(LoadProperties.partybar && PP.getPartyHUD())
|
||||
//mmoHelper.initialize(SpoutManager.getPlayer(player), plugin); //PARTY HUD
|
||||
|
||||
switch(type)
|
||||
{
|
||||
case RETRO:
|
||||
{
|
||||
initializeXpBarDisplayRetro(SpoutManager.getPlayer(player));
|
||||
break;
|
||||
}
|
||||
case STANDARD:
|
||||
{
|
||||
initializeXpBarDisplayStandard(SpoutManager.getPlayer(player));
|
||||
break;
|
||||
}
|
||||
case SMALL:
|
||||
{
|
||||
initializeXpBarDisplaySmall(SpoutManager.getPlayer(player));
|
||||
break;
|
||||
}
|
||||
case DISABLED:
|
||||
{
|
||||
//Do nothing.. :)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void updateXpBarDisplay(HUDType type, Player player)
|
||||
{
|
||||
switch(type)
|
||||
{
|
||||
case RETRO:
|
||||
{
|
||||
updateXpBarRetro(player, Users.getProfile(player));
|
||||
break;
|
||||
}
|
||||
case STANDARD:
|
||||
{
|
||||
updateXpBarStandard(player, Users.getProfile(player));
|
||||
break;
|
||||
}
|
||||
case SMALL:
|
||||
{
|
||||
updateXpBarStandard(player, Users.getProfile(player));
|
||||
break;
|
||||
}
|
||||
case DISABLED:
|
||||
{
|
||||
//Do nothing.. :)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void resetHUD()
|
||||
{
|
||||
SpoutPlayer sPlayer = SpoutStuff.getSpoutPlayer(playerName);
|
||||
//PlayerProfile PP = Users.getProfile(sPlayer);
|
||||
if(sPlayer != null)
|
||||
{
|
||||
sPlayer.getMainScreen().removeWidgets(plugin);
|
||||
|
||||
//Reset the objects
|
||||
xpbar = null;
|
||||
xpfill = null;
|
||||
xpbg = null;
|
||||
xpicon = null;
|
||||
|
||||
//if(LoadProperties.partybar && PP.getPartyHUD())
|
||||
//mmoHelper.initialize(sPlayer, plugin);
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
private void initializeXpBarDisplayRetro(SpoutPlayer sPlayer)
|
||||
{
|
||||
Color border = new Color((float)LoadProperties.xpborder_r, (float)LoadProperties.xpborder_g, (float)LoadProperties.xpborder_b, 1f);
|
||||
Color green = new Color(0, 1f, 0, 1f);
|
||||
Color background = new Color((float)LoadProperties.xpbackground_r, (float)LoadProperties.xpbackground_g, (float)LoadProperties.xpbackground_b, 1f);
|
||||
Color darkbg = new Color(0.2f, 0.2f, 0.2f, 1f);
|
||||
|
||||
xpicon = new GenericTexture();
|
||||
xpbar = new GenericGradient();
|
||||
xpfill = new GenericGradient();
|
||||
xpbg = new GenericGradient();
|
||||
|
||||
xpicon_bg = new GenericGradient();
|
||||
xpicon_border = new GenericGradient();
|
||||
|
||||
xpicon_bg.setBottomColor(darkbg).setTopColor(darkbg).setWidth(4).setHeight(4).setPriority(RenderPriority.High).setX(142).setY(10).setDirty(true);
|
||||
xpicon_border.setBottomColor(border).setTopColor(border).setWidth(6).setHeight(6).setPriority(RenderPriority.Highest).setX(141).setY(9).setDirty(true);
|
||||
|
||||
xpicon.setWidth(6).setHeight(6).setX(141).setY(9).setPriority(RenderPriority.Normal).setDirty(true);
|
||||
xpicon.setUrl("Icon_r.png");
|
||||
|
||||
xpbar.setWidth(128).setHeight(4).setX(149).setY(10);
|
||||
((GenericGradient) xpbar).setBottomColor(border).setTopColor(border).setPriority(RenderPriority.Highest).setDirty(true);
|
||||
|
||||
xpfill.setWidth(0).setHeight(2).setX(150).setY(11);
|
||||
xpfill.setBottomColor(green).setTopColor(green).setPriority(RenderPriority.Lowest).setDirty(true);
|
||||
|
||||
xpbg.setWidth(126).setHeight(2).setX(150).setY(11);
|
||||
xpbg.setBottomColor(background).setTopColor(background).setPriority(RenderPriority.Low).setDirty(true);
|
||||
|
||||
if(LoadProperties.xpbar)
|
||||
{
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericGradient)xpbar);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericGradient)xpfill);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericGradient)xpbg);
|
||||
if(LoadProperties.xpicon)
|
||||
{
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericTexture)xpicon);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericGradient)xpicon_bg);
|
||||
}
|
||||
sPlayer.getMainScreen().attachWidget(plugin, (GenericGradient)xpicon_border);
|
||||
}
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
private void initializeXpBarDisplayStandard(SpoutPlayer sPlayer)
|
||||
{
|
||||
//Setup xp bar
|
||||
xpbar = new GenericTexture();
|
||||
|
||||
if(LoadProperties.xpbar && LoadProperties.xpicon)
|
||||
{
|
||||
xpicon = new GenericTexture();
|
||||
|
||||
xpicon.setUrl("Icon.png");
|
||||
|
||||
xpicon.setHeight(16).setWidth(32).setX(LoadProperties.xpicon_x).setY(LoadProperties.xpicon_y);
|
||||
|
||||
xpicon.setDirty(true);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon);
|
||||
}
|
||||
|
||||
if(LoadProperties.xpbar)
|
||||
{
|
||||
((GenericTexture)xpbar).setUrl("xpbar_inc000.png");
|
||||
xpbar.setX(LoadProperties.xpbar_x).setY(LoadProperties.xpbar_y).setHeight(8).setWidth(256);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbar);
|
||||
}
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
private void initializeXpBarDisplaySmall(SpoutPlayer sPlayer)
|
||||
{
|
||||
//Setup xp bar
|
||||
xpbar = new GenericTexture();
|
||||
|
||||
if(LoadProperties.xpbar && LoadProperties.xpicon)
|
||||
{
|
||||
xpicon = new GenericTexture();
|
||||
|
||||
xpicon.setUrl("Icon.png");
|
||||
|
||||
xpicon.setHeight(8).setWidth(16).setX(center_x-(8+64)).setY(LoadProperties.xpicon_y+2);
|
||||
|
||||
xpicon.setDirty(true);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon);
|
||||
}
|
||||
|
||||
if(LoadProperties.xpbar)
|
||||
{
|
||||
((GenericTexture)xpbar).setUrl("xpbar_inc000.png");
|
||||
xpbar.setX(center_x-64).setY(LoadProperties.xpbar_y).setHeight(4).setWidth(128);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbar);
|
||||
}
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
private void updateXpBarStandard(Player player, PlayerProfile PP)
|
||||
{
|
||||
if(!LoadProperties.xpbar)
|
||||
return;
|
||||
|
||||
SkillType theType = null;
|
||||
|
||||
if(PP.getXpBarLocked())
|
||||
theType=PP.getSkillLock();
|
||||
else
|
||||
theType=PP.getLastGained();
|
||||
|
||||
if(theType == null)
|
||||
return;
|
||||
|
||||
((GenericTexture) xpicon).setUrl(m.getCapitalized(theType.toString())+".png");
|
||||
xpicon.setDirty(true);
|
||||
public class HUDmmo {
|
||||
private int center_x = 427/2;
|
||||
|
||||
private String playerName = null;
|
||||
|
||||
private Widget xpbar = null;
|
||||
private GenericGradient xpfill = null;
|
||||
private GenericGradient xpbg = null;
|
||||
private GenericGradient xpicon_bg = null;
|
||||
private GenericGradient xpicon_border = null;
|
||||
private GenericTexture xpicon = null;
|
||||
|
||||
private mcMMO plugin = (mcMMO) Bukkit.getServer().getPluginManager().getPlugin("mcMMO");
|
||||
|
||||
public HUDmmo(Player player) {
|
||||
playerName = player.getName();
|
||||
initializeHUD(player);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize the HUD.
|
||||
*
|
||||
* @param player Player whose HUD to initialize
|
||||
*/
|
||||
public void initializeHUD(Player player) {
|
||||
HUDType type = Users.getProfile(player).getHUDType();
|
||||
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
||||
|
||||
switch (type) {
|
||||
case RETRO:
|
||||
initializeXpBarDisplayRetro(sPlayer);
|
||||
break;
|
||||
|
||||
case STANDARD:
|
||||
initializeXpBarDisplayStandard(sPlayer);
|
||||
break;
|
||||
|
||||
case SMALL:
|
||||
initializeXpBarDisplaySmall(sPlayer);
|
||||
break;
|
||||
|
||||
case DISABLED:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Update the XP bar.
|
||||
*
|
||||
* @param type Type of XP bar
|
||||
* @param player Player whose XP bar to update
|
||||
*/
|
||||
public void updateXpBarDisplay(HUDType type, Player player) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
switch (type) {
|
||||
case RETRO:
|
||||
updateXpBarRetro(player, PP);
|
||||
break;
|
||||
|
||||
case STANDARD:
|
||||
updateXpBarStandard(player, PP);
|
||||
break;
|
||||
|
||||
case SMALL:
|
||||
updateXpBarStandard(player, PP);
|
||||
break;
|
||||
|
||||
case DISABLED:
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset a player's HUD.
|
||||
*/
|
||||
public void resetHUD() {
|
||||
SpoutPlayer sPlayer = SpoutStuff.getSpoutPlayer(playerName);
|
||||
|
||||
if (sPlayer != null) {
|
||||
sPlayer.getMainScreen().removeWidgets(plugin);
|
||||
|
||||
//Reset the objects
|
||||
xpbar = null;
|
||||
xpfill = null;
|
||||
xpbg = null;
|
||||
xpicon = null;
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Retro XP bar.
|
||||
*
|
||||
* @param sPlayer Player to initialize XP bar for
|
||||
*/
|
||||
private void initializeXpBarDisplayRetro(SpoutPlayer sPlayer) {
|
||||
Color border = new Color((float) LoadProperties.xpborder_r, (float) LoadProperties.xpborder_g, (float) LoadProperties.xpborder_b, 1f);
|
||||
Color green = new Color(0f, 1f, 0f, 1f);
|
||||
Color background = new Color((float) LoadProperties.xpbackground_r, (float) LoadProperties.xpbackground_g, (float) LoadProperties.xpbackground_b, 1f);
|
||||
Color darkbg = new Color(0.2f, 0.2f, 0.2f, 1f);
|
||||
|
||||
xpicon = new GenericTexture();
|
||||
xpbar = new GenericGradient();
|
||||
xpfill = new GenericGradient();
|
||||
xpbg = new GenericGradient();
|
||||
|
||||
xpicon_bg = new GenericGradient();
|
||||
xpicon_border = new GenericGradient();
|
||||
|
||||
xpicon_bg.setBottomColor(darkbg);
|
||||
xpicon_bg.setTopColor(darkbg);
|
||||
xpicon_bg.setWidth(4);
|
||||
xpicon_bg.setHeight(4);
|
||||
xpicon_bg.setPriority(RenderPriority.High);
|
||||
xpicon_bg.setX(142);
|
||||
xpicon_bg.setY(10);
|
||||
xpicon_bg.setDirty(true);
|
||||
|
||||
xpicon_border.setBottomColor(border);
|
||||
xpicon_border.setTopColor(border);
|
||||
xpicon_border.setWidth(6);
|
||||
xpicon_border.setHeight(6);
|
||||
xpicon_border.setPriority(RenderPriority.Highest);
|
||||
xpicon_border.setX(141);
|
||||
xpicon_border.setY(9);
|
||||
xpicon_border.setDirty(true);
|
||||
|
||||
xpicon.setWidth(6);
|
||||
xpicon.setHeight(6);
|
||||
xpicon.setX(141);
|
||||
xpicon.setY(9);
|
||||
xpicon.setPriority(RenderPriority.Normal);
|
||||
xpicon.setDirty(true);
|
||||
xpicon.setUrl("Icon_r.png");
|
||||
|
||||
xpbar.setWidth(128);
|
||||
xpbar.setHeight(4);
|
||||
xpbar.setX(149);
|
||||
xpbar.setY(10);
|
||||
((GenericGradient) xpbar).setBottomColor(border);
|
||||
((GenericGradient) xpbar).setTopColor(border);
|
||||
xpbar.setPriority(RenderPriority.Highest);
|
||||
xpbar.setDirty(true);
|
||||
|
||||
xpfill.setWidth(0);
|
||||
xpfill.setHeight(2);
|
||||
xpfill.setX(150);
|
||||
xpfill.setY(11);
|
||||
xpfill.setBottomColor(green);
|
||||
xpfill.setTopColor(green);
|
||||
xpfill.setPriority(RenderPriority.Lowest);
|
||||
xpfill.setDirty(true);
|
||||
|
||||
xpbg.setWidth(126);
|
||||
xpbg.setHeight(2);
|
||||
xpbg.setX(150);
|
||||
xpbg.setY(11);
|
||||
xpbg.setBottomColor(background);
|
||||
xpbg.setTopColor(background);
|
||||
xpbg.setPriority(RenderPriority.Low);
|
||||
xpbg.setDirty(true);
|
||||
|
||||
if (LoadProperties.xpbar) {
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbar);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpfill);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbg);
|
||||
|
||||
if (LoadProperties.xpicon) {
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon_bg);
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon_border);
|
||||
}
|
||||
}
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Standard XP bar.
|
||||
*
|
||||
* @param sPlayer Player to initialize XP bar for
|
||||
*/
|
||||
private void initializeXpBarDisplayStandard(SpoutPlayer sPlayer) {
|
||||
if (LoadProperties.xpbar) {
|
||||
xpbar = new GenericTexture();
|
||||
|
||||
((GenericTexture) xpbar).setUrl("xpbar_inc000.png");
|
||||
|
||||
xpbar.setX(LoadProperties.xpbar_x);
|
||||
xpbar.setY(LoadProperties.xpbar_y);
|
||||
xpbar.setHeight(8);
|
||||
xpbar.setWidth(256);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbar);
|
||||
|
||||
if (LoadProperties.xpicon) {
|
||||
xpicon = new GenericTexture();
|
||||
|
||||
xpicon.setUrl("Icon.png");
|
||||
xpicon.setHeight(16);
|
||||
xpicon.setWidth(32);
|
||||
xpicon.setX(LoadProperties.xpicon_x);
|
||||
xpicon.setY(LoadProperties.xpicon_y);
|
||||
xpicon.setDirty(true);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon);
|
||||
}
|
||||
}
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initialize Small XP bar.
|
||||
*
|
||||
* @param sPlayer Player to initialize XP bar for
|
||||
*/
|
||||
private void initializeXpBarDisplaySmall(SpoutPlayer sPlayer) {
|
||||
if (LoadProperties.xpbar) {
|
||||
xpbar = new GenericTexture();
|
||||
|
||||
((GenericTexture)xpbar).setUrl("xpbar_inc000.png");
|
||||
xpbar.setX(center_x - 64);
|
||||
xpbar.setY(LoadProperties.xpbar_y);
|
||||
xpbar.setHeight(4);
|
||||
xpbar.setWidth(128);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpbar);
|
||||
|
||||
if (LoadProperties.xpicon) {
|
||||
xpicon = new GenericTexture();
|
||||
|
||||
xpicon.setUrl("Icon.png");
|
||||
xpicon.setHeight(8);
|
||||
xpicon.setWidth(16);
|
||||
xpicon.setX(center_x - (8 + 64));
|
||||
xpicon.setY(LoadProperties.xpicon_y + 2);
|
||||
xpicon.setDirty(true);
|
||||
|
||||
sPlayer.getMainScreen().attachWidget(plugin, xpicon);
|
||||
}
|
||||
}
|
||||
|
||||
sPlayer.getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update XP bar for Standard & Small styles.
|
||||
*
|
||||
* @param player Player whose XP bar to update
|
||||
* @param PP Profile of the given player
|
||||
*/
|
||||
private void updateXpBarStandard(Player player, PlayerProfile PP) {
|
||||
if (!LoadProperties.xpbar) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkillType theType = getType(PP);
|
||||
|
||||
if (theType == null) { //Can this ever actually BE null? (Yes, it's null when the player has just logged in. It's not null when they gain XP in anything)
|
||||
return;
|
||||
}
|
||||
|
||||
((GenericTexture) xpicon).setUrl(m.getCapitalized(theType.toString()) + ".png");
|
||||
xpicon.setDirty(true);
|
||||
|
||||
((GenericTexture) xpbar).setUrl(getUrlBar(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.STANDARD)));
|
||||
xpbar.setDirty(true);
|
||||
|
||||
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update XP bar for Retro styles.
|
||||
*
|
||||
* @param player Player whose XP bar to update
|
||||
* @param PP Profile of the given player
|
||||
*/
|
||||
private void updateXpBarRetro(Player player, PlayerProfile PP) {
|
||||
if (!LoadProperties.xpbar) {
|
||||
return;
|
||||
}
|
||||
|
||||
SkillType theType = getType(PP);
|
||||
|
||||
if (theType == null) { //Can this ever actually BE null? (Yes, it's null when the player has just logged in. It's not null when they gain XP in anything)
|
||||
return;
|
||||
}
|
||||
|
||||
Color color = getRetroColor(theType);
|
||||
|
||||
xpicon.setUrl(m.getCapitalized(theType.toString()) + "_r.png");
|
||||
|
||||
xpfill.setBottomColor(color);
|
||||
xpfill.setTopColor(color);
|
||||
xpfill.setWidth(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.RETRO));
|
||||
xpfill.setDirty(true);
|
||||
|
||||
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
((GenericTexture) xpbar).setUrl(getUrlBar(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.STANDARD)));
|
||||
xpbar.setDirty(true);
|
||||
|
||||
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
private void updateXpBarRetro(Player player, PlayerProfile PP)
|
||||
{
|
||||
if(!LoadProperties.xpbar)
|
||||
return;
|
||||
SkillType theType = null;
|
||||
|
||||
if(PP.getXpBarLocked() && PP.getSkillLock() != null)
|
||||
theType=PP.getSkillLock();
|
||||
else
|
||||
theType=PP.getLastGained();
|
||||
|
||||
if(theType == null)
|
||||
return;
|
||||
|
||||
Color color = getRetroColor(theType);
|
||||
|
||||
if(xpicon != null && theType != null)
|
||||
xpicon.setUrl(m.getCapitalized(theType.toString())+"_r.png");
|
||||
|
||||
if(theType != null)
|
||||
xpfill.setBottomColor(color).setTopColor(color).setWidth(getXpInc(PP.getSkillXpLevel(theType), PP.getXpToLevel(theType), HUDType.RETRO)).setDirty(true);
|
||||
else
|
||||
System.out.println("theType was null!");
|
||||
|
||||
SpoutManager.getPlayer(player).getMainScreen().setDirty(true);
|
||||
}
|
||||
|
||||
private static Color getRetroColor(SkillType type) {
|
||||
switch (type) {
|
||||
case ACROBATICS:
|
||||
return new Color((float) LoadProperties.acrobatics_r, (float) LoadProperties.acrobatics_g, (float) LoadProperties.acrobatics_b, 1f);
|
||||
|
||||
case ARCHERY:
|
||||
return new Color((float) LoadProperties.archery_r, (float)LoadProperties.archery_g, (float)LoadProperties.archery_b, 1f);
|
||||
return new Color((float) LoadProperties.archery_r, (float) LoadProperties.archery_g, (float) LoadProperties.archery_b, 1f);
|
||||
|
||||
case AXES:
|
||||
return new Color((float) LoadProperties.axes_r, (float)LoadProperties.axes_g, (float)LoadProperties.axes_b, 1f);
|
||||
return new Color((float) LoadProperties.axes_r, (float) LoadProperties.axes_g, (float) LoadProperties.axes_b, 1f);
|
||||
|
||||
case EXCAVATION:
|
||||
return new Color((float)LoadProperties.excavation_r, (float)LoadProperties.excavation_g, (float)LoadProperties.excavation_b, 1f);
|
||||
return new Color((float) LoadProperties.excavation_r, (float) LoadProperties.excavation_g, (float) LoadProperties.excavation_b, 1f);
|
||||
|
||||
case HERBALISM:
|
||||
return new Color((float)LoadProperties.herbalism_r, (float)LoadProperties.herbalism_g, (float)LoadProperties.herbalism_b, 1f);
|
||||
return new Color((float) LoadProperties.herbalism_r, (float) LoadProperties.herbalism_g, (float) LoadProperties.herbalism_b, 1f);
|
||||
|
||||
case MINING:
|
||||
return new Color((float)LoadProperties.mining_r, (float)LoadProperties.mining_g, (float)LoadProperties.mining_b, 1f);
|
||||
return new Color((float) LoadProperties.mining_r, (float) LoadProperties.mining_g, (float) LoadProperties.mining_b, 1f);
|
||||
|
||||
case REPAIR:
|
||||
return new Color((float)LoadProperties.repair_r, (float)LoadProperties.repair_g, (float)LoadProperties.repair_b, 1f);
|
||||
return new Color((float) LoadProperties.repair_r, (float) LoadProperties.repair_g, (float) LoadProperties.repair_b, 1f);
|
||||
|
||||
case SWORDS:
|
||||
return new Color((float)LoadProperties.swords_r, (float)LoadProperties.swords_g, (float)LoadProperties.swords_b, 1f);
|
||||
return new Color((float) LoadProperties.swords_r, (float) LoadProperties.swords_g, (float) LoadProperties.swords_b, 1f);
|
||||
|
||||
case TAMING:
|
||||
return new Color((float)LoadProperties.taming_r, (float)LoadProperties.taming_g, (float)LoadProperties.taming_b, 1f);
|
||||
return new Color((float) LoadProperties.taming_r, (float) LoadProperties.taming_g, (float) LoadProperties.taming_b, 1f);
|
||||
|
||||
case UNARMED:
|
||||
return new Color((float)LoadProperties.unarmed_r, (float)LoadProperties.unarmed_g, (float)LoadProperties.unarmed_b, 1f);
|
||||
return new Color((float) LoadProperties.unarmed_r, (float) LoadProperties.unarmed_g, (float) LoadProperties.unarmed_b, 1f);
|
||||
|
||||
case WOODCUTTING:
|
||||
return new Color((float)LoadProperties.woodcutting_r, (float)LoadProperties.woodcutting_g, (float)LoadProperties.woodcutting_b, 1f);
|
||||
return new Color((float) LoadProperties.woodcutting_r, (float) LoadProperties.woodcutting_g, (float) LoadProperties.woodcutting_b, 1f);
|
||||
|
||||
case FISHING:
|
||||
return new Color((float)LoadProperties.fishing_r, (float)LoadProperties.fishing_g, (float)LoadProperties.fishing_b, 1f);
|
||||
return new Color((float) LoadProperties.fishing_r, (float) LoadProperties.fishing_g, (float) LoadProperties.fishing_b, 1f);
|
||||
|
||||
default:
|
||||
return new Color(0.3f, 0.3f, 0.75f, 1f);
|
||||
}
|
||||
@@ -305,13 +373,13 @@ public class HUDmmo
|
||||
|
||||
switch (num.length) {
|
||||
case 1:
|
||||
return "xpbar_inc00"+number+".png";
|
||||
return "xpbar_inc00" + number + ".png";
|
||||
|
||||
case 2:
|
||||
return "xpbar_inc0"+number+".png";
|
||||
return "xpbar_inc0" + number + ".png";
|
||||
|
||||
default:
|
||||
return "xpbar_inc"+number+".png";
|
||||
return "xpbar_inc" + number + ".png";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -334,4 +402,13 @@ public class HUDmmo
|
||||
|
||||
return (int) (percentage / inc);
|
||||
}
|
||||
}
|
||||
|
||||
private static SkillType getType(PlayerProfile PP) {
|
||||
if (PP.getXpBarLocked()) {
|
||||
return PP.getSkillLock();
|
||||
}
|
||||
else {
|
||||
return PP.getLastGained();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -2,46 +2,50 @@ package com.gmail.nossr50.datatypes;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
|
||||
public enum SkillType
|
||||
{
|
||||
ACROBATICS(LoadProperties.levelCapAcrobatics),
|
||||
ACROBATICS(LoadProperties.levelCapAcrobatics, LoadProperties.acrobaticsxpmodifier),
|
||||
ALL, //This one is just for convenience
|
||||
ARCHERY(LoadProperties.levelCapArchery),
|
||||
AXES(AbilityType.SKULL_SPLIITER, LoadProperties.levelCapAxes, ToolType.AXE),
|
||||
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, LoadProperties.levelCapExcavation, ToolType.SHOVEL),
|
||||
FISHING(LoadProperties.levelCapFishing),
|
||||
HERBALISM(AbilityType.GREEN_TERRA, LoadProperties.levelCapHerbalism, ToolType.HOE),
|
||||
MINING(AbilityType.SUPER_BREAKER, LoadProperties.levelCapMining, ToolType.PICKAXE),
|
||||
REPAIR(LoadProperties.levelCapRepair),
|
||||
SWORDS(AbilityType.SERRATED_STRIKES, LoadProperties.levelCapSwords, ToolType.SWORD),
|
||||
TAMING(LoadProperties.levelCapTaming),
|
||||
UNARMED(AbilityType.BERSERK, LoadProperties.levelCapUnarmed, ToolType.FISTS),
|
||||
WOODCUTTING(AbilityType.TREE_FELLER, LoadProperties.levelCapWoodcutting, ToolType.AXE);
|
||||
ARCHERY(LoadProperties.levelCapArchery, LoadProperties.archeryxpmodifier),
|
||||
AXES(AbilityType.SKULL_SPLIITER, LoadProperties.levelCapAxes, ToolType.AXE, LoadProperties.axesxpmodifier),
|
||||
EXCAVATION(AbilityType.GIGA_DRILL_BREAKER, LoadProperties.levelCapExcavation, ToolType.SHOVEL, LoadProperties.excavationxpmodifier),
|
||||
FISHING(LoadProperties.levelCapFishing, LoadProperties.fishingxpmodifier),
|
||||
HERBALISM(AbilityType.GREEN_TERRA, LoadProperties.levelCapHerbalism, ToolType.HOE, LoadProperties.herbalismxpmodifier),
|
||||
MINING(AbilityType.SUPER_BREAKER, LoadProperties.levelCapMining, ToolType.PICKAXE, LoadProperties.miningxpmodifier),
|
||||
REPAIR(LoadProperties.levelCapRepair, LoadProperties.repairxpmodifier),
|
||||
SWORDS(AbilityType.SERRATED_STRIKES, LoadProperties.levelCapSwords, ToolType.SWORD, LoadProperties.swordsxpmodifier),
|
||||
TAMING(LoadProperties.levelCapTaming, LoadProperties.tamingxpmodifier),
|
||||
UNARMED(AbilityType.BERSERK, LoadProperties.levelCapUnarmed, ToolType.FISTS, LoadProperties.unarmedxpmodifier),
|
||||
WOODCUTTING(AbilityType.TREE_FELLER, LoadProperties.levelCapWoodcutting, ToolType.AXE, LoadProperties.woodcuttingxpmodifier);
|
||||
|
||||
private AbilityType ability;
|
||||
private int maxLevel;
|
||||
private ToolType tool;
|
||||
private double xpModifier;
|
||||
|
||||
private SkillType()
|
||||
{
|
||||
this.ability = null;
|
||||
this.maxLevel = 0;
|
||||
this.tool = null;
|
||||
this.xpModifier = 0;
|
||||
}
|
||||
|
||||
private SkillType(AbilityType ability, int maxLevel, ToolType tool)
|
||||
private SkillType(AbilityType ability, int maxLevel, ToolType tool, double xpModifier)
|
||||
{
|
||||
this.ability = ability;
|
||||
this.maxLevel = maxLevel;
|
||||
this.tool = tool;
|
||||
this.xpModifier = xpModifier;
|
||||
}
|
||||
|
||||
private SkillType(int maxLevel)
|
||||
private SkillType(int maxLevel, double xpModifier)
|
||||
{
|
||||
this(null, maxLevel, null);
|
||||
this(null, maxLevel, null, xpModifier);
|
||||
}
|
||||
|
||||
public AbilityType getAbility()
|
||||
@@ -57,9 +61,8 @@ public enum SkillType
|
||||
return Integer.MAX_VALUE;
|
||||
}
|
||||
|
||||
public ToolType getTool()
|
||||
{
|
||||
return this.tool;
|
||||
public ToolType getTool() {
|
||||
return tool;
|
||||
}
|
||||
|
||||
public boolean getPermissions(Player player)
|
||||
@@ -93,4 +96,12 @@ public enum SkillType
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public double getXpModifier() {
|
||||
return xpModifier;
|
||||
}
|
||||
|
||||
public int getSkillLevel(Player player) {
|
||||
return Users.getProfile(player).getSkillLevel(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -34,96 +34,6 @@ public enum ToolType
|
||||
return this.raiseTool;
|
||||
}
|
||||
|
||||
public boolean getToolMode(PlayerProfile PP)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case AXE:
|
||||
return PP.getAxePreparationMode();
|
||||
case FISTS:
|
||||
return PP.getFistsPreparationMode();
|
||||
case HOE:
|
||||
return PP.getHoePreparationMode();
|
||||
case PICKAXE:
|
||||
return PP.getPickaxePreparationMode();
|
||||
case SHOVEL:
|
||||
return PP.getShovelPreparationMode();
|
||||
case SWORD:
|
||||
return PP.getSwordsPreparationMode();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public void setToolMode(PlayerProfile PP, boolean bool)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case AXE:
|
||||
PP.setAxePreparationMode(bool);
|
||||
break;
|
||||
case FISTS:
|
||||
PP.setFistsPreparationMode(bool);
|
||||
break;
|
||||
case HOE:
|
||||
PP.setHoePreparationMode(bool);
|
||||
break;
|
||||
case PICKAXE:
|
||||
PP.setPickaxePreparationMode(bool);
|
||||
break;
|
||||
case SHOVEL:
|
||||
PP.setShovelPreparationMode(bool);
|
||||
break;
|
||||
case SWORD:
|
||||
PP.setSwordsPreparationMode(bool);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public long getToolATS(PlayerProfile PP)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case AXE:
|
||||
return PP.getAxePreparationATS();
|
||||
case FISTS:
|
||||
return PP.getFistsPreparationATS();
|
||||
case HOE:
|
||||
return PP.getHoePreparationATS();
|
||||
case PICKAXE:
|
||||
return PP.getPickaxePreparationATS();
|
||||
case SHOVEL:
|
||||
return PP.getShovelPreparationATS();
|
||||
case SWORD:
|
||||
return PP.getSwordsPreparationATS();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public void setToolATS(PlayerProfile PP, long ats)
|
||||
{
|
||||
switch(this)
|
||||
{
|
||||
case AXE:
|
||||
PP.setAxePreparationATS(ats);
|
||||
break;
|
||||
case FISTS:
|
||||
PP.setFistsPreparationATS(ats);
|
||||
break;
|
||||
case HOE:
|
||||
PP.setHoePreparationATS(ats);
|
||||
break;
|
||||
case PICKAXE:
|
||||
PP.setPickaxePreparationATS(ats);
|
||||
break;
|
||||
case SHOVEL:
|
||||
PP.setShovelPreparationATS(ats);
|
||||
break;
|
||||
case SWORD:
|
||||
PP.setSwordsPreparationATS(ats);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean inHand(ItemStack is)
|
||||
{
|
||||
switch(this)
|
||||
|
||||
@@ -1,15 +0,0 @@
|
||||
package com.gmail.nossr50.events;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class FakeBlockBreakEvent extends BlockBreakEvent {
|
||||
|
||||
public FakeBlockBreakEvent(Block theBlock, Player player) {
|
||||
super(theBlock, player, new ArrayList<ItemStack>(theBlock.getDrops()));
|
||||
}
|
||||
}
|
||||
@@ -1,54 +0,0 @@
|
||||
package com.gmail.nossr50.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
/**
|
||||
* Called when a user levels up in a skill
|
||||
*/
|
||||
public class McMMOPlayerLevelUpEvent extends Event {
|
||||
private Player player;
|
||||
private SkillType skill;
|
||||
private int levelsGained;
|
||||
|
||||
public McMMOPlayerLevelUpEvent(Player player, SkillType skill) {
|
||||
this.player = player;
|
||||
this.skill = skill;
|
||||
this.levelsGained = 1; // Always 1 for now as we call in the loop where the levelups are calculated, could change later!
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player leveling up
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SkillType that is being leveled up
|
||||
*/
|
||||
public SkillType getSkill() {
|
||||
return skill;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of levels gained in this event
|
||||
*/
|
||||
public int getLevelsGained() {
|
||||
return levelsGained;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -1,51 +0,0 @@
|
||||
package com.gmail.nossr50.events;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.HandlerList;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerXpGainEvent extends Event {
|
||||
private Player player;
|
||||
private SkillType skill;
|
||||
private int xpGained;
|
||||
|
||||
public McMMOPlayerXpGainEvent(Player player, SkillType skill, int xpGained) {
|
||||
this.player = player;
|
||||
this.skill = skill;
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Player gaining experience (can be null)
|
||||
*/
|
||||
public Player getPlayer() {
|
||||
return player;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return SkillType that is gaining experience
|
||||
*/
|
||||
public SkillType getSkill() {
|
||||
return skill;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number experience gained in this event
|
||||
*/
|
||||
public int getXpGained() {
|
||||
return xpGained;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerExperienceEvent extends PlayerEvent {
|
||||
|
||||
protected SkillType skill;
|
||||
protected int skillLevel;
|
||||
|
||||
public McMMOPlayerExperienceEvent(Player player, SkillType skill) {
|
||||
super(player);
|
||||
this.skill = skill;
|
||||
this.skillLevel = skill.getSkillLevel(player);
|
||||
}
|
||||
|
||||
public SkillType getSkill() {
|
||||
return skill;
|
||||
}
|
||||
|
||||
public int getSkillLevel() {
|
||||
return skillLevel;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
/**
|
||||
* Called when a user levels up in a skill
|
||||
*/
|
||||
public class McMMOPlayerLevelUpEvent extends McMMOPlayerExperienceEvent {
|
||||
private int levelsGained;
|
||||
|
||||
public McMMOPlayerLevelUpEvent(Player player, SkillType skill) {
|
||||
super(player, skill);
|
||||
this.levelsGained = 1; // Always 1 for now as we call in the loop where the levelups are calculated, could change later!
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number of levels gained in this event
|
||||
*/
|
||||
public int getLevelsGained() {
|
||||
return levelsGained;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
package com.gmail.nossr50.events.experience;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerXpGainEvent extends McMMOPlayerExperienceEvent {
|
||||
private int xpGained;
|
||||
|
||||
public McMMOPlayerXpGainEvent(Player player, SkillType skill, int xpGained) {
|
||||
super(player, skill);
|
||||
this.xpGained = xpGained;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return The number experience gained in this event
|
||||
*/
|
||||
public int getXpGained() {
|
||||
return xpGained;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
|
||||
//import java.util.ArrayList;
|
||||
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
//import org.bukkit.inventory.ItemStack;
|
||||
|
||||
public class FakeBlockBreakEvent extends BlockBreakEvent {
|
||||
|
||||
public FakeBlockBreakEvent(Block theBlock, Player player) {
|
||||
super(theBlock, player);
|
||||
}
|
||||
|
||||
// public FakeBlockBreakEvent(Block theBlock, Player player) {
|
||||
// super(theBlock, player, new ArrayList<ItemStack>(theBlock.getDrops()));
|
||||
// }
|
||||
}
|
||||
@@ -1,9 +1,10 @@
|
||||
package com.gmail.nossr50.events;
|
||||
package com.gmail.nossr50.events.fake;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
|
||||
public class FakeEntityDamageByEntityEvent extends EntityDamageByEntityEvent {
|
||||
|
||||
public FakeEntityDamageByEntityEvent(Entity damager, Entity damagee, DamageCause cause, int damage) {
|
||||
super(damager, damagee, cause, damage);
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events;
|
||||
package com.gmail.nossr50.events.fake;
|
||||
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@@ -0,0 +1,12 @@
|
||||
package com.gmail.nossr50.events.fake;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
|
||||
public class FakePlayerAnimationEvent extends PlayerAnimationEvent{
|
||||
|
||||
public FakePlayerAnimationEvent(Player player) {
|
||||
super(player);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
package com.gmail.nossr50.events;
|
||||
package com.gmail.nossr50.events.items;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.event.Cancellable;
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
|
||||
public class McMMOPartyChangeEvent extends PlayerEvent implements Cancellable{
|
||||
|
||||
protected String oldParty;
|
||||
protected String newParty;
|
||||
protected EventReason reason;
|
||||
protected boolean cancelled;
|
||||
|
||||
public McMMOPartyChangeEvent(Player player, String oldParty, String newParty, EventReason reason) {
|
||||
super(player);
|
||||
|
||||
if (newParty != null) {
|
||||
newParty = newParty.replace(":", ".");
|
||||
}
|
||||
|
||||
this.oldParty = oldParty;
|
||||
this.newParty = newParty;
|
||||
this.reason = reason;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public String getOldParty() {
|
||||
return oldParty;
|
||||
}
|
||||
|
||||
public String getNewParty() {
|
||||
return newParty;
|
||||
}
|
||||
|
||||
public EventReason getReason() {
|
||||
return reason;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
|
||||
public enum EventReason{
|
||||
JOINED_PARTY,
|
||||
LEFT_PARTY,
|
||||
KICKED_FROM_PARTY,
|
||||
CHANGED_PARTIES;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.gmail.nossr50.events.party;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerTeleportEvent;
|
||||
|
||||
public class McMMOPartyTeleportEvent extends PlayerTeleportEvent{
|
||||
|
||||
private String party;
|
||||
private Player target;
|
||||
|
||||
public McMMOPartyTeleportEvent(Player player, Player target, String party) {
|
||||
super(player, player.getLocation(), target.getLocation(), TeleportCause.COMMAND);
|
||||
this.party = party;
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public String getParty() {
|
||||
return party;
|
||||
}
|
||||
|
||||
public Player getTarget() {
|
||||
return target;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Cancellable;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerRepairCheckEvent extends McMMOPlayerSkillEvent implements Cancellable{
|
||||
|
||||
private int repairAmount;
|
||||
private ItemStack repairMaterial;
|
||||
private ItemStack repairedObject;
|
||||
private boolean cancelled;
|
||||
|
||||
public McMMOPlayerRepairCheckEvent(Player player, int repairAmount, ItemStack repairMaterial, ItemStack repairedObject) {
|
||||
super(player, SkillType.REPAIR);
|
||||
this.repairAmount = repairAmount;
|
||||
this.repairMaterial = repairMaterial;
|
||||
this.repairedObject = repairedObject;
|
||||
this.cancelled = false;
|
||||
}
|
||||
|
||||
public int getRepairAmount() {
|
||||
return repairAmount;
|
||||
}
|
||||
|
||||
public ItemStack getRepairMaterial() {
|
||||
return repairMaterial;
|
||||
}
|
||||
|
||||
public ItemStack getRepairedObject() {
|
||||
return repairedObject;
|
||||
}
|
||||
|
||||
/** Following are required for Cancellable **/
|
||||
@Override
|
||||
public boolean isCancelled() {
|
||||
return cancelled;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCancelled(boolean cancelled) {
|
||||
this.cancelled = cancelled;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerRepairEvent extends McMMOPlayerSkillEvent{
|
||||
|
||||
private ItemStack item;
|
||||
private short repairAmount;
|
||||
|
||||
public McMMOPlayerRepairEvent(Player player, ItemStack item, short repairAmount) {
|
||||
super(player, SkillType.REPAIR);
|
||||
this.item = item;
|
||||
this.repairAmount = repairAmount;
|
||||
}
|
||||
|
||||
public ItemStack getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public int getRepairAmount() {
|
||||
return repairAmount;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
package com.gmail.nossr50.events.skills;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.HandlerList;
|
||||
import org.bukkit.event.player.PlayerEvent;
|
||||
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
public class McMMOPlayerSkillEvent extends PlayerEvent{
|
||||
|
||||
protected SkillType skill;
|
||||
protected int skillLevel;
|
||||
|
||||
public McMMOPlayerSkillEvent(Player player, SkillType skill) {
|
||||
super(player);
|
||||
this.skill = skill;
|
||||
this.skillLevel = skill.getSkillLevel(player);
|
||||
}
|
||||
|
||||
public SkillType getSkill() {
|
||||
return skill;
|
||||
}
|
||||
|
||||
public int getSkillLevel() {
|
||||
return skillLevel;
|
||||
}
|
||||
|
||||
/** Rest of file is required boilerplate for custom events **/
|
||||
private static final HandlerList handlers = new HandlerList();
|
||||
|
||||
@Override
|
||||
public HandlerList getHandlers() {
|
||||
return handlers;
|
||||
}
|
||||
|
||||
public static HandlerList getHandlerList() {
|
||||
return handlers;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,12 +11,16 @@ import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.datatypes.ToolType;
|
||||
import com.gmail.nossr50.skills.Excavation;
|
||||
import com.gmail.nossr50.skills.Herbalism;
|
||||
import com.gmail.nossr50.skills.Mining;
|
||||
import com.gmail.nossr50.skills.Repair;
|
||||
import com.gmail.nossr50.skills.Skills;
|
||||
import com.gmail.nossr50.skills.WoodCutting;
|
||||
import com.gmail.nossr50.spout.SpoutSounds;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.CropState;
|
||||
@@ -32,17 +36,11 @@ import org.bukkit.event.block.BlockDamageEvent;
|
||||
import org.bukkit.event.block.BlockPistonExtendEvent;
|
||||
import org.bukkit.event.block.BlockPistonRetractEvent;
|
||||
import org.bukkit.event.block.BlockPlaceEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.metadata.FixedMetadataValue;
|
||||
|
||||
import org.getspout.spoutapi.SpoutManager;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.events.FakeBlockBreakEvent;
|
||||
|
||||
public class mcBlockListener implements Listener {
|
||||
private final mcMMO plugin;
|
||||
|
||||
@@ -97,17 +95,8 @@ public class mcBlockListener implements Listener {
|
||||
*/
|
||||
@EventHandler(priority = EventPriority.MONITOR, ignoreCancelled = true)
|
||||
public void onBlockPlace(BlockPlaceEvent event) {
|
||||
Block block;
|
||||
Block block = event.getBlock();
|
||||
Player player = event.getPlayer();
|
||||
|
||||
//When blocks are placed on snow this event reports the wrong block.
|
||||
if (event.getBlockReplacedState() != null && event.getBlockReplacedState().getType().equals(Material.SNOW)) {
|
||||
block = event.getBlockAgainst();
|
||||
}
|
||||
else {
|
||||
block = event.getBlock();
|
||||
}
|
||||
|
||||
int id = block.getTypeId();
|
||||
Material mat = block.getType();
|
||||
|
||||
@@ -118,7 +107,7 @@ public class mcBlockListener implements Listener {
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
Block newLocation = block.getRelative(0, y+1, 0);
|
||||
Block newLocation = block.getRelative(0, y + 1, 0);
|
||||
newLocation.setMetadata("mcmmoPlacedBlock", new FixedMetadataValue(plugin, true));
|
||||
break;
|
||||
}
|
||||
@@ -131,22 +120,7 @@ public class mcBlockListener implements Listener {
|
||||
}
|
||||
|
||||
if (id == LoadProperties.anvilID && LoadProperties.anvilmessages) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
if (!PP.getPlacedAnvil()) {
|
||||
if (LoadProperties.spoutEnabled) {
|
||||
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
||||
|
||||
if (sPlayer.isSpoutCraftEnabled()) {
|
||||
sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.getMaterial(id));
|
||||
}
|
||||
}
|
||||
else {
|
||||
event.getPlayer().sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil"));
|
||||
}
|
||||
|
||||
PP.togglePlacedAnvil();
|
||||
}
|
||||
Repair.placedAnvilCheck(player, id);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -163,7 +137,7 @@ public class mcBlockListener implements Listener {
|
||||
Material mat = block.getType();
|
||||
ItemStack inhand = player.getItemInHand();
|
||||
|
||||
if(event instanceof FakeBlockBreakEvent) {
|
||||
if (event instanceof FakeBlockBreakEvent) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -172,14 +146,13 @@ public class mcBlockListener implements Listener {
|
||||
*/
|
||||
|
||||
/* Green Terra */
|
||||
if (PP.getHoePreparationMode() && mcPermissions.getInstance().greenTerra(player) && ((mat.equals(Material.CROPS) && block.getData() == CropState.RIPE.getData()) || Herbalism.canBeGreenTerra(mat))) {
|
||||
if (PP.getToolPreparationMode(ToolType.HOE) && mcPermissions.getInstance().greenTerra(player) && ((mat.equals(Material.CROPS) && block.getData() == CropState.RIPE.getData()) || Herbalism.canBeGreenTerra(mat))) {
|
||||
Skills.abilityCheck(player, SkillType.HERBALISM);
|
||||
}
|
||||
|
||||
/* Triple drops */
|
||||
if (PP.getGreenTerraMode() && Herbalism.canBeGreenTerra(mat)) {
|
||||
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && Herbalism.canBeGreenTerra(mat)) {
|
||||
Herbalism.herbalismProcCheck(block, player, event, plugin);
|
||||
Herbalism.herbalismProcCheck(block, player, event, plugin); //Called twice for triple drop functionality
|
||||
}
|
||||
|
||||
if (mcPermissions.getInstance().herbalismDoubleDrops(player) && Herbalism.canBeGreenTerra(mat)) {
|
||||
@@ -212,7 +185,7 @@ public class mcBlockListener implements Listener {
|
||||
}
|
||||
}
|
||||
|
||||
if (PP.getTreeFellerMode() && mcPermissions.getInstance().treeFeller(player)) {
|
||||
if (PP.getAbilityMode(AbilityType.TREE_FELLER) && mcPermissions.getInstance().treeFeller(player)) {
|
||||
WoodCutting.treeFeller(event);
|
||||
}
|
||||
|
||||
@@ -254,35 +227,35 @@ public class mcBlockListener implements Listener {
|
||||
* ABILITY PREPARATION CHECKS
|
||||
*/
|
||||
if (BlockChecks.abilityBlockCheck(mat)) {
|
||||
if (PP.getHoePreparationMode() && (Herbalism.canBeGreenTerra(mat) || Herbalism.makeMossy(mat))) {
|
||||
if (PP.getToolPreparationMode(ToolType.HOE) && (Herbalism.canBeGreenTerra(mat) || Herbalism.makeMossy(mat))) {
|
||||
Skills.abilityCheck(player, SkillType.HERBALISM);
|
||||
}
|
||||
else if (PP.getAxePreparationMode() && 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) && mcPermissions.getInstance().treeFeller(player)) { //Why are we checking the permissions here?
|
||||
Skills.abilityCheck(player, SkillType.WOODCUTTING);
|
||||
}
|
||||
else if (PP.getPickaxePreparationMode() && Mining.canBeSuperBroken(mat)) {
|
||||
else if (PP.getToolPreparationMode(ToolType.PICKAXE) && Mining.canBeSuperBroken(mat)) {
|
||||
Skills.abilityCheck(player, SkillType.MINING);
|
||||
}
|
||||
else if (PP.getShovelPreparationMode() && Excavation.canBeGigaDrillBroken(mat)) {
|
||||
else if (PP.getToolPreparationMode(ToolType.SHOVEL) && Excavation.canBeGigaDrillBroken(mat)) {
|
||||
Skills.abilityCheck(player, SkillType.EXCAVATION);
|
||||
}
|
||||
else if (PP.getFistsPreparationMode() && (Excavation.canBeGigaDrillBroken(mat) || mat.equals(Material.SNOW))) {
|
||||
else if (PP.getToolPreparationMode(ToolType.FISTS) && (Excavation.canBeGigaDrillBroken(mat) || mat.equals(Material.SNOW))) {
|
||||
Skills.abilityCheck(player, SkillType.UNARMED);
|
||||
}
|
||||
}
|
||||
|
||||
/* TREE FELLER SOUNDS */
|
||||
if (LoadProperties.spoutEnabled && mat.equals(Material.LOG) && PP.getTreeFellerMode()) {
|
||||
if (LoadProperties.spoutEnabled && mat.equals(Material.LOG) && PP.getAbilityMode(AbilityType.TREE_FELLER)) {
|
||||
SpoutSounds.playSoundForPlayer(SoundEffect.FIZZ, player, block.getLocation());
|
||||
}
|
||||
|
||||
/*
|
||||
* ABILITY TRIGGER CHECKS
|
||||
*/
|
||||
if (PP.getGreenTerraMode() && mcPermissions.getInstance().greenTerra(player) && Herbalism.makeMossy(mat)) {
|
||||
if (PP.getAbilityMode(AbilityType.GREEN_TERRA) && mcPermissions.getInstance().greenTerra(player) && Herbalism.makeMossy(mat)) {
|
||||
Herbalism.greenTerra(player, block);
|
||||
}
|
||||
else if (PP.getGigaDrillBreakerMode() && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
||||
else if (PP.getAbilityMode(AbilityType.GIGA_DRILL_BREAKER) && Skills.triggerCheck(player, block, AbilityType.GIGA_DRILL_BREAKER)) {
|
||||
if (LoadProperties.excavationRequiresShovel && ItemChecks.isShovel(inhand)) {
|
||||
event.setInstaBreak(true);
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
@@ -292,9 +265,9 @@ public class mcBlockListener implements Listener {
|
||||
Excavation.gigaDrillBreaker(player, block);
|
||||
}
|
||||
}
|
||||
else if (PP.getBerserkMode() && Skills.triggerCheck(player, block, AbilityType.BERSERK)) {
|
||||
else if (PP.getAbilityMode(AbilityType.BERSERK) && Skills.triggerCheck(player, block, AbilityType.BERSERK)) {
|
||||
if (inhand.getType().equals(Material.AIR)) {
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
|
||||
event.setInstaBreak(true);
|
||||
@@ -304,7 +277,7 @@ public class mcBlockListener implements Listener {
|
||||
SpoutSounds.playSoundForPlayer(SoundEffect.POP, player, block.getLocation());
|
||||
}
|
||||
}
|
||||
else if (PP.getSuperBreakerMode() && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) {
|
||||
else if (PP.getAbilityMode(AbilityType.SUPER_BREAKER) && Skills.triggerCheck(player, block, AbilityType.SUPER_BREAKER)) {
|
||||
if (LoadProperties.miningrequirespickaxe && ItemChecks.isMiningPick(inhand)) {
|
||||
event.setInstaBreak(true);
|
||||
Mining.SuperBreakerBlockCheck(player, block);
|
||||
|
||||
@@ -30,8 +30,8 @@ import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.events.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageByEntityEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeEntityDamageEvent;
|
||||
import com.gmail.nossr50.party.Party;
|
||||
import com.gmail.nossr50.runnables.mcBleedTimer;
|
||||
import com.gmail.nossr50.skills.Acrobatics;
|
||||
@@ -152,7 +152,7 @@ public class mcEntityListener implements Listener {
|
||||
Archery.arrowRetrievalCheck(x, plugin);
|
||||
|
||||
if (x instanceof Player) {
|
||||
Users.getProfile((Player)x).setBleedTicks(0);
|
||||
Users.getProfile((Player)x).resetBleedTicks();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,7 @@ import com.gmail.nossr50.commands.general.XprateCommand;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.runnables.RemoveProfileFromMemoryTask;
|
||||
import com.gmail.nossr50.spout.SpoutStuff;
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
@@ -112,7 +113,7 @@ public class mcPlayerListener implements Listener {
|
||||
*/
|
||||
@EventHandler(ignoreCancelled = true)
|
||||
public void onPlayerPickupItem(PlayerPickupItemEvent event) {
|
||||
if (Users.getProfile(event.getPlayer()).getBerserkMode()) {
|
||||
if (Users.getProfile(event.getPlayer()).getAbilityMode(AbilityType.BERSERK)) {
|
||||
event.setCancelled(true);
|
||||
}
|
||||
}
|
||||
@@ -140,7 +141,7 @@ public class mcPlayerListener implements Listener {
|
||||
/* GARBAGE COLLECTION */
|
||||
|
||||
//Remove Spout Stuff
|
||||
if(LoadProperties.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) {
|
||||
if (LoadProperties.spoutEnabled && SpoutStuff.playerHUDs.containsKey(player)) {
|
||||
SpoutStuff.playerHUDs.remove(player);
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ package com.gmail.nossr50.listeners;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
|
||||
import com.gmail.nossr50.events.McMMOPlayerXpGainEvent;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerXpGainEvent;
|
||||
|
||||
/**
|
||||
* Listener for listening to our own events, only really useful for catching errors
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
@@ -7,16 +9,18 @@ import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.events.McMMOItemSpawnEvent;
|
||||
import com.gmail.nossr50.events.fake.FakeBlockBreakEvent;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
import com.gmail.nossr50.events.items.McMMOItemSpawnEvent;
|
||||
|
||||
public class m {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Gets a capitalized version of the target string.
|
||||
*
|
||||
@@ -123,7 +127,7 @@ public class m {
|
||||
|
||||
//Support for NoCheat
|
||||
if (shouldArmSwing) {
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
}
|
||||
|
||||
@@ -224,7 +228,7 @@ public class m {
|
||||
* @param chance The percentage chance for the item to drop
|
||||
*/
|
||||
public static void mcRandomDropItem(Location location, ItemStack is, double chance) {
|
||||
if (Math.random() * 100 < chance) {
|
||||
if (random.nextInt(100) < chance) {
|
||||
mcDropItem(location, is);
|
||||
}
|
||||
}
|
||||
@@ -258,9 +262,8 @@ public class m {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
location.getWorld().dropItemNaturally(location, itemStack);
|
||||
}
|
||||
|
||||
location.getWorld().dropItemNaturally(location, itemStack);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -186,7 +186,7 @@ public class mcMMO extends JavaPlugin {
|
||||
* @param player Player whose profile to get
|
||||
* @return the PlayerProfile object
|
||||
*/
|
||||
public PlayerProfile getPlayerProfile(Player player) {
|
||||
public static PlayerProfile getPlayerProfile(Player player) {
|
||||
return Users.getProfile(player);
|
||||
}
|
||||
|
||||
@@ -198,7 +198,7 @@ public class mcMMO extends JavaPlugin {
|
||||
* @param player
|
||||
* @param skillType
|
||||
*/
|
||||
public void checkXp(Player player, SkillType skillType) {
|
||||
public static void checkXp(Player player, SkillType skillType) {
|
||||
if (skillType == SkillType.ALL) {
|
||||
Skills.XpCheckAll(player);
|
||||
}
|
||||
@@ -216,7 +216,7 @@ public class mcMMO extends JavaPlugin {
|
||||
* @param playerb The second player to check
|
||||
* @return true if the two players are in the same party, false otherwise
|
||||
*/
|
||||
public boolean inSameParty(Player playera, Player playerb) {
|
||||
public static boolean inSameParty(Player playera, Player playerb) {
|
||||
if (Users.getProfile(playera).inParty() && Users.getProfile(playerb).inParty()) {
|
||||
if (Users.getProfile(playera).getParty().equals(Users.getProfile(playerb).getParty())) {
|
||||
return true;
|
||||
@@ -237,7 +237,7 @@ public class mcMMO extends JavaPlugin {
|
||||
*
|
||||
* @return the list of parties.
|
||||
*/
|
||||
public ArrayList<String> getParties() {
|
||||
public static ArrayList<String> getParties() {
|
||||
String location = "plugins/mcMMO/mcmmo.users";
|
||||
ArrayList<String> parties = new ArrayList<String>();
|
||||
|
||||
|
||||
@@ -139,8 +139,7 @@ public class Party {
|
||||
if(newOwner != null && p != null){
|
||||
if(inSameParty(newOwner, p))
|
||||
{
|
||||
//TODO: Needs more locale.
|
||||
p.sendMessage(newOwner.getName()+" is the new party owner.");
|
||||
p.sendMessage(newOwner.getName()+" is the new party owner."); //TODO: Needs more locale
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -205,19 +204,16 @@ public class Party {
|
||||
{
|
||||
if(password == null)
|
||||
{
|
||||
//TODO: Needs more locale.
|
||||
player.sendMessage("This party requires a password. Use /party <party> <password> to join it.");
|
||||
player.sendMessage("This party requires a password. Use /party <party> <password> to join it."); //TODO: Needs more locale.
|
||||
return;
|
||||
} else if(!password.equalsIgnoreCase(getPartyPassword(newParty)))
|
||||
{
|
||||
//TODO: Needs more locale.
|
||||
player.sendMessage("Party password incorrect.");
|
||||
player.sendMessage("Party password incorrect."); //TODO: Needs more locale.
|
||||
return;
|
||||
}
|
||||
} else
|
||||
{
|
||||
//TODO: Needs more locale.
|
||||
player.sendMessage("Party is locked.");
|
||||
player.sendMessage("Party is locked."); //TODO: Needs more locale.
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -299,7 +295,7 @@ public class Party {
|
||||
savePartyLocks();
|
||||
}
|
||||
|
||||
public void deleteParty(String partyName) {
|
||||
private void deleteParty(String partyName) {
|
||||
this.partyPlayers.remove(partyName);
|
||||
this.partyLocks.remove(partyName);
|
||||
this.partyPasswords.remove(partyName);
|
||||
@@ -319,13 +315,11 @@ public class Party {
|
||||
if(playerKey.equalsIgnoreCase(playerName)) {
|
||||
partyPlayers.get(partyName).put(playerName, true);
|
||||
informPartyMembersOwnerChange(playerName);
|
||||
//TODO: Needs more locale.
|
||||
plugin.getServer().getPlayer(playerName).sendMessage("You are now the party owner.");
|
||||
plugin.getServer().getPlayer(playerName).sendMessage("You are now the party owner."); //TODO: Needs more locale.
|
||||
continue;
|
||||
}
|
||||
if(partyPlayers.get(partyName).get(playerKey)) {
|
||||
//TODO: Needs more locale.
|
||||
plugin.getServer().getPlayer(playerKey).sendMessage("You are no longer party owner.");
|
||||
plugin.getServer().getPlayer(playerKey).sendMessage("You are no longer party owner."); //TODO: Needs more locale.
|
||||
partyPlayers.get(partyName).put(playerKey, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.bukkit.CropState;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
|
||||
@@ -21,7 +22,7 @@ public class GreenThumbTimer implements Runnable {
|
||||
block.setType(Material.CROPS);
|
||||
|
||||
//This replants the wheat at a certain stage in development based on Herbalism Skill
|
||||
if (!PP.getGreenTerraMode()) {
|
||||
if (!PP.getAbilityMode(AbilityType.GREEN_TERRA)) {
|
||||
if (PP.getSkillLevel(SkillType.HERBALISM) >= 600) {
|
||||
block.setData(CropState.MEDIUM.getData());
|
||||
}
|
||||
|
||||
@@ -13,7 +13,10 @@ public class RemoveProfileFromMemoryTask implements Runnable {
|
||||
|
||||
@Override
|
||||
public void run() {
|
||||
Users.getProfile(player.getName()).save(); //We save here so players don't quit/reconnect to cause lag
|
||||
Users.removeUserByName(player.getName());
|
||||
//Check if the profile still exists (stuff like MySQL reconnection removes profiles)
|
||||
if(Users.players.containsKey(player.getName().toLowerCase())) {
|
||||
Users.getProfile(player.getName()).save(); //We save here so players don't quit/reconnect to cause lag
|
||||
Users.removeUserByName(player.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
import org.bukkit.event.entity.EntityDamageEvent;
|
||||
@@ -14,6 +16,8 @@ import com.gmail.nossr50.party.Party;
|
||||
|
||||
public class Acrobatics {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Check for fall damage reduction.
|
||||
*
|
||||
@@ -39,7 +43,7 @@ public class Acrobatics {
|
||||
acrovar = acrovar * 2;
|
||||
}
|
||||
|
||||
if ((acrovar > MAX_BONUS_LEVEL || Math.random() * 1000 <= acrovar) && mcPermissions.getInstance().roll(player)) {
|
||||
if ((acrovar > MAX_BONUS_LEVEL || random.nextInt(1000) <= acrovar) && mcPermissions.getInstance().roll(player)) {
|
||||
int threshold = 7;
|
||||
|
||||
if (gracefulRoll) {
|
||||
@@ -103,7 +107,7 @@ public class Acrobatics {
|
||||
int skillLevel = PPd.getSkillLevel(SkillType.ACROBATICS);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 4000 <= skillCheck && mcPermissions.getInstance().dodge(defender)) {
|
||||
if (random.nextInt(4000) <= skillCheck && mcPermissions.getInstance().dodge(defender)) {
|
||||
defender.sendMessage(mcLocale.getString("Acrobatics.Dodge"));
|
||||
|
||||
if (System.currentTimeMillis() >= (5000 + PPd.getRespawnATS()) && defender.getHealth() >= 1) {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Entity;
|
||||
@@ -17,6 +19,8 @@ import com.gmail.nossr50.party.Party;
|
||||
|
||||
public class Archery {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Track arrows fired for later retrieval.
|
||||
*
|
||||
@@ -32,7 +36,7 @@ public class Archery {
|
||||
plugin.arrowTracker.put(entity, 0);
|
||||
}
|
||||
|
||||
if (skillLevel > MAX_BONUS_LEVEL || (Math.random() * 1000 <= skillLevel)) {
|
||||
if (skillLevel > MAX_BONUS_LEVEL || (random.nextInt(1000) <= skillLevel)) {
|
||||
plugin.arrowTracker.put(entity, 1);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +59,7 @@ public class Archery {
|
||||
|
||||
PlayerProfile PPa = Users.getProfile(attacker);
|
||||
|
||||
if (Math.random() * 100 <= IGNITION_CHANCE) {
|
||||
if (random.nextInt(100) <= IGNITION_CHANCE) {
|
||||
int ignition = 20;
|
||||
|
||||
/* Add 20 ticks for every 200 skill levels */
|
||||
@@ -94,14 +98,14 @@ public class Archery {
|
||||
Location loc = defender.getLocation();
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 10 > 5) {
|
||||
if (random.nextInt(10) > 5) {
|
||||
loc.setPitch(90);
|
||||
}
|
||||
else {
|
||||
loc.setPitch(-90);
|
||||
}
|
||||
|
||||
if (Math.random() * 2000 <= skillCheck && mcPermissions.getInstance().daze(attacker)) {
|
||||
if (random.nextInt(2000) <= skillCheck && mcPermissions.getInstance().daze(attacker)) {
|
||||
defender.teleport(loc);
|
||||
defender.sendMessage(mcLocale.getString("Combat.TouchedFuzzy"));
|
||||
attacker.sendMessage(mcLocale.getString("Combat.TargetDazed"));
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -18,6 +20,8 @@ import com.gmail.nossr50.party.Party;
|
||||
|
||||
public class Axes {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Apply bonus to damage done by axes.
|
||||
*
|
||||
@@ -72,7 +76,7 @@ public class Axes {
|
||||
int skillLevel = PPa.getSkillLevel(SkillType.AXES);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 2000 <= skillCheck && !entity.isDead()){
|
||||
if (random.nextInt(2000) <= skillCheck && !entity.isDead()){
|
||||
int damage = event.getDamage();
|
||||
|
||||
if (entity instanceof Player){
|
||||
@@ -133,7 +137,7 @@ public class Axes {
|
||||
final int GREATER_IMPACT_CHANCE = 25;
|
||||
final double GREATER_IMPACT_MULTIPLIER = 1.5;
|
||||
|
||||
if (Math.random() * 100 <= GREATER_IMPACT_CHANCE) {
|
||||
if (random.nextInt(100) <= GREATER_IMPACT_CHANCE) {
|
||||
event.setDamage(event.getDamage() + 2);
|
||||
target.setVelocity(attacker.getLocation().getDirection().normalize().multiply(GREATER_IMPACT_MULTIPLIER));
|
||||
attacker.sendMessage(mcLocale.getString("Axes.GreaterImpactOnEnemy"));
|
||||
|
||||
@@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
@@ -25,6 +26,8 @@ import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class BlastMining {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Handler for what blocks drop from the explosion.
|
||||
*
|
||||
@@ -43,7 +46,7 @@ public class BlastMining {
|
||||
while (iterator2.hasNext()) {
|
||||
Block temp = iterator2.next();
|
||||
|
||||
if ((float) Math.random() < (yield + oreBonus)) {
|
||||
if (random.nextFloat() < (yield + oreBonus)) {
|
||||
blocksDropped.add(temp);
|
||||
Mining.miningDrops(temp);
|
||||
|
||||
@@ -66,7 +69,7 @@ public class BlastMining {
|
||||
while (iterator3.hasNext()) {
|
||||
Block temp = iterator3.next();
|
||||
|
||||
if ((float) Math.random() < (yield - debrisReduction))
|
||||
if (random.nextFloat() < (yield - debrisReduction))
|
||||
Mining.miningDrops(temp);
|
||||
}
|
||||
}
|
||||
@@ -279,7 +282,7 @@ public class BlastMining {
|
||||
tnt.setFuseTicks(0);
|
||||
|
||||
PP.setSkillDATS(ability, System.currentTimeMillis()); //Save DATS for Blast Mining
|
||||
PP.setBlastMiningInformed(false);
|
||||
PP.setAbilityInformed(ability, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Location;
|
||||
@@ -9,7 +10,6 @@ import org.bukkit.Material;
|
||||
import org.bukkit.block.Block;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
|
||||
import com.gmail.nossr50.spout.SpoutSounds;
|
||||
import com.gmail.nossr50.Users;
|
||||
@@ -20,11 +20,14 @@ import com.gmail.nossr50.config.LoadTreasures;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.datatypes.treasure.ExcavationTreasure;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
|
||||
public class Excavation {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Check to see if a block can be broken by Giga Drill Breaker.
|
||||
*
|
||||
@@ -101,7 +104,7 @@ public class Excavation {
|
||||
|
||||
for (ExcavationTreasure treasure : treasures) {
|
||||
if (skillLevel >= treasure.getDropLevel()) {
|
||||
if (Math.random() * 100 <= treasure.getDropChance()) {
|
||||
if (random.nextInt(100) <= treasure.getDropChance()) {
|
||||
xp += treasure.getXp();
|
||||
is.add(treasure.getDrop());
|
||||
}
|
||||
@@ -131,7 +134,7 @@ public class Excavation {
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), LoadProperties.abilityDurabilityLoss);
|
||||
|
||||
if (!block.hasMetadata("mcmmoPlacedBlock")) {
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
|
||||
Excavation.excavationProcCheck(block, player);
|
||||
|
||||
@@ -3,8 +3,8 @@ package com.gmail.nossr50.skills;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.DyeColor;
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
@@ -30,6 +30,8 @@ import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class Fishing {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Get the player's current fishing loot tier.
|
||||
*
|
||||
@@ -96,9 +98,9 @@ public class Fishing {
|
||||
}
|
||||
|
||||
if (LoadProperties.fishingDrops) {
|
||||
FishingTreasure treasure = rewards.get((int) (Math.random() * rewards.size()));
|
||||
FishingTreasure treasure = rewards.get(random.nextInt(rewards.size()));
|
||||
|
||||
if (Math.random() * 100 <= treasure.getDropChance()) {
|
||||
if (random.nextInt(100) <= treasure.getDropChance()) {
|
||||
Users.getProfile(player).addXP(SkillType.FISHING, treasure.getXp(), player);
|
||||
theCatch.setItemStack(treasure.getDrop());
|
||||
}
|
||||
@@ -107,7 +109,11 @@ public class Fishing {
|
||||
theCatch.setItemStack(new ItemStack(Material.RAW_FISH));
|
||||
}
|
||||
|
||||
theCatch.getItemStack().setDurability((short) (Math.random() * theCatch.getItemStack().getType().getMaxDurability())); //Change durability to random value
|
||||
short maxDurability = theCatch.getItemStack().getType().getMaxDurability();
|
||||
|
||||
if (maxDurability > 0) {
|
||||
theCatch.getItemStack().setDurability((short) (random.nextInt(maxDurability))); //Change durability to random value
|
||||
}
|
||||
|
||||
m.mcDropItem(player.getLocation(), new ItemStack(Material.RAW_FISH)); //Always drop a fish
|
||||
PP.addXP(SkillType.FISHING, LoadProperties.mfishing, player);
|
||||
@@ -133,7 +139,7 @@ public class Fishing {
|
||||
|
||||
player.sendMessage(mcLocale.getString("Fishing.ItemFound"));
|
||||
if (ItemChecks.isArmor(fishingResults) || ItemChecks.isTool(fishingResults)) {
|
||||
if (Math.random() * 100 <= ENCHANTMENT_CHANCE) {
|
||||
if (random.nextInt(100) <= ENCHANTMENT_CHANCE) {
|
||||
for (Enchantment newEnchant : Enchantment.values()) {
|
||||
if (newEnchant.canEnchantItem(fishingResults)) {
|
||||
Map<Enchantment, Integer> resultEnchantments = fishingResults.getEnchantments();
|
||||
@@ -145,9 +151,9 @@ public class Fishing {
|
||||
}
|
||||
|
||||
/* Actual chance to have an enchantment is related to your fishing skill */
|
||||
if (Math.random() * 15 < Fishing.getFishingLootTier(PP)) {
|
||||
if (random.nextInt(15) < Fishing.getFishingLootTier(PP)) {
|
||||
enchanted = true;
|
||||
int randomEnchantLevel = (int) (Math.random() * newEnchant.getMaxLevel()) + 1;
|
||||
int randomEnchantLevel = random.nextInt(newEnchant.getMaxLevel()) + 1;
|
||||
|
||||
if (randomEnchantLevel < newEnchant.getStartLevel()) {
|
||||
randomEnchantLevel = newEnchant.getStartLevel();
|
||||
@@ -172,7 +178,7 @@ public class Fishing {
|
||||
* @param event The event to modify
|
||||
*/
|
||||
public static void shakeMob(PlayerFishEvent event) {
|
||||
final int DROP_NUMBER = (int) (Math.random() * 101);
|
||||
final int DROP_NUMBER = random.nextInt(100);
|
||||
|
||||
LivingEntity le = (LivingEntity) event.getCaught();
|
||||
EntityType type = le.getType();
|
||||
@@ -276,7 +282,7 @@ public class Fishing {
|
||||
wool.setColor(sheep.getColor());
|
||||
|
||||
ItemStack theWool = wool.toItemStack();
|
||||
theWool.setAmount((int)(Math.random() * 6));
|
||||
theWool.setAmount(1 + random.nextInt(6));
|
||||
|
||||
m.mcDropItem(loc, theWool);
|
||||
sheep.setSheared(true);
|
||||
@@ -315,7 +321,7 @@ public class Fishing {
|
||||
break;
|
||||
|
||||
case SQUID:
|
||||
m.mcDropItem(loc, new ItemStack(Material.INK_SACK, 1, (short) 0, DyeColor.BLACK.getData()));
|
||||
m.mcDropItem(loc, new ItemStack(Material.INK_SACK, 1, (short) 0, (byte) 0x0));
|
||||
break;
|
||||
|
||||
case ZOMBIE:
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.CropState;
|
||||
import org.bukkit.Location;
|
||||
@@ -15,6 +17,7 @@ import com.gmail.nossr50.m;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.AbilityType;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
@@ -22,6 +25,8 @@ import com.gmail.nossr50.runnables.GreenThumbTimer;
|
||||
|
||||
public class Herbalism {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Activate the Green Terra ability.
|
||||
*
|
||||
@@ -34,7 +39,7 @@ public class Herbalism {
|
||||
Material type = block.getType();
|
||||
|
||||
if (!hasSeeds) {
|
||||
player.sendMessage("You need more seeds to spread Green Terra");
|
||||
player.sendMessage("You need more seeds to spread Green Terra"); //TODO: Needs more locale.
|
||||
}
|
||||
else if (hasSeeds && !block.getType().equals(Material.WHEAT)) {
|
||||
inventory.removeItem(new ItemStack(Material.SEEDS));
|
||||
@@ -137,7 +142,7 @@ public class Herbalism {
|
||||
if (b.getType().equals(Material.CACTUS)) {
|
||||
mat = Material.CACTUS;
|
||||
if (!b.hasMetadata("mcmmoPlacedBlock")) {
|
||||
if(herbLevel > MAX_BONUS_LEVEL || (Math.random() * 1000 <= herbLevel)) {
|
||||
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
|
||||
catciDrops++;
|
||||
}
|
||||
xp += LoadProperties.mcactus;
|
||||
@@ -193,7 +198,7 @@ public class Herbalism {
|
||||
if (b.getType().equals(Material.SUGAR_CANE_BLOCK)) {
|
||||
mat = Material.SUGAR_CANE;
|
||||
if (!b.hasMetadata("mcmmoPlacedBlock")) {
|
||||
if(herbLevel > MAX_BONUS_LEVEL || (Math.random() * 1000 <= herbLevel)) {
|
||||
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
|
||||
caneDrops++;
|
||||
}
|
||||
xp += LoadProperties.msugar;
|
||||
@@ -226,7 +231,7 @@ public class Herbalism {
|
||||
else {
|
||||
ItemStack is = new ItemStack(mat);
|
||||
|
||||
if (herbLevel > MAX_BONUS_LEVEL || (Math.random() * 1000 <= herbLevel)) {
|
||||
if (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= herbLevel) {
|
||||
if (type.equals(Material.CACTUS)) {
|
||||
m.mcDropItems(loc, is, catciDrops);
|
||||
}
|
||||
@@ -268,7 +273,7 @@ public class Herbalism {
|
||||
boolean hasSeeds = inventory.contains(Material.SEEDS);
|
||||
Location loc = block.getLocation();
|
||||
|
||||
if (hasSeeds && PP.getGreenTerraMode() || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || (Math.random() * 1500 <= herbLevel))) {
|
||||
if (hasSeeds && PP.getAbilityMode(AbilityType.GREEN_TERRA) || hasSeeds && (herbLevel > MAX_BONUS_LEVEL || random.nextInt(1500) <= herbLevel)) {
|
||||
event.setCancelled(true);
|
||||
|
||||
m.mcDropItem(loc, new ItemStack(Material.WHEAT));
|
||||
@@ -297,7 +302,7 @@ public class Herbalism {
|
||||
|
||||
player.setItemInHand(new ItemStack(Material.SEEDS, seeds - 1));
|
||||
|
||||
if (skillLevel > MAX_BONUS_LEVEL || Math.random() * 1500 <= skillLevel) {
|
||||
if (skillLevel > MAX_BONUS_LEVEL || random.nextInt(1500) <= skillLevel) {
|
||||
greenTerra(player, block);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.CoalType;
|
||||
import org.bukkit.Location;
|
||||
@@ -9,7 +11,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.getspout.spoutapi.sound.SoundEffect;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
|
||||
import com.gmail.nossr50.Users;
|
||||
import com.gmail.nossr50.m;
|
||||
@@ -18,10 +19,11 @@ import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.spout.SpoutSounds;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
|
||||
public class Mining {
|
||||
|
||||
public class Mining
|
||||
{
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Drop items from Mining & Blast Mining skills.
|
||||
@@ -165,7 +167,7 @@ public class Mining
|
||||
|
||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.MINING);
|
||||
|
||||
if ((MAX_BONUS_LEVEL > 1000 || (Math.random() * 1000 <= skillLevel)) && mcPermissions.getInstance().miningDoubleDrops(player)) {
|
||||
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().miningDoubleDrops(player)) {
|
||||
if (player.getItemInHand().containsEnchantment(Enchantment.SILK_TOUCH)) {
|
||||
m.mcDropItem(block.getLocation(), new ItemStack(block.getType()));
|
||||
}
|
||||
@@ -215,7 +217,7 @@ public class Mining
|
||||
Material type = block.getType();
|
||||
int tier = m.getTier(player.getItemInHand());
|
||||
int durabilityLoss = LoadProperties.abilityDurabilityLoss;
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
|
||||
switch (type) {
|
||||
case OBSIDIAN:
|
||||
@@ -255,7 +257,6 @@ public class Mining
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
Skills.abilityDurabilityLoss(player.getItemInHand(), durabilityLoss);
|
||||
|
||||
miningBlockCheck(player, block);
|
||||
miningBlockCheck(player, block);
|
||||
|
||||
if (LoadProperties.spoutEnabled) {
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.enchantments.Enchantment;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.PlayerInventory;
|
||||
import org.getspout.spoutapi.SpoutManager;
|
||||
import org.getspout.spoutapi.player.SpoutPlayer;
|
||||
|
||||
import com.gmail.nossr50.ItemChecks;
|
||||
import com.gmail.nossr50.Users;
|
||||
@@ -18,10 +22,14 @@ import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.spout.SpoutSounds;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerRepairCheckEvent;
|
||||
import com.gmail.nossr50.events.skills.McMMOPlayerRepairEvent;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class Repair {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Handle all the item repair checks.
|
||||
*
|
||||
@@ -41,23 +49,19 @@ public class Repair {
|
||||
*/
|
||||
if (ItemChecks.isArmor(is) && LoadProperties.repairArmor && mcPermissions.getInstance().armorRepair(player)) {
|
||||
if (ItemChecks.isDiamondArmor(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairdiamondlevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rDiamond));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
|
||||
xpHandler(player, PP, is, durabilityBefore, 6, true);
|
||||
}
|
||||
else if (ItemChecks.isIronArmor(is) && inventory.contains(LoadProperties.rIron) && skillLevel >= LoadProperties.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rIron));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rIron));
|
||||
xpHandler(player, PP, is, durabilityBefore, 2, true);
|
||||
}
|
||||
else if (ItemChecks.isGoldArmor(is) && inventory.contains(LoadProperties.rGold) && skillLevel >= LoadProperties.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rGold));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
||||
xpHandler(player, PP, is, durabilityBefore, 4, true);
|
||||
}
|
||||
else if (ItemChecks.isLeatherArmor(is) && inventory.contains(LoadProperties.rLeather)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rLeather));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rLeather));
|
||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||
}
|
||||
else {
|
||||
@@ -70,33 +74,27 @@ public class Repair {
|
||||
*/
|
||||
else if (ItemChecks.isTool(is) && LoadProperties.repairTools && mcPermissions.getInstance().toolRepair(player)) {
|
||||
if (ItemChecks.isStoneTool(is) && inventory.contains(LoadProperties.rStone) && skillLevel >= LoadProperties.repairStoneLevel && mcPermissions.getInstance().stoneRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rStone));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rStone));
|
||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||
}
|
||||
else if (ItemChecks.isWoodTool(is) && inventory.contains(LoadProperties.rWood)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rWood));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rWood));
|
||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||
}
|
||||
else if (ItemChecks.isIronTool(is) && inventory.contains(LoadProperties.rIron) && skillLevel >= LoadProperties.repairIronLevel && mcPermissions.getInstance().ironRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rIron));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rIron));
|
||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||
}
|
||||
else if (ItemChecks.isDiamondTool(is) && inventory.contains(LoadProperties.rDiamond) && skillLevel >= LoadProperties.repairdiamondlevel && mcPermissions.getInstance().diamondRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rDiamond));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rDiamond));
|
||||
xpHandler(player, PP, is, durabilityBefore, 1, true);
|
||||
}
|
||||
else if (ItemChecks.isGoldTool(is) && inventory.contains(LoadProperties.rGold) && skillLevel >= LoadProperties.repairGoldLevel && mcPermissions.getInstance().goldRepair(player)) {
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rGold));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rGold));
|
||||
xpHandler(player, PP, is, durabilityBefore, 8, true);
|
||||
}
|
||||
else if (is.getType().equals(Material.BOW) && inventory.contains(LoadProperties.rString)){
|
||||
inventory.removeItem(new ItemStack(LoadProperties.rString));
|
||||
repairItem(player, is);
|
||||
repairItem(player, is, new ItemStack(LoadProperties.rString));
|
||||
xpHandler(player, PP, is, durabilityBefore, 2, false);
|
||||
}
|
||||
else {
|
||||
@@ -140,7 +138,7 @@ public class Repair {
|
||||
dif = (short) (dif / 2);
|
||||
}
|
||||
|
||||
PP.addXP(SkillType.REPAIR, dif*10, player);
|
||||
PP.addXP(SkillType.REPAIR, dif * 10, player);
|
||||
Skills.XpCheckSkill(SkillType.REPAIR, player);
|
||||
|
||||
//CLANG CLANG
|
||||
@@ -201,11 +199,11 @@ public class Repair {
|
||||
for (Entry<Enchantment, Integer> enchant : enchants.entrySet()) {
|
||||
Enchantment enchantment = enchant.getKey();
|
||||
|
||||
if (Math.random() * 100 <= getEnchantChance(rank)) {
|
||||
if (random.nextInt(100) <= getEnchantChance(rank)) {
|
||||
int enchantLevel = enchant.getValue();
|
||||
|
||||
if (LoadProperties.mayDowngradeEnchants && enchantLevel > 1) {
|
||||
if (Math.random() * 100 <= getDowngradeChance(rank)) {
|
||||
if (random.nextInt(100) <= getDowngradeChance(rank)) {
|
||||
is.addEnchantment(enchantment, enchantLevel--);
|
||||
downgraded = true;
|
||||
}
|
||||
@@ -410,7 +408,7 @@ public class Repair {
|
||||
|
||||
int skillLevel = Users.getProfile(player).getSkillLevel(SkillType.REPAIR);
|
||||
|
||||
if ((skillLevel > MAX_BONUS_LEVEL || (Math.random() * 1000 <= skillLevel)) && mcPermissions.getInstance().repairBonus(player)) {
|
||||
if ((skillLevel > MAX_BONUS_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().repairBonus(player)) {
|
||||
player.sendMessage(mcLocale.getString("Skills.FeltEasy"));
|
||||
return true;
|
||||
}
|
||||
@@ -422,16 +420,56 @@ public class Repair {
|
||||
* Repairs an item.
|
||||
*
|
||||
* @param player The player repairing an item
|
||||
* @param enchants The enchantments on the item
|
||||
* @param enchantsLevel The level of the enchantments on the item
|
||||
* @param item The item being repaired
|
||||
* @param repairMaterial The repair reagent
|
||||
*/
|
||||
public static void repairItem(Player player, ItemStack is) {
|
||||
public static void repairItem(Player player, ItemStack item, ItemStack repairMaterial) {
|
||||
short initialDurability = item.getDurability();
|
||||
short newDurability = getRepairAmount(item, player);
|
||||
|
||||
McMMOPlayerRepairCheckEvent preEvent = new McMMOPlayerRepairCheckEvent(player, (short) (initialDurability - newDurability), repairMaterial, item);
|
||||
Bukkit.getPluginManager().callEvent(preEvent);
|
||||
|
||||
if (preEvent.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
player.getInventory().removeItem(repairMaterial);
|
||||
|
||||
/* Handle the enchants */
|
||||
if (LoadProperties.mayLoseEnchants && !mcPermissions.getInstance().arcaneBypass(player)) {
|
||||
addEnchants(player, is);
|
||||
addEnchants(player, item);
|
||||
}
|
||||
|
||||
is.setDurability(getRepairAmount(is, player));
|
||||
item.setDurability(newDurability);
|
||||
|
||||
/* Post-repair Event */
|
||||
McMMOPlayerRepairEvent postEvent = new McMMOPlayerRepairEvent(player, item, (short) (initialDurability - newDurability));
|
||||
Bukkit.getPluginManager().callEvent(postEvent);
|
||||
}
|
||||
|
||||
/**
|
||||
* Handles notifications for placing an anvil.
|
||||
*
|
||||
* @param player The player placing the anvil
|
||||
* @param anvilID The item ID of the anvil block
|
||||
*/
|
||||
public static void placedAnvilCheck(Player player, int anvilID) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
|
||||
if (!PP.getPlacedAnvil()) {
|
||||
if (LoadProperties.spoutEnabled) {
|
||||
SpoutPlayer sPlayer = SpoutManager.getPlayer(player);
|
||||
|
||||
if (sPlayer.isSpoutCraftEnabled()) {
|
||||
sPlayer.sendNotification("[mcMMO] Anvil Placed", "Right click to repair!", Material.getMaterial(anvilID)); //TODO: Use Locale
|
||||
}
|
||||
}
|
||||
else {
|
||||
player.sendMessage(mcLocale.getString("mcBlockListener.PlacedAnvil"));
|
||||
}
|
||||
|
||||
PP.togglePlacedAnvil();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.PlayerStat;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.datatypes.ToolType;
|
||||
import com.gmail.nossr50.events.McMMOPlayerLevelUpEvent;
|
||||
import com.gmail.nossr50.events.experience.McMMOPlayerLevelUpEvent;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class Skills {
|
||||
@@ -66,8 +66,8 @@ public class Skills {
|
||||
* @param ability The ability to watch cooldowns for
|
||||
*/
|
||||
public static void watchCooldown(Player player, PlayerProfile PP, long curTime, AbilityType ability) {
|
||||
if (!ability.getInformed(PP) && curTime - (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) >= (ability.getCooldown() * TIME_CONVERSION_FACTOR)) {
|
||||
ability.setInformed(PP, true);
|
||||
if (!PP.getAbilityInformed(ability) && curTime - (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) >= (ability.getCooldown() * TIME_CONVERSION_FACTOR)) {
|
||||
PP.setAbilityInformed(ability, true);
|
||||
player.sendMessage(ability.getAbilityRefresh());
|
||||
}
|
||||
}
|
||||
@@ -89,25 +89,31 @@ public class Skills {
|
||||
ItemStack inHand = player.getItemInHand();
|
||||
|
||||
/* Check if any abilities are active */
|
||||
if (!PP.getAbilityUse() || PP.getSuperBreakerMode() || PP.getSerratedStrikesMode() || PP.getTreeFellerMode() || PP.getGreenTerraMode() || PP.getBerserkMode() || PP.getGigaDrillBreakerMode()) {
|
||||
if (!PP.getAbilityUse()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (AbilityType x : AbilityType.values()) {
|
||||
if (PP.getAbilityMode(x)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* Woodcutting & Axes need to be treated differently.
|
||||
* Basically the tool always needs to ready and we check to see if the cooldown is over when the user takes action
|
||||
*/
|
||||
if (skill == SkillType.WOODCUTTING || skill == SkillType.AXES) {
|
||||
if (tool.inHand(inHand) && !tool.getToolMode(PP)) {
|
||||
if (tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
||||
if (LoadProperties.enableAbilityMessages) {
|
||||
player.sendMessage(tool.getRaiseTool());
|
||||
}
|
||||
|
||||
tool.setToolATS(PP, System.currentTimeMillis());
|
||||
tool.setToolMode(PP, true);
|
||||
PP.setToolPreparationATS(tool, System.currentTimeMillis());
|
||||
PP.setToolPreparationMode(tool, true);
|
||||
}
|
||||
}
|
||||
else if (ability.getPermissions(player) && tool.inHand(inHand) && !tool.getToolMode(PP)) {
|
||||
if (!ability.getMode(PP) && !cooldownOver(PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR, ability.getCooldown())) {
|
||||
else if (ability.getPermissions(player) && tool.inHand(inHand) && !PP.getToolPreparationMode(tool)) {
|
||||
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)");
|
||||
return;
|
||||
}
|
||||
@@ -116,8 +122,8 @@ public class Skills {
|
||||
player.sendMessage(tool.getRaiseTool());
|
||||
}
|
||||
|
||||
tool.setToolATS(PP, System.currentTimeMillis());
|
||||
tool.setToolMode(PP, true);
|
||||
PP.setToolPreparationATS(tool, System.currentTimeMillis());
|
||||
PP.setToolPreparationMode(tool, true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,15 +141,15 @@ public class Skills {
|
||||
ToolType tool = skill.getTool();
|
||||
AbilityType ability = skill.getAbility();
|
||||
|
||||
if (tool.getToolMode(PP) && curTime - (tool.getToolATS(PP) * TIME_CONVERSION_FACTOR) >= FOUR_SECONDS) {
|
||||
tool.setToolMode(PP, false);
|
||||
if (PP.getToolPreparationMode(tool) && curTime - (PP.getToolPreparationATS(tool) * TIME_CONVERSION_FACTOR) >= FOUR_SECONDS) {
|
||||
PP.setToolPreparationMode(tool, false);
|
||||
player.sendMessage(tool.getLowerTool());
|
||||
}
|
||||
|
||||
if (ability.getPermissions(player)) {
|
||||
if (ability.getMode(PP) && (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) <= curTime) {
|
||||
ability.setMode(PP, false);
|
||||
ability.setInformed(PP, false);
|
||||
if (PP.getAbilityMode(ability) && (PP.getSkillDATS(ability) * TIME_CONVERSION_FACTOR) <= curTime) {
|
||||
PP.setAbilityMode(ability, false);
|
||||
PP.setAbilityInformed(ability, false);
|
||||
player.sendMessage(ability.getAbilityOff());
|
||||
|
||||
for (Player y : player.getWorld().getPlayers()) {
|
||||
@@ -191,14 +197,13 @@ public class Skills {
|
||||
while (PP.getSkillXpLevel(skillType) >= PP.getXpToLevel(skillType)) {
|
||||
if (skillType.getMaxLevel() >= PP.getSkillLevel(skillType) + 1) {
|
||||
skillups++;
|
||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||
PP.skillUp(skillType, 1);
|
||||
PP.addLevels(skillType, 1);
|
||||
|
||||
McMMOPlayerLevelUpEvent eventToFire = new McMMOPlayerLevelUpEvent(player, skillType);
|
||||
Bukkit.getPluginManager().callEvent(eventToFire);
|
||||
}
|
||||
else {
|
||||
PP.removeXP(skillType, PP.getXpToLevel(skillType));
|
||||
PP.addLevels(skillType, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -370,17 +375,18 @@ public class Skills {
|
||||
public static void abilityCheck(Player player, SkillType type) {
|
||||
PlayerProfile PP = Users.getProfile(player);
|
||||
AbilityType ability = type.getAbility();
|
||||
ToolType tool = type.getTool();
|
||||
|
||||
if (type.getTool().inHand(player.getItemInHand())) {
|
||||
if (type.getTool().getToolMode(PP)) {
|
||||
type.getTool().setToolMode(PP, false);
|
||||
if (PP.getToolPreparationMode(tool)) {
|
||||
PP.setToolPreparationMode(tool, false);
|
||||
}
|
||||
|
||||
/* Axes and Woodcutting are odd because they share the same tool.
|
||||
* We show them the too tired message when they take action.
|
||||
*/
|
||||
if (type == SkillType.WOODCUTTING || type == SkillType.AXES) {
|
||||
if (!ability.getMode(PP) && !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)");
|
||||
return;
|
||||
}
|
||||
@@ -388,7 +394,7 @@ public class Skills {
|
||||
|
||||
int ticks = 2 + (PP.getSkillLevel(type) / 50);
|
||||
|
||||
if (!ability.getMode(PP) && cooldownOver(PP.getSkillDATS(ability), ability.getCooldown())) {
|
||||
if (!PP.getAbilityMode(ability) && cooldownOver(PP.getSkillDATS(ability), ability.getCooldown())) {
|
||||
player.sendMessage(ability.getAbilityOn());
|
||||
|
||||
for (Player y : player.getWorld().getPlayers()) {
|
||||
@@ -398,7 +404,7 @@ public class Skills {
|
||||
}
|
||||
|
||||
PP.setSkillDATS(ability, System.currentTimeMillis()+(ticks * TIME_CONVERSION_FACTOR));
|
||||
ability.setMode(PP, true);
|
||||
PP.setAbilityMode(ability, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
@@ -21,6 +23,8 @@ import com.gmail.nossr50.runnables.mcBleedTimer;
|
||||
|
||||
public class Swords {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Check for Bleed effect.
|
||||
*
|
||||
@@ -52,7 +56,7 @@ public class Swords {
|
||||
int skillLevel = PPa.getSkillLevel(SkillType.SWORDS);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 1000 <= skillCheck && !entity.isDead()) {
|
||||
if (random.nextInt(1000) <= skillCheck && !entity.isDead()) {
|
||||
if (entity instanceof Player) {
|
||||
Player target = (Player) entity;
|
||||
int bleedTicks;
|
||||
@@ -98,7 +102,7 @@ public class Swords {
|
||||
int skillLevel = PPd.getSkillLevel(SkillType.SWORDS);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 2000 <= skillCheck) {
|
||||
if (random.nextInt(2000) <= skillCheck) {
|
||||
Combat.dealDamage((LivingEntity) attacker, event.getDamage() / COUNTER_ATTACK_MODIFIER);
|
||||
defender.sendMessage(mcLocale.getString("Swords.CounterAttacked"));
|
||||
|
||||
|
||||
@@ -1,11 +1,14 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.ChatColor;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.AnimalTamer;
|
||||
import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.EntityType;
|
||||
import org.bukkit.entity.LivingEntity;
|
||||
import org.bukkit.entity.Ocelot;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.entity.Tameable;
|
||||
import org.bukkit.entity.Wolf;
|
||||
@@ -27,6 +30,8 @@ import com.gmail.nossr50.runnables.mcBleedTimer;
|
||||
|
||||
public class Taming {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Apply the Fast Food Service ability.
|
||||
*
|
||||
@@ -44,7 +49,7 @@ public class Taming {
|
||||
|
||||
if (PPo.getSkillLevel(SkillType.TAMING) >= SKILL_ACTIVATION_LEVEL) {
|
||||
if (health < maxHealth) {
|
||||
if (Math.random() * 100 < ACTIVATION_CHANCE) {
|
||||
if (random.nextInt(100) < ACTIVATION_CHANCE) {
|
||||
if (health + damage <= maxHealth) {
|
||||
theWolf.setHealth(health + damage);
|
||||
}
|
||||
@@ -82,7 +87,7 @@ public class Taming {
|
||||
public static void gore(PlayerProfile PPo, EntityDamageEvent event, Player master, mcMMO plugin) {
|
||||
final int GORE_MULTIPLIER = 2;
|
||||
|
||||
if (Math.random() * 1000 <= PPo.getSkillLevel(SkillType.TAMING)) {
|
||||
if (random.nextInt(1000) <= PPo.getSkillLevel(SkillType.TAMING)) {
|
||||
Entity entity = event.getEntity();
|
||||
event.setDamage(event.getDamage() * GORE_MULTIPLIER);
|
||||
|
||||
@@ -90,7 +95,7 @@ public class Taming {
|
||||
Player target = (Player) entity;
|
||||
|
||||
target.sendMessage(mcLocale.getString("Combat.StruckByGore"));
|
||||
Users.getProfile(target).setBleedTicks(2);
|
||||
Users.getProfile(target).addBleedTicks(2);
|
||||
}
|
||||
else {
|
||||
mcBleedTimer.add((LivingEntity) entity);
|
||||
@@ -243,6 +248,10 @@ public class Taming {
|
||||
entity.setMetadata("mcmmoSummoned", new FixedMetadataValue(plugin, true));
|
||||
((Tameable) entity).setOwner(player);
|
||||
|
||||
if (entity.getType().equals(EntityType.OCELOT)) {
|
||||
((Ocelot) entity).setCatType(Ocelot.Type.getType(1 + random.nextInt(3)));
|
||||
}
|
||||
|
||||
player.setItemInHand(new ItemStack(summonItem, item.getAmount() - summonAmount));
|
||||
player.sendMessage(mcLocale.getString("m.TamingSummon"));
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.entity.EntityDamageByEntityEvent;
|
||||
@@ -14,6 +16,8 @@ import com.gmail.nossr50.locale.mcLocale;
|
||||
|
||||
public class Unarmed {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Apply bonus to Unarmed damage.
|
||||
*
|
||||
@@ -45,13 +49,13 @@ public class Unarmed {
|
||||
int skillLevel = PPa.getSkillLevel(SkillType.UNARMED);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (defender.getItemInHand().getType().equals(Material.AIR)) {
|
||||
if (Math.random() * 3000 <= skillCheck) {
|
||||
ItemStack item = defender.getItemInHand();
|
||||
ItemStack inHand = defender.getItemInHand();
|
||||
|
||||
if (!inHand.getType().equals(Material.AIR)) {
|
||||
if (random.nextInt(3000) <= skillCheck) {
|
||||
defender.sendMessage(mcLocale.getString("Skills.Disarmed"));
|
||||
|
||||
m.mcDropItem(defender.getLocation(), item);
|
||||
m.mcDropItem(defender.getLocation(), inHand);
|
||||
defender.setItemInHand(new ItemStack(Material.AIR));
|
||||
}
|
||||
}
|
||||
@@ -69,7 +73,7 @@ public class Unarmed {
|
||||
int skillLevel = Users.getProfile(defender).getSkillLevel(SkillType.UNARMED);
|
||||
int skillCheck = m.skillCheck(skillLevel, MAX_BONUS_LEVEL);
|
||||
|
||||
if (Math.random() * 2000 <= skillCheck && mcPermissions.getInstance().deflect(defender)) {
|
||||
if (random.nextInt(2000) <= skillCheck && mcPermissions.getInstance().deflect(defender)) {
|
||||
event.setCancelled(true);
|
||||
defender.sendMessage(mcLocale.getString("Combat.ArrowDeflect"));
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.gmail.nossr50.skills;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.TreeSpecies;
|
||||
@@ -9,7 +10,6 @@ import org.bukkit.entity.Player;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.material.Tree;
|
||||
import org.bukkit.event.block.BlockBreakEvent;
|
||||
import org.bukkit.event.player.PlayerAnimationEvent;
|
||||
import org.bukkit.Bukkit;
|
||||
|
||||
import com.gmail.nossr50.Combat;
|
||||
@@ -19,6 +19,7 @@ import com.gmail.nossr50.mcPermissions;
|
||||
import com.gmail.nossr50.config.LoadProperties;
|
||||
import com.gmail.nossr50.datatypes.PlayerProfile;
|
||||
import com.gmail.nossr50.datatypes.SkillType;
|
||||
import com.gmail.nossr50.events.fake.FakePlayerAnimationEvent;
|
||||
import com.gmail.nossr50.locale.mcLocale;
|
||||
import com.gmail.nossr50.spout.SpoutSounds;
|
||||
|
||||
@@ -26,6 +27,8 @@ import org.getspout.spoutapi.sound.SoundEffect;
|
||||
|
||||
public class WoodCutting {
|
||||
|
||||
private static Random random = new Random();
|
||||
|
||||
/**
|
||||
* Handle the Tree Feller ability.
|
||||
*
|
||||
@@ -69,7 +72,7 @@ public class WoodCutting {
|
||||
int health = player.getHealth();
|
||||
|
||||
if (health >= 2) {
|
||||
Combat.dealDamage(player, (int)(Math.random() * (health - 1)));
|
||||
Combat.dealDamage(player, random.nextInt(health - 1));
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -249,7 +252,7 @@ public class WoodCutting {
|
||||
byte type = block.getData();
|
||||
Material mat = Material.getMaterial(block.getTypeId());
|
||||
|
||||
if ((skillLevel > MAX_SKILL_LEVEL || Math.random() * 1000 <= skillLevel) && mcPermissions.getInstance().woodcuttingDoubleDrops(player)) {
|
||||
if ((skillLevel > MAX_SKILL_LEVEL || random.nextInt(1000) <= skillLevel) && mcPermissions.getInstance().woodcuttingDoubleDrops(player)) {
|
||||
ItemStack item = new ItemStack(mat, 1, (short) 0, type);
|
||||
m.mcDropItem(block.getLocation(), item);
|
||||
}
|
||||
@@ -303,7 +306,7 @@ public class WoodCutting {
|
||||
* @param block Block being broken
|
||||
*/
|
||||
public static void leafBlower(Player player, Block block) {
|
||||
PlayerAnimationEvent armswing = new PlayerAnimationEvent(player);
|
||||
FakePlayerAnimationEvent armswing = new FakePlayerAnimationEvent(player);
|
||||
Bukkit.getPluginManager().callEvent(armswing);
|
||||
|
||||
if (LoadProperties.woodcuttingrequiresaxe) {
|
||||
|
||||
@@ -581,6 +581,6 @@ public class SpoutStuff {
|
||||
* @param player The player whose bar to update
|
||||
*/
|
||||
public static void updateXpBar(Player player) {
|
||||
playerHUDs.get(player).updateXpBarDisplay(Users.getProfile(player).getHUDType(), player);
|
||||
playerHUDs.get(player).updateXpBarDisplay(Users.getProfile(player).getHUDType(), player); //Is there a reason we can't just do HUDmmo.updateXpBarDisplay?
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class Page {
|
||||
public static void grabGuidePageForSkill(SkillType skilltype, Player player, String[] args)
|
||||
{
|
||||
String capitalized = m.getCapitalized(skilltype.toString());
|
||||
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]");
|
||||
player.sendMessage(ChatColor.DARK_AQUA+"Guide for "+capitalized+" available type /"+skilltype.toString().toLowerCase()+" ? [Page#]"); //TODO: Needs more locale.
|
||||
if (args.length >= 1)
|
||||
{
|
||||
if(args[0].equals("?"))
|
||||
@@ -85,16 +85,16 @@ public class Page {
|
||||
}
|
||||
else if(args.length > 1 && m.getInt(args[1]) > Page.getTotalPageNumber(address))
|
||||
{
|
||||
player.sendMessage("That page doesn't exist, there are only "+Page.getTotalPageNumber(address)+" total pages");
|
||||
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]))
|
||||
{
|
||||
player.sendMessage("Not a valid page number!");
|
||||
player.sendMessage("Not a valid page number!"); //TODO: Needs more locale.
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
player.sendMessage(ChatColor.RED + "Usage is /"+skilltype.toString().toLowerCase()+" ? [page]");
|
||||
player.sendMessage(ChatColor.RED + "Usage is /"+skilltype.toString().toLowerCase()+" ? [page]"); //TODO: Needs more locale.
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -406,7 +406,7 @@ Acrobatics.GracefulRoll=[[GREEN]]**GRACEFUL ROLL**
|
||||
Acrobatics.Dodge=[[GREEN]]**DODGE**
|
||||
Acrobatics.Roll=**ROLL**
|
||||
Axes.HitCritically=[[DARK_RED]]You were CRITICALLY hit!
|
||||
Axes.CriticalHit=[[RED]]CRITIAL HIT!
|
||||
Axes.CriticalHit=[[RED]]CRITICAL HIT!
|
||||
Axes.HitByCleave=[[DARK_RED]]Struck by CLEAVE!
|
||||
Swords.EnemyBleeding=[[GREEN]]**ENEMY BLEEDING**
|
||||
Swords.HitBySerratedStrikes=[[DARK_RED]]Struck by SERRATED STRIKES!
|
||||
|
||||
@@ -26,7 +26,7 @@ m.mccMcGod=- Vita infinita(God Mode)
|
||||
m.mccSkillInfo=[skillname] [[RED]]- Visualizza delle informazioni su una skill
|
||||
m.mccModDescription=[[RED]]- Leggi la breve descrizione Mod
|
||||
m.SkillHeader=[[RED]]-----[][[GREEN]]{0}[[RED]][]-----
|
||||
m.XPGain=[[DARK_GRAY]]XP ACQUISITA: [[WHITE]]{0}
|
||||
m.XPGain=[[DARK_GRAY]]COME GUADAGNARE XP: [[WHITE]]{0}
|
||||
m.EffectsTemplate=[[DARK_AQUA]]{0}: [[GREEN]]{1}
|
||||
m.AbilityLockTemplate=[[GRAY]]{0}
|
||||
m.AbilityBonusTemplate=[[RED]]{0}: [[YELLOW]]{1}
|
||||
@@ -248,7 +248,7 @@ Skills.YourSerratedStrikes=[[GREEN]]La tua abilita [[YELLOW]]Colpo serrato [[GRE
|
||||
Skills.YourBerserk=[[GREEN]]La tua abilita [[YELLOW]]Berserk [[GREEN]]e stata rigenerata!
|
||||
Skills.YourSkullSplitter=[[GREEN]]La tua abilita [[YELLOW]]Teschio Splitter [[GREEN]]e stata rigenerata!
|
||||
Skills.YourGigaDrillBreaker=[[GREEN]]La tua abilita [[YELLOW]]Super Trapano Breaker [[GREEN]]e stata rigenerata!
|
||||
Skills.TooTired=[[RED]]Sei troppo stanco per poter riutilizzare questa abilita.
|
||||
Skills.TooTired=[[RED]]Sei troppo stanco per poter riutilizzare questa abilita attendi.
|
||||
Skills.ReadyHoe=[[GREEN]]**LA TUA ZAPPA e PRONTA**
|
||||
Skills.LowerHoe=[[GRAY]]**POTERE DELLA ZAPPA ABBASSATO**
|
||||
Skills.ReadyAxe=[[GREEN]]**HAI L'ASCIA PRONTA**
|
||||
@@ -282,17 +282,17 @@ Skills.SerratedStrikesOff=[[RED]]**Colpo serrato si e esaurito**
|
||||
Skills.BerserkOff=[[RED]]**Berserk si e esaurito**
|
||||
Skills.SkullSplitterOff=[[RED]]**Teschio Splitter si e esaurito**
|
||||
Skills.GigaDrillBreakerOff=[[RED]]**Super Trapano Breaker si e esaurito**
|
||||
Skills.TamingUp=[[YELLOW]]La skill DOMARE e aumentato del {0}. Totale ({1})
|
||||
Skills.AcrobaticsUp=[[YELLOW]]La skill ACROBAZIE e aumentata del {0}. Totale ({1})
|
||||
Skills.ArcheryUp=[[YELLOW]]La skill ARCIERE e aumentata del {0}. Totale ({1})
|
||||
Skills.SwordsUp=[[YELLOW]]La skill SPADE e stata aumentata del {0}. Totale ({1})
|
||||
Skills.AxesUp=[[YELLOW]]La skill ASCIA e stata aumentata del {0}. Totale ({1})
|
||||
Skills.UnarmedUp=[[YELLOW]]La skill DISARMATO e stata aumentata del {0}. Totale ({1})
|
||||
Skills.HerbalismUp=[[YELLOW]]La skill ERBORISTERIA e stata aumentata del {0}. Totale ({1})
|
||||
Skills.MiningUp=[[YELLOW]]La skill MINATORE e stata aumentata del {0}. Totale ({1})
|
||||
Skills.WoodcuttingUp=[[YELLOW]]La skill BOSCAIOLO e stata aumentata del {0}. Totale ({1})
|
||||
Skills.RepairUp=[[YELLOW]]La skill RIPARAZIONE e stata aumentata del {0}. Totale ({1})
|
||||
Skills.ExcavationUp=[[YELLOW]]La skill SCAVI e stata aumentata DEL {0}. Totale ({1})
|
||||
Skills.TamingUp=[[YELLOW]]La skill DOMARE e aumentata di {0}. Totale ({1})
|
||||
Skills.AcrobaticsUp=[[YELLOW]]La skill ACROBAZIE e aumentata di {0}. Totale ({1})
|
||||
Skills.ArcheryUp=[[YELLOW]]La skill ARCIERE e aumentata di {0}. Totale ({1})
|
||||
Skills.SwordsUp=[[YELLOW]]La skill SPADE e aumentata di {0}. Totale ({1})
|
||||
Skills.AxesUp=[[YELLOW]]La skill ASCIA e aumentata di {0}. Totale ({1})
|
||||
Skills.UnarmedUp=[[YELLOW]]La skill DISARMATO e aumentata di {0}. Totale ({1})
|
||||
Skills.HerbalismUp=[[YELLOW]]La skill ERBORISTERIA e aumentata di {0}. Totale ({1})
|
||||
Skills.MiningUp=[[YELLOW]]La skill MINATORE e stata aumentata di {0}. Totale ({1})
|
||||
Skills.WoodcuttingUp=[[YELLOW]]La skill BOSCAIOLO e aumentata di {0}. Totale ({1})
|
||||
Skills.RepairUp=[[YELLOW]]La skill RIPARAZIONE e aumentata di {0}. Totale ({1})
|
||||
Skills.ExcavationUp=[[YELLOW]]La skill SCAVI e aumentata di {0}. Totale ({1})
|
||||
Skills.FeltEasy=[[GRAY]]Sembrava facile.
|
||||
Skills.StackedItems=[[DARK_RED]]Non puoi riparare uno stack di itemd , separali
|
||||
Skills.NeedMore=[[DARK_RED]]Hai bisogno di piu
|
||||
@@ -417,10 +417,10 @@ Swords.HitByCounterAttack=[[DARK_RED]]Sei stato colpito da un contatore di colpi
|
||||
Guides.Acrobatics=[[DARK_AQUA]]Informazioni sull'acrobazia: \ n [[YELLOW]] acrobazia e l'arte di muoversi con grazia in mcMMO \ n [[YELLOW]] Esso fornisce bonus di combattimento e dei primi danni all'ambiente \ n \ n [.. [DARK_AQUA]] XP GAIN:\ n [[YELLOW]] per guadagnare XP in questa abilita e necessario eseguire una schivata \ n [[YELLOW]] in combattimento o sopravvivere a cadute da altezze che il danno sia non mortale \ n \ n [[. DARK_AQUA]] Come funziona la skill di rotolamento? \ n[[YELLOW]] hai la possibilita passiva quando si prende danno da caduta di rotolare \ n[[YELLOW]] per eliminando cosi il danno fatto. e possibile tenere premuto il pulsante per accovacciarsi per \ n [[YELLOW]] raddoppiare le probabilita di salvezza durante la caduta. \ N [[YELLOW]]Questo Albo Graceful al posto di una caduta standard. \ N [[YELLOW]] RollsGraceful sono come rotoli regolari, ma hanno il doppio delle probabilita che \ n[[YELLOW]] si verifichino i danni e fornisce la sicurezza di piu di rotoli regolari. \ n[[YELLOW]] la possibilita di rotolare e legato al vostro livello di abilita \ n[[DARK_AQUA]] Come funziona la skill schivare ? \ n [[YELLOW]] schivare e una possibilita passiva quando si e \ n [YELLOW]] feriti in combattimento per dimezzare il danno ricevuto. \ n [[YELLOW]] questo legato sempre al vostro livello di abilita.
|
||||
Guides.Archery=La guida arrivera dopo.
|
||||
Guides.Axes=La guida arrivera dopo.
|
||||
Guides.Excavation=[[DARK_AQUA]]Riguardo a Scavi:\n[[YELLOW]]Scavi e l’atto di smuover il terreno per trovare tesori.\n[[YELLOW]]Scavando per terra troverai alcuni tesori.\n[[YELLOW]]Piu la userai , piu tesori riusciari a trovare.\n\n[[DARK_AQUA]]GUADAGNARE ESPERIENZA:\n[[YELLOW]]Per guadagnare esperienza in questa abilita devi scavare tenendo in mano una pala.\n[[YELLOW]]Solo alcuni materiali possono essere scavati per ricavare tesori ed esperienza.\n[[DARK_AQUA]]Materiali Compatibili:\n[[YELLOW]]Erba, Terra, Sabbia, Argilla, Ghiaia, Micelio, Soul Sand\n\n[[DARK_AQUA]]Come usare Giga Drill Breaker:\n[[YELLOW]]Impugnando una pala premi col tasto destro per preparare il tuo attrezzo.\n[[YELLOW]Una volta in questo stato hai circa 4 secondi per entrare in\n[[YELLOW]]contatto con materiali compatibili e questo\n[[YELLOW]]attivera Super Trapano Breaker.\n[[DARK_AQUA]Cos’e Super Trapano Breaker?\n[[YELLOW]]Super Trapano Breaker e un’abilita con un tempo di raffreddamento\n[[YELLOW]]legato all’abilita Scavi. Triplica le tue possibilita\n[[YELLOW]]di trovare tesori e permette di rompere all’istante\n[[YELLOW]] i materiali appositi.\n\n[[DARK_AQUA]]Come funziona CercaTesori?\n[[YELLOW]]Ogni possible tesoro di Scavi ha un proprio\n[[YELLOW]]livello di abilita necessario per essere emesso, e come risultato e \n[[YELLOW]]diffiicile dire quanto sia utile questa abilita.\n[[YELLOW]]Tieni solo conto che piu alto sara il tuo livello di Scavi\n[[YELLOW]], maggiore sara la varieta di tesori che potrai trovare.\n[[YELLOW]]E ricordati anche che usando Scavi\n[[YELLOW]]ogni materiale compatibile ha la propria unica lista di tesori.\n[[YELLOW]]In altre parole troverai tesori diversi nella terra\n[[YELLOW]]rispetto a quelli nella ghiaia.\n[[DARK_AQUA]]Note riguardo a Scavi:\n[[YELLOW]]I premi di Scavi sono completamente personabilizzabili\n[[YELLOW]]Perciò variano da server a server.
|
||||
Guides.Excavation=[[DARK_AQUA]]Riguardo a Scavi:\n[[YELLOW]]Scavi e l?atto di smuover il terreno per trovare tesori.\n[[YELLOW]]Scavando per terra troverai alcuni tesori.\n[[YELLOW]]Piu la userai , piu tesori riusciari a trovare.\n\n[[DARK_AQUA]]GUADAGNARE ESPERIENZA:\n[[YELLOW]]Per guadagnare esperienza in questa abilita devi scavare tenendo in mano una pala.\n[[YELLOW]]Solo alcuni materiali possono essere scavati per ricavare tesori ed esperienza.\n[[DARK_AQUA]]Materiali Compatibili:\n[[YELLOW]]Erba, Terra, Sabbia, Argilla, Ghiaia, Micelio, Soul Sand\n\n[[DARK_AQUA]]Come usare Giga Drill Breaker:\n[[YELLOW]]Impugnando una pala premi col tasto destro per preparare il tuo attrezzo.\n[[YELLOW]Una volta in questo stato hai circa 4 secondi per entrare in\n[[YELLOW]]contatto con materiali compatibili e questo\n[[YELLOW]]attivera Super Trapano Breaker.\n[[DARK_AQUA]Cos?e Super Trapano Breaker?\n[[YELLOW]]Super Trapano Breaker e un?abilita con un tempo di raffreddamento\n[[YELLOW]]legato all?abilita Scavi. Triplica le tue possibilita\n[[YELLOW]]di trovare tesori e permette di rompere all?istante\n[[YELLOW]] i materiali appositi.\n\n[[DARK_AQUA]]Come funziona CercaTesori?\n[[YELLOW]]Ogni possible tesoro di Scavi ha un proprio\n[[YELLOW]]livello di abilita necessario per essere emesso, e come risultato e \n[[YELLOW]]diffiicile dire quanto sia utile questa abilita.\n[[YELLOW]]Tieni solo conto che piu alto sara il tuo livello di Scavi\n[[YELLOW]], maggiore sara la varieta di tesori che potrai trovare.\n[[YELLOW]]E ricordati anche che usando Scavi\n[[YELLOW]]ogni materiale compatibile ha la propria unica lista di tesori.\n[[YELLOW]]In altre parole troverai tesori diversi nella terra\n[[YELLOW]]rispetto a quelli nella ghiaia.\n[[DARK_AQUA]]Note riguardo a Scavi:\n[[YELLOW]]I premi di Scavi sono completamente personabilizzabili\n[[YELLOW]]Perciò variano da server a server.
|
||||
Guides.Fishing=La guida arrivera dopo.
|
||||
Guides.Herbalism=La guida arrivera dopo.
|
||||
Guides.Mining=[[DARK_AQUA]]Informazioni sul minatore:\n[[YELLOW]]Il minatore consiste nell’estrarre rocce e minerali. Procura dei bonus\n[[YELLOW]]alla quantita di materiali rilasciati dagli scavi.\n\n[[DARK_AQUA]]GUADAGNARE ESPERIENZA:\n[[YELLOW]]Per guadagnare esperienza in questa abilita, devi scavare impugnando un piccone.\n[[YELLOW]]Solo alcuni blocchi rilasciano esperienza.\n\n[[DARK_AQUA]]Materiali compatibili:\n[[YELLOW]]Pietra, Minerale di carbone, Minerale di ferro, Minerale d’oro, Minerale di diamanti, Minerale di Redstone,\n[[YELLOW]] Minerale di lapis lazuli, Ossidiana, MossStone, Pietra dell’Ender,\n[[YELLOW]]Glowstone, e Netherrack.\n\n[[DARK_AQUA]]Come usare Super Sfondamento?:\n[[YELLOW]]Impugnando un piccone , premi il tasto destro per preparare il tuo strumento.\n[[YELLOW]]Durante questo stadio, hai circa 4 secondi per entrare in contatto \n[[YELLOW]]con un minerale adatto, e ciò attivera Super\n[[YELLOW]]Sfondamento.\n\n[[DARK_AQUA]]Cos’e Super Sfondamento?\n[[YELLOW]Super sfondamento e un abilita con un tempo di raffreddamento legato all’abilita Scavo \n[[YELLOW]]. Triplica la possibilita che vengano rilasciati oggetti in piu e\n[[YELLOW]]e permette di rompere istatntaneamenti i minerali rocciosi.\n\n[[DARK_AQUA]]Come usare Scavi Esplosivi:\n[[YELLOW]]Con in mano un detonatore ,che e impostato con acciarino ,\n[[YELLOW]]clicca col tasto destro sulla TNT a distanza. Questo fara si che la TNT\n[[YELLOW]]esploda all’istante.\n\n[[DARK_AQUA]]Come funziona Scavi Esplosivi ?\n[[YELLOW]]Scavi Esplosivi e un abilita con una durata legato all’abilita di scavo\n[[YELLOW]]. Dona dei bounus quando sis cava con la TNT e permette a te \n[[YELLOW]]di fare esplodere la TNT a distanza.Ci sono 3 parti in Scavi Esplosivi.\n[[YELLOW]]La prima parte e Bombe Maggiori , che aumenta il raggio dell’esplosione.\n[[YELLOW]]La seconda e Esperto Demolitore, che diminuisce il danno\n[[YELLOW]]da TNT. La terza parte aumenta semplicemente the\n[[YELLOW]]la quantita di minerali rilasciati dalla TNT e diminuisce i\n[[YELLOW]]detriti rilasciati.
|
||||
Guides.Mining=[[DARK_AQUA]]Informazioni sul minatore:\n[[YELLOW]]Il minatore consiste nell?estrarre rocce e minerali. Procura dei bonus\n[[YELLOW]]alla quantita di materiali rilasciati dagli scavi.\n\n[[DARK_AQUA]]GUADAGNARE ESPERIENZA:\n[[YELLOW]]Per guadagnare esperienza in questa abilita, devi scavare impugnando un piccone.\n[[YELLOW]]Solo alcuni blocchi rilasciano esperienza.\n\n[[DARK_AQUA]]Materiali compatibili:\n[[YELLOW]]Pietra, Minerale di carbone, Minerale di ferro, Minerale d?oro, Minerale di diamanti, Minerale di Redstone,\n[[YELLOW]] Minerale di lapis lazuli, Ossidiana, MossStone, Pietra dell?Ender,\n[[YELLOW]]Glowstone, e Netherrack.\n\n[[DARK_AQUA]]Come usare Super Sfondamento?:\n[[YELLOW]]Impugnando un piccone , premi il tasto destro per preparare il tuo strumento.\n[[YELLOW]]Durante questo stadio, hai circa 4 secondi per entrare in contatto \n[[YELLOW]]con un minerale adatto, e ciò attivera Super\n[[YELLOW]]Sfondamento.\n\n[[DARK_AQUA]]Cos?e Super Sfondamento?\n[[YELLOW]Super sfondamento e un abilita con un tempo di raffreddamento legato all?abilita Scavo \n[[YELLOW]]. Triplica la possibilita che vengano rilasciati oggetti in piu e\n[[YELLOW]]e permette di rompere istatntaneamenti i minerali rocciosi.\n\n[[DARK_AQUA]]Come usare Scavi Esplosivi:\n[[YELLOW]]Con in mano un detonatore ,che e impostato con acciarino ,\n[[YELLOW]]clicca col tasto destro sulla TNT a distanza. Questo fara si che la TNT\n[[YELLOW]]esploda all?istante.\n\n[[DARK_AQUA]]Come funziona Scavi Esplosivi ?\n[[YELLOW]]Scavi Esplosivi e un abilita con una durata legato all?abilita di scavo\n[[YELLOW]]. Dona dei bounus quando sis cava con la TNT e permette a te \n[[YELLOW]]di fare esplodere la TNT a distanza.Ci sono 3 parti in Scavi Esplosivi.\n[[YELLOW]]La prima parte e Bombe Maggiori , che aumenta il raggio dell?esplosione.\n[[YELLOW]]La seconda e Esperto Demolitore, che diminuisce il danno\n[[YELLOW]]da TNT. La terza parte aumenta semplicemente the\n[[YELLOW]]la quantita di minerali rilasciati dalla TNT e diminuisce i\n[[YELLOW]]detriti rilasciati.
|
||||
Guides.Repair=La guida arrivera dopo.
|
||||
Guides.Swords=La guida arrivera dopo.
|
||||
Guides.Taming=La guida arrivera dopo.
|
||||
@@ -430,4 +430,4 @@ GodMode.Forbidden=[mcMMO] La god mode non e permessa in questo mondo (Controlla
|
||||
XPRate.Event = [[GOLD]]mcMMO ha un'evento in corso -> XP aumentato! la XP Rate e {0}x!
|
||||
BlastMining.Boom = [[GRAY]]**BOOM**
|
||||
Party.Forbidden=[mcMMO] I party non sono permessi in questo mondo (Controlla i Permessi)
|
||||
m.TamingSummonOcelotFailed=[[RED]]You have too many ocelots nearby to summon any more.
|
||||
m.TamingSummonOcelotFailed=[[RED]]Hai troppi gattopardi con te per poterne chiamare altri.
|
||||
Reference in New Issue
Block a user