-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #46 from Unprotesting/new-data-system
New data system
- Loading branch information
Showing
98 changed files
with
3,974 additions
and
7,843 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | ||
|
@@ -11,9 +8,7 @@ on: | |
|
||
jobs: | ||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up JDK 17 | ||
|
@@ -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: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
|
||
} | ||
|
||
|
||
|
||
} |
Oops, something went wrong.