-
-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
94 changed files
with
5,120 additions
and
4,192 deletions.
There are no files selected for viewing
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,26 @@ | ||
root = true | ||
|
||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
# max_line_length = 120 | ||
tab_width = 4 | ||
trim_trailing_whitespace = true | ||
ij_continuation_indent_size = 8 | ||
ij_formatter_off_tag = @formatter:off | ||
ij_formatter_on_tag = @formatter:on | ||
ij_formatter_tags_enabled = true | ||
|
||
|
||
[{*.yaml,*.yml,*.json,*.graphqlconfig,*.har,*.jsb2,*.jsb3,*.webmanifest,.babelrc,.eslintrc,.prettierrc,.stylelintrc,bowerrc,jest.config}] | ||
indent_size = 2 | ||
tab_width = 2 | ||
|
||
|
||
[{*.markdown,*.md,*.html,*.htm,*.ng,*.sht,*.shtm,*.shtml,*.ts,*.ats,*.js,*.cjs,*.bash,*.sh,*.zsh}] | ||
indent_size = 2 | ||
tab_width = 2 |
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 @@ | ||
custom: [ 'https://craftaro.to/+' ] |
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,16 @@ | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: maven | ||
directory: / | ||
target-branch: development | ||
schedule: | ||
interval: monthly | ||
|
||
- package-ecosystem: github-actions | ||
directory: / | ||
target-branch: development | ||
schedule: | ||
interval: monthly |
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,95 @@ | ||
name: Build | ||
|
||
on: | ||
push: | ||
branches: [ master, development ] | ||
tags: | ||
- 'v*' | ||
pull_request: | ||
types: [ opened, synchronize, reopened ] | ||
|
||
permissions: read-all | ||
|
||
env: | ||
DEPLOYMENT_POM_PATH: ./EpicHoppers-API/pom.xml | ||
DEPLOYMENT_ARTIFACT_DIR: ./EpicHoppers-API/target | ||
DEPLOYMENT_ARTIFACT_SELECTOR: EpicHoppers-API-*.jar | ||
PLUGIN_ARTIFACT_DIR: ./EpicHoppers-Plugin/target | ||
PLUGIN_ARTIFACT_SELECTOR: EpicHoppers-*.jar | ||
|
||
jobs: | ||
Build: | ||
name: Build + Deploy | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Prepare Workspace | ||
uses: craftaro/GH-Commons/.github/actions/setup_workspace@master | ||
with: | ||
maven_username: ${{ secrets.PLUGINS_MAVEN_REPO_USERNAME }} | ||
maven_password: ${{ secrets.PLUGINS_MAVEN_REPO_PASSWORD }} | ||
|
||
- name: Set project version | ||
uses: craftaro/GH-Commons/.github/actions/maven_set_project_version@master | ||
with: | ||
append_snapshot: ${{ github.ref_type == 'tag' && 'false' || 'true' }} | ||
version: ${{ github.ref_type == 'tag' && github.ref_name || '' }} | ||
increment_version: ${{ github.ref_type != 'tag' && 'patch' || '' }} | ||
increment_version_only_if_not_snapshot_version: ${{ github.ref == 'refs/heads/development' && 'true' || 'false' }} | ||
|
||
- name: Build with Maven | ||
run: mvn -B -Duser.name="GitHub Actions on $GITHUB_REPOSITORY (id=$GITHUB_RUN_ID)" clean package | ||
|
||
- name: Sign jar archives | ||
uses: craftaro/GH-Commons/.github/actions/sign_jars@master | ||
with: | ||
jar_file_selector: ${{ env.DEPLOYMENT_ARTIFACT_DIR }}/${{ env.DEPLOYMENT_ARTIFACT_SELECTOR }} | ||
keystore_gpg_encrypted: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_GPG }} | ||
keystore_gpg_password: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_GPG_PASSWORD }} | ||
keystore_password: ${{ secrets.PLUGINS_JARSIGNER_KEYSTORE_PASSWORD }} | ||
|
||
- name: Upload Build Artifacts [API] | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.event.repository.name }}-API | ||
path: ${{ env.DEPLOYMENT_ARTIFACT_DIR }}/${{ env.DEPLOYMENT_ARTIFACT_SELECTOR }} | ||
|
||
- name: Upload Build Artifacts [Plugin] | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ github.event.repository.name }} | ||
path: ${{ env.PLUGIN_ARTIFACT_DIR }}/${{ env.PLUGIN_ARTIFACT_SELECTOR }} | ||
|
||
- name: Deploy to Maven repo | ||
if: ${{ github.event_name == 'push' }} | ||
uses: craftaro/GH-Commons/.github/actions/maven_deploy@master | ||
with: | ||
repository_url: ${{ vars.PLUGINS_MAVEN_REPO_URL_RELEASE }} | ||
repository_url_snapshots: ${{ vars.PLUGINS_MAVEN_REPO_URL_SNAPSHOT }} | ||
maven_pom_path: ${{ env.DEPLOYMENT_POM_PATH }} | ||
maven_out_dir: ${{ env.DEPLOYMENT_ARTIFACT_DIR }} | ||
|
||
- name: Deploy parent pom.xml to Maven repo | ||
if: ${{ github.event_name == 'push' }} | ||
uses: craftaro/GH-Commons/.github/actions/maven_deploy@master | ||
with: | ||
repository_url: ${{ vars.PLUGINS_MAVEN_REPO_URL_RELEASE }} | ||
repository_url_snapshots: ${{ vars.PLUGINS_MAVEN_REPO_URL_SNAPSHOT }} | ||
only_deploy_pom: true | ||
maven_out_dir: ${{ env.DEPLOYMENT_ARTIFACT_DIR }} | ||
|
||
discord_webhook: | ||
name: Send Discord Webhook | ||
runs-on: ubuntu-latest | ||
|
||
needs: [ Build ] | ||
if: ${{ always() && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/development' || github.ref_type == 'tag') }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Notify Webhook | ||
uses: craftaro/GH-Commons/.github/actions/discord_send_job_results@master | ||
with: | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
webhook_url: ${{ secrets.DISCORD_BUILD_STATUS_WEBHOOK }} |
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,14 +1,10 @@ | ||
|
||
out/ | ||
|
||
\.idea/ | ||
/src/main/resources/META-INF/MANIFEST.MF | ||
/EpicHoppers.iml | ||
|
||
target/ | ||
|
||
EpicHoppers-API/EpicHoppers-API\.iml | ||
|
||
EpicHoppers-Plugin/EpicHoppers-Plugin\.iml | ||
|
||
*.iml | ||
## JetBrains IDEs | ||
/.idea/ | ||
*.iml | ||
|
||
## Maven | ||
/**/target/ | ||
/**/dependency-reduced-pom.xml | ||
|
||
## Misc. | ||
.DS_Store |
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,70 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
|
||
<parent> | ||
<groupId>com.craftaro</groupId> | ||
<artifactId>EpicHoppers-Parent</artifactId> | ||
<version>5.0.1</version> | ||
<relativePath>../pom.xml</relativePath> | ||
</parent> | ||
<artifactId>EpicHoppers-API</artifactId> | ||
<version>1.0.0-SNAPSHOT</version> | ||
|
||
<build> | ||
<plugins> | ||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-javadoc-plugin</artifactId> | ||
<version>3.5.0</version> | ||
|
||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
|
||
<configuration> | ||
<links> | ||
<link>https://hub.spigotmc.org/javadocs/spigot/</link> | ||
</links> | ||
</configuration> | ||
</plugin> | ||
|
||
<plugin> | ||
<groupId>org.apache.maven.plugins</groupId> | ||
<artifactId>maven-source-plugin</artifactId> | ||
<version>3.3.0</version> | ||
|
||
<executions> | ||
<execution> | ||
<goals> | ||
<goal>jar</goal> | ||
</goals> | ||
</execution> | ||
</executions> | ||
</plugin> | ||
</plugins> | ||
</build> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>com.craftaro</groupId> | ||
<artifactId>CraftaroCore</artifactId> | ||
<version>${craftaro.coreVersion}</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
|
||
<!-- TODO: Downgrade to spigot-api 1.8 --> | ||
<dependency> | ||
<groupId>org.spigotmc</groupId> | ||
<artifactId>spigot-api</artifactId> | ||
<version>1.18-R0.1-SNAPSHOT</version> | ||
<scope>provided</scope> | ||
</dependency> | ||
</dependencies> | ||
</project> |
61 changes: 61 additions & 0 deletions
61
EpicHoppers-API/src/main/java/com/craftaro/epichoppers/EpicHoppersApi.java
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,61 @@ | ||
package com.craftaro.epichoppers; | ||
|
||
import com.craftaro.core.database.DataManager; | ||
import com.craftaro.epichoppers.boost.BoostManager; | ||
import com.craftaro.epichoppers.containers.ContainerManager; | ||
import com.craftaro.epichoppers.hopper.teleport.TeleportHandler; | ||
import com.craftaro.epichoppers.player.PlayerDataManager; | ||
import com.craftaro.epichoppers.hopper.levels.LevelManager; | ||
import org.jetbrains.annotations.ApiStatus; | ||
|
||
public class EpicHoppersApi { | ||
private static EpicHoppersApi instance; | ||
|
||
private final LevelManager levelManager; | ||
private final BoostManager boostManager; | ||
private final ContainerManager containerManager; | ||
private final TeleportHandler teleportHandler; | ||
private final PlayerDataManager playerDataManager; | ||
private EpicHoppersApi(LevelManager levelManager, | ||
BoostManager boostManager, | ||
ContainerManager containerManager, | ||
TeleportHandler teleportHandler, | ||
PlayerDataManager playerDataManager) { | ||
this.levelManager = levelManager; | ||
this.boostManager = boostManager; | ||
this.containerManager = containerManager; | ||
this.teleportHandler = teleportHandler; | ||
this.playerDataManager = playerDataManager; | ||
} | ||
|
||
public LevelManager getLevelManager() { | ||
return this.levelManager; | ||
} | ||
|
||
public BoostManager getBoostManager() { | ||
return this.boostManager; | ||
} | ||
|
||
public ContainerManager getContainerManager() { | ||
return this.containerManager; | ||
} | ||
|
||
public TeleportHandler getTeleportHandler() { | ||
return this.teleportHandler; | ||
} | ||
|
||
public PlayerDataManager getPlayerDataManager() { | ||
return this.playerDataManager; | ||
} | ||
|
||
public static EpicHoppersApi getApi() { | ||
return instance; | ||
} | ||
|
||
static void initApi(LevelManager levelManager, BoostManager boostManager, ContainerManager containerManager, TeleportHandler teleportHandler, PlayerDataManager playerDataManager) { | ||
if (instance != null) { | ||
throw new IllegalStateException(EpicHoppersApi.class.getSimpleName() + " already initialized"); | ||
} | ||
instance = new EpicHoppersApi(levelManager, boostManager, containerManager, teleportHandler, playerDataManager); | ||
} | ||
} |
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
Oops, something went wrong.