Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: remove db #8

Merged
merged 2 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/sonar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ jobs:
java-version: 21
distribution: 'temurin' # Alternative distribution options are available.
- name: Cache SonarCloud packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.sonar/cache
key: ${{ runner.os }}-sonar
restore-keys: ${{ runner.os }}-sonar
- name: Cache Maven packages
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: ~/.m2
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
Expand Down
11 changes: 2 additions & 9 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,6 @@
</exclusions>
</dependency>

<dependency>
<groupId>org.xerial</groupId>
<artifactId>sqlite-jdbc</artifactId>
<version>3.43.2.2</version>
<scope>compile</scope>
</dependency>

<dependency>
<groupId>org.bstats</groupId>
<artifactId>bstats-bukkit</artifactId>
Expand All @@ -153,8 +146,8 @@

<dependency>
<groupId>net.guizhanss</groupId>
<artifactId>guizhanlib-all</artifactId>
<version>2.0.0-SNAPSHOT</version>
<artifactId>GuizhanLib-api</artifactId>
<version>1.8.1</version>
<scope>compile</scope>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@

import net.guizhanss.gcereborn.core.commands.GCECommand;
import net.guizhanss.gcereborn.core.services.ConfigurationService;
import net.guizhanss.gcereborn.core.services.DatabaseService;
import net.guizhanss.gcereborn.core.services.IntegrationService;
import net.guizhanss.gcereborn.core.services.LocalizationService;
import net.guizhanss.gcereborn.listeners.WorldSavedListener;
import net.guizhanss.gcereborn.setup.Items;
import net.guizhanss.gcereborn.setup.Researches;
import net.guizhanss.guizhanlib.slimefun.addon.AbstractAddon;
Expand All @@ -33,7 +31,6 @@ public class GeneticChickengineering extends AbstractAddon {

private ConfigurationService configService;
private LocalizationService localization;
private DatabaseService dbService;
private IntegrationService integrationService;
private boolean debugEnabled = false;

Expand All @@ -51,11 +48,6 @@ public static LocalizationService getLocalization() {
return inst().localization;
}

@Nonnull
public static DatabaseService getDatabaseService() {
return inst().dbService;
}

@Nonnull
public static IntegrationService getIntegrationService() {
return inst().integrationService;
Expand Down Expand Up @@ -105,14 +97,6 @@ public void enable() {
return;
}

// database
log(Level.INFO, localization.getString("console.load.database"));
dbService = new DatabaseService(this);
if (!dbService.isConnected()) {
getServer().getPluginManager().disablePlugin(this);
return;
}

// items
log(Level.INFO, localization.getString("console.load.items"));
Items.setup(this);
Expand All @@ -122,7 +106,6 @@ public void enable() {
Researches.setup();

// listeners
new WorldSavedListener(this);

// commands
if (configService.isCommandsEnabled()) {
Expand All @@ -140,17 +123,11 @@ public void enable() {

// metrics
setupMetrics();

// run cleanup once after startup
getScheduler().run(() -> dbService.cleanup());
}

@Override
public void disable() {
if (dbService != null) {
dbService.cleanup();
dbService.shutdown();
}
// do nothing
}

private void setupMetrics() {
Expand Down

This file was deleted.

This file was deleted.

Loading