Cleanup parts of the sponge service implementation
This commit is contained in:
@@ -62,7 +62,7 @@ public class ProgressLogger {
|
||||
}
|
||||
}
|
||||
|
||||
public void logErr(String msg) {
|
||||
public void logError(String msg) {
|
||||
if (this.pluginName == null) {
|
||||
this.listeners.forEach(s -> this.logMessage.send(s, "Error -> " + msg));
|
||||
} else {
|
||||
@@ -80,7 +80,6 @@ public class ProgressLogger {
|
||||
|
||||
public void logProgress(String msg, int amount) {
|
||||
if (amount % NOTIFY_FREQUENCY == 0) {
|
||||
// migrated {} groups so far.
|
||||
logAllProgress(msg, amount);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,30 @@
|
||||
|
||||
package me.lucko.luckperms.common.model;
|
||||
|
||||
import java.util.function.Supplier;
|
||||
|
||||
public enum NodeMapType {
|
||||
|
||||
ENDURING, TRANSIENT
|
||||
ENDURING,
|
||||
TRANSIENT;
|
||||
|
||||
// useful methods for fluent/conditional execution
|
||||
|
||||
public void run(Runnable ifEnduring, Runnable ifTransient) {
|
||||
if (this == ENDURING) {
|
||||
ifEnduring.run();
|
||||
} else {
|
||||
ifTransient.run();
|
||||
}
|
||||
}
|
||||
|
||||
public <T> T supply(Supplier<T> ifEnduring, Supplier<T> ifTransient) {
|
||||
if (this == ENDURING) {
|
||||
return ifEnduring.get();
|
||||
} else {
|
||||
return ifTransient.get();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -262,6 +262,10 @@ public abstract class PermissionHolder {
|
||||
return this.transientNodes;
|
||||
}
|
||||
|
||||
public ImmutableSetMultimap<ImmutableContextSet, Node> getNodes(NodeMapType type) {
|
||||
return getData(type).immutable();
|
||||
}
|
||||
|
||||
public ImmutableSetMultimap<ImmutableContextSet, Node> getEnduringNodes() {
|
||||
return this.enduringNodes.immutable();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user