Skip to content

Commit

Permalink
Merge pull request #46 from Unprotesting/new-data-system
Browse files Browse the repository at this point in the history
New data system
  • Loading branch information
noahbclarkson authored Jun 30, 2022
2 parents 9b37064 + 5d9df5f commit 738d39a
Show file tree
Hide file tree
Showing 98 changed files with 3,974 additions and 7,843 deletions.
Binary file removed .github/GDPDisplay.gif
Binary file not shown.
18 changes: 4 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,24 @@ name: Bug report
about: Create a report to help us improve
title: "[BUG]"
labels: bug
assignees: ''
assignees: 'Unprotesting'

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
**Steps To Reproduce**
Steps to reproduce the behavior:
1. Go to '....'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Minecraft Server Version**
1.18 etc.
1.19 etc.

**Auto-Tune-Version**
0.13.0 etc.

**Plugin List**
Essentials, Vault etc.

**Additional context**
Add any other context about the problem here.
Add any other context about the problem here (logs, plugins, etc.)
Binary file removed .github/OnlineGraphDisplay.gif
Binary file not shown.
Binary file removed .github/SellDisplay.gif
Binary file not shown.
Binary file removed .github/ShopDisplay.gif
Binary file not shown.
Binary file removed .github/graph.png
Binary file not shown.
Binary file removed .github/shop.png
Binary file not shown.
7 changes: 1 addition & 6 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will build a Java project with Gradle
# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-gradle

name: Java CI with Gradle

on:
Expand All @@ -11,9 +8,7 @@ on:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
Expand All @@ -28,7 +23,7 @@ jobs:
- name: Gradle Build Action
uses: gradle/[email protected]
with:
arguments: build test
arguments: test build
gradle-version: '7.4'
- uses: actions/upload-artifact@v2
with:
Expand Down
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,12 @@
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

# VSCode
.settings
.vscode

# Gradle
gradle
.gradle
bin
build
gradle
tests
bin
34 changes: 0 additions & 34 deletions .project

This file was deleted.

929 changes: 48 additions & 881 deletions README.md

Large diffs are not rendered by default.

32 changes: 26 additions & 6 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ plugins {
}

group 'unprotesting.com.github'
version '0.13.1'
version '0.14.0-pre-release'

java {

Expand Down Expand Up @@ -35,9 +35,9 @@ dependencies {
compileOnly('com.github.milkbowl:VaultAPI:1.7.1') {
exclude group: "org.bukkit", module: "bukkit"
}

implementation 'org.mapdb:mapdb:3.0.8'

implementation 'org.bstats:bstats-bukkit:2.2.1'
implementation 'org.mapdb:mapdb:3.0.8'
implementation 'com.github.stefvanschie.inventoryframework:IF:0.10.6'

compileOnly 'io.papermc.paper:paper-api:1.19-R0.1-SNAPSHOT'
Expand All @@ -56,10 +56,30 @@ dependencies {

shadowJar {

archiveName("Auto-Tune-${project.version}.jar")
dependencies {
exclude(dependency('org.eclipse.collections:eclipse-collections-api'))
exclude(dependency('org.eclipse.collections:eclipse-collections'))
exclude(dependency('org.eclipse.collections:eclipse-collections-forkjoin'))
exclude(dependency('com.google.guava:guava'))
exclude(dependency('net.jpountz.lz4:lz4'))
exclude(dependency('org.jetbrains.kotlin:kotlin-stdlib'))
exclude(dependency('com.google.code.findbugs:jsr305'))
exclude(dependency('com.google.errorprone:error_prone_annotations'))
exclude(dependency('com.google.guava:failureaccess'))
exclude(dependency('com.google.guava:listenablefuture'))
exclude(dependency('com.google.j2objc:j2objc-annotations'))
exclude(dependency('org.checkerframework:checker-qual'))
exclude(dependency('org.jetbrains:annotations'))
exclude(dependency('org.jetbrains.kotlin:kotlin-stdlib-common'))
}

relocate "org.bstats", "unprotesting.com.github.bstats"
relocate "org.mapdb", "unprotesting.com.github.mapdb"
relocate "com.github.stefvanschie.inventoryframework", "unprotesting.com.github.inventoryframework"

relocate 'org.bstats', 'unprotesting.com.github.bstats'
relocate 'com.github.stefvanschie.inventoryframework', 'unprotesting.com.github.inventoryframework'
minimize()

archiveName("Auto-Tune-${project.version}.jar")

}

Expand Down
86 changes: 86 additions & 0 deletions src/main/java/unprotesting/com/github/AutoTune.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package unprotesting.com.github;

import lombok.Getter;

import org.bstats.bukkit.Metrics;
import org.bukkit.Bukkit;
import org.bukkit.plugin.java.JavaPlugin;

import unprotesting.com.github.commands.AutosellCommand;
import unprotesting.com.github.commands.LoanCommand;
import unprotesting.com.github.commands.SellCommand;
import unprotesting.com.github.commands.ShopCommand;
import unprotesting.com.github.config.Config;
import unprotesting.com.github.data.Database;
import unprotesting.com.github.events.AutoTuneInventoryCheckEvent;
import unprotesting.com.github.events.AutosellProfitEvent;
import unprotesting.com.github.events.IpCheckEvent;
import unprotesting.com.github.events.LoanInterestEvent;
import unprotesting.com.github.events.TimePeriodEvent;
import unprotesting.com.github.events.TutorialEvent;
import unprotesting.com.github.util.EconomyUtil;

@Getter
public class AutoTune extends JavaPlugin {

@Getter
// The static instance of the plugin.
private static AutoTune instance;

@Override
public void onEnable() {
instance = this;
EconomyUtil.setupLocalEconomy(Bukkit.getServer());
Config.init();
new Database();
setupEvents();
setupCommands();
new Metrics(this, 9687);
getLogger().info("Auto-Tune is now enabled!");
}

@Override
public void onDisable() {
Database.get().close();
getLogger().info("Auto-Tune is now disabled!");
}

private void setupCommands() {
getCommand("shop").setExecutor(new ShopCommand());
getCommand("sell").setExecutor(new SellCommand());
getCommand("autosell").setExecutor(new AutosellCommand());
getCommand("loan").setExecutor(new LoanCommand());
}

private void setupEvents() {

Bukkit.getScheduler().runTaskAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new IpCheckEvent(true)));

Bukkit.getScheduler().runTaskTimerAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new AutosellProfitEvent(true)),
1200L, 1200L);

Bukkit.getScheduler().runTaskTimerAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new LoanInterestEvent(true)),
1200L, 1200L);

Bukkit.getScheduler().runTaskTimerAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new TimePeriodEvent(true)),
(long) (Config.get().getTimePeriod() * 1200L),
(long) (Config.get().getTimePeriod() * 1200L));

Bukkit.getScheduler().runTaskTimerAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new TutorialEvent(true)),
(long) (Config.get().getTutorialUpdate() * 20),
(long) (Config.get().getTutorialUpdate() * 20));

Bukkit.getScheduler().runTaskTimerAsynchronously(this, () ->
Bukkit.getPluginManager().callEvent(new AutoTuneInventoryCheckEvent(true)),
200L, 4L);

}



}
Loading

0 comments on commit 738d39a

Please sign in to comment.