Skip to content

Commit

Permalink
Merge branch 'master' into clear-data-command
Browse files Browse the repository at this point in the history
  • Loading branch information
sh0inx committed May 18, 2024
2 parents 565be7c + 4120244 commit 077e1a7
Show file tree
Hide file tree
Showing 18 changed files with 449 additions and 146 deletions.
32 changes: 32 additions & 0 deletions .github/workflows/gradle-build.yml
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"
55 changes: 0 additions & 55 deletions .github/workflows/gradle.yml

This file was deleted.

162 changes: 162 additions & 0 deletions .github/workflows/publish.yml
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Every aspect of the plugin has been carefully crafted to suit the server's needs

## Getting Started

Download the plugin from [Spigot](https://www.spigotmc.org/resources/iridium-skyblock-1-13-1-19.62480/), download builds from our [Github](https://github.com/Iridium-Development/IridiumSkyblock/releases), or compile it yourself.
Download the plugin from [Spigot](https://www.spigotmc.org/resources/iridium-skyblock-1-13-1-19.62480/), [Modrinth](https://modrinth.com/plugin/iridiumskyblock), [Hangar](https://hangar.papermc.io/IridiumDevelopment/IridiumSkyblock), [Github Releases](https://github.com/Iridium-Development/IridiumSkyblock/releases), or compile it yourself.

Once you have a copy of the plugin (it should be a ``.jar`` file), simply place it in the ``server/plugins`` folder.

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

group = "com.iridium"
version = "4.0.8"
version = "4.0.9.1"
description = "IridiumSkyblock"

repositories {
Expand All @@ -23,17 +23,17 @@ dependencies {
implementation("org.jetbrains:annotations:24.1.0")
implementation("com.j256.ormlite:ormlite-core:6.1")
implementation("com.j256.ormlite:ormlite-jdbc:6.1")
implementation("com.iridium:IridiumTeams:2.4.0")
implementation("com.iridium:IridiumTeams:2.4.4")

// Other dependencies that are not required or already available at runtime
compileOnly("org.projectlombok:lombok:1.18.30")
compileOnly("org.spigotmc:spigot-api:1.20.4-R0.1-SNAPSHOT")
compileOnly("org.projectlombok:lombok:1.18.32")
compileOnly("org.spigotmc:spigot-api:1.20.6-R0.1-SNAPSHOT")
compileOnly("com.github.MilkBowl:VaultAPI:1.7.1")
compileOnly("net.ess3:EssentialsXSpawn:2.16.1")
compileOnly("com.sk89q.worldedit:worldedit-bukkit:7.2.13-SNAPSHOT")

// Enable lombok annotation processing
annotationProcessor("org.projectlombok:lombok:1.18.30")
annotationProcessor("org.projectlombok:lombok:1.18.32")
}

tasks {
Expand All @@ -51,6 +51,7 @@ tasks {
archiveClassifier.set("")

// Relocate dependencies
relocate("com.iridium.iridiumcore")
relocate("com.j256.ormlite")
relocate("org.bstats")
relocate("de.jeff_media.updatechecker")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.iridium.iridiumteams.IridiumTeams;
import com.iridium.iridiumteams.managers.MissionManager;
import com.iridium.iridiumteams.managers.ShopManager;
import com.iridium.iridiumteams.managers.SupportManager;
import lombok.Getter;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
Expand Down Expand Up @@ -62,6 +63,7 @@ public class IridiumSkyblock extends IridiumTeams<Island, User> {
private SchematicManager schematicManager;
private ShopManager<Island, User> shopManager;
private BiomeManager biomeManager;
private SupportManager<Island, User> supportManager;

private Economy economy;

Expand Down Expand Up @@ -99,6 +101,10 @@ public void onEnable() {
this.missionManager = new MissionManager<>(this);
this.shopManager = new ShopManager<>(this);
this.biomeManager = new BiomeManager();
this.supportManager = new SupportManager<>(this);

supportManager.registerSupport();

try {
databaseManager.init();
} catch (SQLException exception) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ public Configuration() {
public boolean clearEnderChestOnRegen = false;
public boolean allowPvPOnIslands = false;
public boolean islandCreateOnJoin = false;
public boolean spawnOnIsland = false;
public int distance = 151;
public int netherUnlockLevel = 10;
public int endUnlockLevel = 20;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ public void setColor(Color color) {
if (super.getName() != null) return super.getName();
String ownerName = getOwner()
.map(User::getName)
.orElse("N/A");
.orElse(IridiumSkyblock.getInstance().getMessages().nullPlaceholder);
return IridiumSkyblock.getInstance().getConfiguration().defaultIslandName.replace("%owner%", ownerName);
}

Expand Down
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()));
}
}
Loading

0 comments on commit 077e1a7

Please sign in to comment.