Skip to content

Commit

Permalink
Minor code cleanup, use only Java 8 features
Browse files Browse the repository at this point in the history
  • Loading branch information
Axionize committed Oct 26, 2024
1 parent a35b208 commit 7026184
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import org.bukkit.Bukkit;
import org.bukkit.World;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down
14 changes: 6 additions & 8 deletions common/src/main/java/me/caseload/knockbacksync/Base.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@

import java.io.File;
import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.util.logging.Logger;

// Base class
Expand All @@ -54,11 +52,11 @@ protected Base() {
}

private Platform getPlatform() {
final Map<String, Platform> platforms = Map.of(
"io.papermc.paper.threadedregions.RegionizedServer", Platform.FOLIA,
"org.bukkit.Bukkit", Platform.BUKKIT,
"net.fabricmc.loader.api.FabricLoader", Platform.FABRIC
);
final Map<String, Platform> platforms = Collections.unmodifiableMap(new HashMap<String, Platform>() {{
put("io.papermc.paper.threadedregions.RegionizedServer", Platform.FOLIA);
put("org.bukkit.Bukkit", Platform.BUKKIT);
put("net.fabricmc.loader.api.FabricLoader", Platform.FABRIC);
}});

return platforms.entrySet().stream()
.filter(entry -> isClassPresent(entry.getKey()))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ public class BuildTypePie extends SimplePie {
private static final String RELEASES_FILE = "releases.txt";
private static final String DEV_BUILDS_FILE = "dev-builds.txt";
private static final File dataFolder = Base.INSTANCE.getDataFolder();
public static URL jarUrl;
private static String cachedBuildType = null;

public BuildTypePie() {
Expand Down

0 comments on commit 7026184

Please sign in to comment.