use expression switches

This commit is contained in:
dfsek
2021-09-26 13:16:43 -07:00
parent 3de02c5d63
commit 8f51707505
39 changed files with 366 additions and 687 deletions

View File

@@ -66,7 +66,7 @@ public abstract class AbstractPlatform implements Platform {
private final AddonRegistry addonRegistry = new AddonRegistry(this);
private final Lazy<Logger> logger = Lazy.lazy(() -> createLogger());
private final Lazy<Logger> logger = Lazy.lazy(this::createLogger);
private final Lazy<DebugLogger> debugLogger = Lazy.lazy(() -> new DebugLogger(logger()));
@Override

View File

@@ -27,8 +27,6 @@ public class PacksCommand implements CommandTemplate {
}
LangUtil.send("command.packs.main", sender);
registry.entries().forEach(entry -> {
LangUtil.send("command.packs.pack", sender, entry.getID(), entry.getAuthor(), entry.getVersion());
});
registry.entries().forEach(entry -> LangUtil.send("command.packs.pack", sender, entry.getID(), entry.getAuthor(), entry.getVersion()));
}
}

View File

@@ -39,7 +39,7 @@ public class OpenRegistryImpl<T> implements OpenRegistry<T> {
T obj = get((String) o);
StringBuilder keys = new StringBuilder("[");
objects.keySet().forEach(key -> keys.append(key + ", "));
objects.keySet().forEach(key -> keys.append(key).append(", "));
if(obj == null)
throw new LoadException("No such " + type.getType().getTypeName() + " matching \"" + o +

View File

@@ -30,9 +30,7 @@ public class ProfilerTest {
PROFILER.push("thing4");
PROFILER.pop("thing4");
PROFILER.getTimings().forEach((id, timings) -> {
System.out.println(id + ": " + timings.toString());
});
PROFILER.getTimings().forEach((id, timings) -> System.out.println(id + ": " + timings.toString()));
}
private static void doThing() throws InterruptedException {