Skip to content

Commit

Permalink
First build
Browse files Browse the repository at this point in the history
  • Loading branch information
reussy committed Jul 27, 2024
1 parent 94c5dd0 commit bd87eac
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,16 @@ public boolean saveUser(IUser user) {

private YamlConfiguration getBedWarsConfig() {

if (plugin.isBedWars1058Present()) {

if (plugin.getBW1058().isRunning()) {
return plugin.getBW1058().get().getConfigs().getMainConfig().getYml();

} else if (plugin.isBedWarsProxyPresent()) {
} else if (plugin.getBW2023().isRunning()) {
return plugin.getBW2023().get().getConfigs().getMainConfig().getYml();
} else if (plugin.getBWProxy().isRunning()) {
File proxyConfig = new File("plugins/BedWarsProxy/config.yml");

return YamlConfiguration.loadConfiguration(proxyConfig);

} else if (plugin.getBWProxy2023().isRunning()) {
File proxyConfig = new File("plugins/BedWarsProxy2023/config.yml");
return YamlConfiguration.loadConfiguration(proxyConfig);
} else {
Bukkit.getLogger().severe("There is no BedWars plugin installed!");
Bukkit.getLogger().severe("Disabling...");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.reussy.development.plugin.WinStreakPlugin;
import com.reussy.development.plugin.repository.User;
import com.reussy.development.plugin.storage.IStorage;
import org.jetbrains.annotations.NotNull;

import java.io.File;
import java.io.IOException;
Expand All @@ -15,10 +16,20 @@ public class SQLite implements IStorage {
private final String url;
private Connection connection;

public SQLite(WinStreakPlugin plugin) {
File database = plugin.isBedWars1058Present()
? new File("plugins/BedWars1058/Cache/win_streak.db")
: new File("plugins/BedWarsProxy/Cache/win_streak.db");
public SQLite(@NotNull WinStreakPlugin plugin) {

File database;
if (plugin.getBW2023().isRunning()) {
database = new File("plugins/BedWars1058/Cache/win_streak.db");
} else if (plugin.getBW2023().isRunning()) {
database = new File("plugins/BedWars2023/Cache/win_streak.db");
} else if (plugin.getBWProxy().isRunning()) {
database = new File("plugins/BedWarsProxy/Cache/win_streak.db");
} else {
database = new File("plugins/BWProxy2023/Cache/win_streak.db");
}


if (!database.exists())
try {
database.createNewFile();
Expand Down

0 comments on commit bd87eac

Please sign in to comment.