Skip to content

Commit

Permalink
feat: remove db (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
ybw0014 authored Sep 20, 2024
1 parent 3a90ad4 commit 929d570
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 306 deletions.
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

0 comments on commit 929d570

Please sign in to comment.