mirror of
https://github.com/BentoBoxWorld/BentoBox.git
synced 2024-12-27 11:37:36 +01:00
Made Notifier.Notification private
External plugins/addons shouldn't have had access to this inner class.
This commit is contained in:
parent
678e699f1d
commit
8e7843de82
@ -40,7 +40,8 @@ public class Notifier {
|
|||||||
try {
|
try {
|
||||||
Notification lastNotification = notificationCache.get(user);
|
Notification lastNotification = notificationCache.get(user);
|
||||||
long now = System.currentTimeMillis();
|
long now = System.currentTimeMillis();
|
||||||
if (now >= lastNotification.getTime() + NOTIFICATION_DELAY * 1000 || !message.equals(lastNotification.getMessage())) {
|
|
||||||
|
if (now >= lastNotification.getTime() + (NOTIFICATION_DELAY * 1000) || !message.equals(lastNotification.getMessage())) {
|
||||||
notificationCache.put(user, new Notification(message, now));
|
notificationCache.put(user, new Notification(message, now));
|
||||||
user.sendRawMessage(message);
|
user.sendRawMessage(message);
|
||||||
return true;
|
return true;
|
||||||
@ -51,11 +52,11 @@ public class Notifier {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Notification {
|
private class Notification {
|
||||||
private final String message;
|
private final String message;
|
||||||
private final long time;
|
private final long time;
|
||||||
|
|
||||||
public Notification(String message, long time) {
|
private Notification(String message, long time) {
|
||||||
this.message = message;
|
this.message = message;
|
||||||
this.time = time;
|
this.time = time;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user