Fixed a bug that would spam other players when someone used an ability

This commit is contained in:
nossr50 2019-05-27 19:25:36 -07:00
parent 50e4e971d9
commit 1cda612e86
3 changed files with 8 additions and 10 deletions

View File

@ -1,10 +1,13 @@
Version 2.1.64
Corrected how Standard mode (1-100 scaling) XP to next level was calculated, it is now a true 1:10 ratio with Retro (1-1000) scale, which is how it was intended to be to begin with
Fixed a bug that caused skill messages to spam nearby players
(API) method to get XP in FormulaManager has been renamed to getXPtoNextLevel(...), this shouldn't break anything as plugins should be using our Experience API methods instead of this
(API) Added method getLevel(Player player, PrimarySkillType primarySkillType) to ExperienceAPI.java
Corrected how Standard mode (1-100 scaling) XP to next level was calculated, it is now a true 1:10 ratio with Retro (1-1000) scale, which is how it was intended to be to begin with
NOTE: The net result of this change is it will take a bit longer to level with Standard, but it should not be a drastic change. You might not even notice it.
Standard is meant to take the same amount of time to level from levels 1-100 as it takes Retro to do 1-1000, this change corrects from errors in the code that made Standard actually take less XP than Retro despite intending for it to be a cosmetic difference in progression.
I made a google sheet visualizing the difference between Standard and Retro Mode using default settings and Linear formula - https://docs.google.com/spreadsheets/d/1VlJtvNHlypACHyz_zulEdhgLwFjL01xMPkqlnu0XBSs/edit?usp=sharing
Version 2.1.63
Fixed Armor Impact not scaling by skill rank

View File

@ -55,19 +55,14 @@ public class NotificationManager {
* Sends players notifications from mcMMO
* This does this by sending out an event so other plugins can cancel it
* This event in particular is provided with a source player, and players near the source player are sent the information
* @param source the source player for this event
* @param targetPlayer the recipient player for this message
* @param notificationType type of notification
* @param key Locale Key for the string to use with this event
* @param values values to be injected into the locale string
*/
public static void sendNearbyPlayersInformation(Player source, NotificationType notificationType, String key, String... values)
public static void sendNearbyPlayersInformation(Player targetPlayer, NotificationType notificationType, String key, String... values)
{
Location location = source.getLocation();
for (Player otherPlayer : source.getWorld().getPlayers()) {
if (otherPlayer != source && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) {
sendPlayerInformation(otherPlayer, notificationType, key, values);
}
}
sendPlayerInformation(targetPlayer, notificationType, key, values);
}
public static void sendPlayerInformation(Player player, NotificationType notificationType, String key, String... values)

View File

@ -125,7 +125,7 @@ public class SkillUtils {
for (Player otherPlayer : player.getWorld().getPlayers()) {
if (otherPlayer != player && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) {
NotificationManager.sendNearbyPlayersInformation(player, notificationType, key, player.getName());
NotificationManager.sendNearbyPlayersInformation(otherPlayer, notificationType, key, player.getName());
}
}
}