-
-
Notifications
You must be signed in to change notification settings - Fork 103
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into clear-data-command
- Loading branch information
Showing
18 changed files
with
449 additions
and
146 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,32 @@ | ||
# 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 | ||
# | ||
# This worflow will also upload an artifact to Nexus, Hangar, Modrinth, and GitHub releases. | ||
|
||
name: Java CI with Gradle | ||
on: [ push ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
if: "!contains(github.event.commits[0].message, '[ci-skip]')" | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Test with Gradle | ||
run: ./gradlew test | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Upload artifacts | ||
uses: "actions/[email protected]" | ||
with: | ||
name: "IridiumSkyblock" | ||
path: "build/libs/IridiumSkyblock-*.jar" |
This file was deleted.
Oops, something went wrong.
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,162 @@ | ||
name: Publish Artifacts | ||
on: | ||
release: | ||
types: [ published ] | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: gradle/wrapper-validation-action@v1 | ||
- name: Set up JDK 17 | ||
uses: actions/[email protected] | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
cache: gradle | ||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Test with Gradle | ||
run: ./gradlew test | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
- name: Upload artifacts | ||
uses: "actions/[email protected]" | ||
with: | ||
name: "IridiumSkyblock" | ||
path: "build/libs/IridiumSkyblock-*.jar" | ||
|
||
update-release: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Downloading artifact | ||
uses: actions/checkout@v2 | ||
- uses: thecodemonkey/action-get-gradle-version@master | ||
id: version | ||
with: | ||
file: "build.gradle.kts" | ||
- uses: actions/[email protected] | ||
with: | ||
name: "IridiumSkyblock" | ||
path: "./" | ||
|
||
- name: Upload release asset | ||
uses: softprops/action-gh-release@v2 | ||
with: | ||
files: "IridiumSkyblock-*.jar" | ||
|
||
publish-nexus: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Downloading artifact | ||
uses: actions/checkout@v2 | ||
- uses: thecodemonkey/action-get-gradle-version@master | ||
id: version | ||
with: | ||
file: "build.gradle.kts" | ||
- uses: actions/[email protected] | ||
with: | ||
name: "IridiumSkyblock" | ||
path: "./" | ||
|
||
- name: Publishing to Nexus | ||
uses: sonatype-nexus-community/nexus-repo-github-action@master | ||
with: | ||
serverUrl: "https://nexus.iridiumdevelopment.net/" | ||
username: "${{ secrets.NEXUS_USERNAME }}" | ||
password: "${{ secrets.NEXUS_PASSWORD }}" | ||
format: "maven2" | ||
repository: "maven-releases" | ||
coordinates: "groupId=com.iridium artifactId=IridiumSkyblock version=${{steps.version.outputs.version}} generate-pom=on" | ||
assets: "extension=jar" | ||
filename: "IridiumSkyblock-*.jar" | ||
|
||
# publish-hangar: | ||
# needs: build | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - name: Downloading artifact | ||
# uses: actions/checkout@v2 | ||
# - uses: thecodemonkey/action-get-gradle-version@master | ||
# id: version | ||
# with: | ||
# file: "build.gradle.kts" | ||
# - uses: actions/[email protected] | ||
# with: | ||
# name: "IridiumSkyblock" | ||
# path: "./" | ||
# | ||
# - if: github.event.release.prerelease == true | ||
# name: Publishing to Hangar (Beta) | ||
# uses: benwoo1110/[email protected] | ||
# with: | ||
# api-token: ${{ secrets.HANGAR_API_TOKEN }} | ||
# slug: IridiumSkyblock | ||
# channel: beta | ||
# version: ${{steps.version.outputs.version}} | ||
# files: "IridiumSkyblock-*.jar" | ||
# | ||
# - if: github.event.release.prerelease == false | ||
# name: Publishing to Hangar (Release) | ||
# uses: benwoo1110/[email protected] | ||
# with: | ||
# api-token: ${{ secrets.HANGAR_API_TOKEN }} | ||
# slug: IridiumSkyblock | ||
# channel: release | ||
# version: ${{steps.version.outputs.version}} | ||
# files: "IridiumSkyblock-*.jar" | ||
|
||
publish-modrinth: | ||
needs: build | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Downloading artifact | ||
uses: actions/checkout@v2 | ||
- uses: thecodemonkey/action-get-gradle-version@master | ||
id: version | ||
with: | ||
file: "build.gradle.kts" | ||
- uses: actions/[email protected] | ||
with: | ||
name: "IridiumSkyblock" | ||
path: "./" | ||
|
||
- if: github.event.release.prerelease == true | ||
name: Publish to Modrinth (Beta) | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
files: "IridiumSkyblock-*.jar" | ||
version: ${{steps.version.outputs.version}} | ||
version-type: beta | ||
modrinth-id: uVMG0MzO | ||
modrinth-featured: false | ||
modrinth-unfeature-mode: any | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
loaders: | | ||
paper | ||
spigot | ||
game-versions: | | ||
>=1.13 <=1.20.4 | ||
- if: github.event.release.prerelease == false | ||
name: Publish to Modrinth (Release) | ||
uses: Kir-Antipov/[email protected] | ||
with: | ||
files: "IridiumSkyblock-*.jar" | ||
version: ${{steps.version.outputs.version}} | ||
version-type: release | ||
modrinth-id: uVMG0MzO | ||
modrinth-featured: true | ||
modrinth-unfeature-mode: any | ||
modrinth-token: ${{ secrets.MODRINTH_TOKEN }} | ||
loaders: | | ||
paper | ||
spigot | ||
game-versions: | | ||
>=1.13 <=1.20.4 |
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
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
28 changes: 28 additions & 0 deletions
28
src/main/java/com/iridium/iridiumskyblock/listeners/PlayerRespawnEventListener.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,28 @@ | ||
package com.iridium.iridiumskyblock.listeners; | ||
|
||
import com.iridium.iridiumskyblock.IridiumSkyblock; | ||
import com.iridium.iridiumskyblock.database.Island; | ||
import com.iridium.iridiumskyblock.utils.PlayerUtils; | ||
import lombok.AllArgsConstructor; | ||
import org.bukkit.event.EventHandler; | ||
import org.bukkit.event.EventPriority; | ||
import org.bukkit.event.Listener; | ||
import org.bukkit.event.player.PlayerRespawnEvent; | ||
|
||
import java.util.Optional; | ||
|
||
@AllArgsConstructor | ||
public class PlayerRespawnEventListener implements Listener { | ||
|
||
@EventHandler(priority = EventPriority.HIGHEST) | ||
public void onPlayerRespawnEvent(PlayerRespawnEvent event) { | ||
|
||
if (!IridiumSkyblock.getInstance().getConfiguration().spawnOnIsland) return; | ||
if (!event.isBedSpawn() && !event.isAnchorSpawn()) event.setRespawnLocation(PlayerUtils.getSpawn(event.getPlayer())); | ||
|
||
Optional<Island> island = IridiumSkyblock.getInstance().getTeamManager().getTeamViaLocation(event.getRespawnLocation()); | ||
if (!island.isPresent()) return; | ||
|
||
if (!IridiumSkyblock.getInstance().getIslandManager().canVisit(event.getPlayer(), island.get())) event.setRespawnLocation(PlayerUtils.getSpawn(event.getPlayer())); | ||
} | ||
} |
Oops, something went wrong.