mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
You will only gain shared party XP if you are visible to the player gaining XP
This commit is contained in:
parent
d3c47935d4
commit
cde11b64ed
@ -35,7 +35,7 @@ public final class ShareHandler {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Player> nearMembers = PartyManager.getNearMembers(mcMMOPlayer);
|
List<Player> nearMembers = PartyManager.getNearVisibleMembers(mcMMOPlayer);
|
||||||
|
|
||||||
if (nearMembers.isEmpty()) {
|
if (nearMembers.isEmpty()) {
|
||||||
return false;
|
return false;
|
||||||
|
@ -32,7 +32,16 @@ public class NotificationManager {
|
|||||||
sendNotification(player, customEvent);
|
sendNotification(player, customEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void sendOtherPlayersSkillInfo(Player source, NotificationType notificationType, String key, String... values)
|
/**
|
||||||
|
* 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 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)
|
||||||
{
|
{
|
||||||
Location location = source.getLocation();
|
Location location = source.getLocation();
|
||||||
for (Player otherPlayer : source.getWorld().getPlayers()) {
|
for (Player otherPlayer : source.getWorld().getPlayers()) {
|
||||||
|
@ -137,7 +137,7 @@ public class SkillUtils {
|
|||||||
|
|
||||||
for (Player otherPlayer : player.getWorld().getPlayers()) {
|
for (Player otherPlayer : player.getWorld().getPlayers()) {
|
||||||
if (otherPlayer != player && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) {
|
if (otherPlayer != player && Misc.isNear(location, otherPlayer.getLocation(), Misc.SKILL_MESSAGE_MAX_SENDING_DISTANCE)) {
|
||||||
NotificationManager.sendOtherPlayersSkillInfo(player, notificationType, key);
|
NotificationManager.sendNearbyPlayersInformation(player, notificationType, key);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user