Skip to content

Commit c2ab2f3

Browse files
committed
remove static modifier on showFiles
1 parent dec3ae9 commit c2ab2f3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/us/mcparks/showscript/Main.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ public class Main extends JavaPlugin implements Listener {
4949

5050
private RegionListener regionListener;
5151

52-
public static Supplier<List<String>> showFileNames = new AsynchronouslyRefreshingSupplier<>(() -> {
53-
File fs = new File(Main.getPlugin(Main.class).getRealDataFolder(), "Shows");
52+
public Supplier<List<String>> showFileNames = new AsynchronouslyRefreshingSupplier<>(() -> {
53+
File fs = new File(getRealDataFolder(), "Shows");
5454
if (!fs.exists()) {
5555
fs.mkdir();
5656
}
@@ -94,6 +94,7 @@ public void onEnable() {
9494
// start RegionListener if WorldGuard is present
9595
Plugin worldGuard = Bukkit.getServer().getPluginManager().getPlugin("WorldGuard");
9696
if (worldGuard != null) {
97+
getLogger().info("Using WorldGuardWrapper");
9798
regionListener = new RegionListener(WorldGuardWrapper.getInstance());
9899
} else {
99100
getLogger().warning("WorldGuard not found. Region Shows will not function.");

src/us/mcparks/showscript/Shows.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ public List<String> showNames(CommandContext<CommandSender> sender, String input
131131
return new ArrayList<>();
132132
}
133133

134-
return Main.showFileNames.get().stream().filter(s -> s.startsWith(input)).collect(Collectors.toList());
134+
return main.showFileNames.get().stream().filter(s -> s.startsWith(input)).collect(Collectors.toList());
135135
}
136136

137137
@Suggestions("showDirectoryNames")
@@ -140,7 +140,7 @@ public List<String> showDirectories(CommandContext<CommandSender> sender, String
140140
return new ArrayList<>();
141141
}
142142

143-
return Main.showFileNames.get().stream().map(path -> path.lastIndexOf("/") == -1 ? path : path.substring(0, path.lastIndexOf("/"))).distinct().filter(s -> s.startsWith(input)).collect(Collectors.toList());
143+
return main.showFileNames.get().stream().map(path -> path.lastIndexOf("/") == -1 ? path : path.substring(0, path.lastIndexOf("/"))).distinct().filter(s -> s.startsWith(input)).collect(Collectors.toList());
144144
}
145145

146146
public static String getShowNameFromAbsolutePath(String absolutePath) {

0 commit comments

Comments
 (0)