Skip to content
Merged

Dev #119

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
9f46632
updated README.md, added bstats, removed unused dependencies, fixed k…
Nandi0813 Dec 11, 2025
8736a5f
Merge branch 'master' into dev
Nandi0813 Dec 11, 2025
e5aadce
updated dependency versions, fixed fork util
Nandi0813 Dec 11, 2025
d1d52d1
Merge branch 'master' into dev
Nandi0813 Dec 11, 2025
6e856e6
Merge branch 'dev' of https://github.com/Nandi0813/ZonePractice-Pro i…
Nandi0813 Dec 11, 2025
61d3c4a
removed 1.8 fork support
Nandi0813 Dec 11, 2025
a684f98
removed carbon repo
Nandi0813 Dec 11, 2025
107593c
Merge remote-tracking branch 'origin/dev' into dev
Nandi0813 Dec 13, 2025
106ddc0
added null check for tablist user retreval, added 2ms delay for tab i…
Nandi0813 Dec 15, 2025
3b009e0
Merge branch 'master' into dev
Nandi0813 Dec 15, 2025
b47ffdf
Merge branch 'master' into dev
Nandi0813 Dec 15, 2025
f8d6f9a
refactored code
Nandi0813 Dec 15, 2025
a3dbcf8
refactored minimessage to one instance, removed prelogin event listener
Nandi0813 Dec 15, 2025
a76ab4e
Merge branch 'master' into dev
Nandi0813 Dec 18, 2025
43507a8
refactored Common class
Nandi0813 Dec 18, 2025
3199aa3
updated version to 6.22-SNAPSHOT
Nandi0813 Dec 18, 2025
2140672
updated dependencies
Nandi0813 Dec 18, 2025
7534d6b
move libs to Git LFS
Nandi0813 Dec 18, 2025
ff838e0
updated README.md to reflect new git lfs support
Nandi0813 Dec 18, 2025
f3e45ab
Merge branch 'master' into dev
Nandi0813 Dec 18, 2025
feadc6d
updated pom to fix compile error
Nandi0813 Dec 20, 2025
4597d34
updated anvilgui dependency
Nandi0813 Dec 28, 2025
6a60422
added pipeline integration
Nandi0813 Dec 28, 2025
f5f82d1
updated paper 1.8 depend scope
Nandi0813 Dec 28, 2025
7ac703b
updated paper 1.8 depend scope
Nandi0813 Dec 28, 2025
07082a7
Merge branch 'master' into dev
Nandi0813 Dec 28, 2025
27531b9
added git lfs to maven-build.yml
Nandi0813 Dec 28, 2025
8fa025d
Merge remote-tracking branch 'origin/dev' into dev
Nandi0813 Dec 28, 2025
1aa2c0b
updated maven build to use JDK 21
Nandi0813 Dec 28, 2025
d7b25b4
removed filename from distribution pom
Nandi0813 Dec 28, 2025
c84477a
added release workflow
Nandi0813 Dec 28, 2025
160d53c
updated version to 6.22.1-SNAPSHOT
Nandi0813 Dec 28, 2025
53c89d2
updated workflow files to delete original build jars
Nandi0813 Dec 28, 2025
d5dea46
added code analysis workflow
Nandi0813 Dec 28, 2025
0f6193c
updated code analysis workflow
Nandi0813 Dec 28, 2025
af60137
changes suggested by qodana
Nandi0813 Dec 28, 2025
6f04a1e
deleted unused file
Nandi0813 Dec 28, 2025
4a1b61f
added bootstrap to qodana.yaml
Nandi0813 Dec 28, 2025
615122b
Enhance building instructions in README
Nandi0813 Dec 28, 2025
e519d4e
updated qodana workflow
Nandi0813 Dec 28, 2025
a237c71
updated qodana workflow
Nandi0813 Dec 28, 2025
76dceb7
added sync dev workflow
Nandi0813 Dec 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/maven-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: ZonePractice Build

on:
push:
branches: [ "master", "main" ]
pull_request:
branches: [ "master", "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Install Local Dependencies
run: |
mvn install:install-file \
-Dfile=libs/PaperSpigot-1.8.8-R0.1-SNAPSHOT.jar \
-DgroupId=org.github.paperspigot \
-DartifactId=paperspigot-api \
-Dversion=1.8.8-R0.1-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true

- name: Build with Maven
run: mvn -B clean install --file pom.xml

- name: Upload Build Artifact
uses: actions/upload-artifact@v4
with:
name: ZonePractice-Plugin
path: |
distribution/target/*.jar
!distribution/target/original-*.jar
retention-days: 5
35 changes: 35 additions & 0 deletions .github/workflows/qodana_code_quality.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Qodana
on:
workflow_dispatch:
pull_request:
push:
branches:
- dev
- master

jobs:
qodana:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
checks: write
security-events: write

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
lfs: true

- name: 'Qodana Scan'
uses: JetBrains/qodana-action@v2024.3
env:
QODANA_TOKEN: ${{ secrets.QODANA_TOKEN }}
with:
pr-mode: false
use-caches: true
post-pr-comment: true
use-annotations: true
upload-result: false
75 changes: 75 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Auto Release on Version Change

on:
push:
branches: [ "master", "main" ]
paths: [ "pom.xml" ]

jobs:
check-and-release:
runs-on: ubuntu-latest
permissions:
contents: write

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
lfs: true
fetch-depth: 2

- name: Set up JDK 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'maven'

- name: Install Local Dependencies
run: |
mvn install:install-file \
-Dfile=libs/PaperSpigot-1.8.8-R0.1-SNAPSHOT.jar \
-DgroupId=org.github.paperspigot \
-DartifactId=paperspigot-api \
-Dversion=1.8.8-R0.1-SNAPSHOT \
-Dpackaging=jar \
-DgeneratePom=true

- name: Check for Version Change
id: check_version
run: |
# Get current version (-N = non-recursive, only main pom)
NEW_VERSION=$(mvn -N help:evaluate -Dexpression=project.version -q -DforceStdout)

# Get previous version (save previous pom to a temp file)
git show HEAD^:pom.xml > pom_old.xml
OLD_VERSION=$(mvn -N -f pom_old.xml help:evaluate -Dexpression=project.version -q -DforceStdout)
rm pom_old.xml

echo "Previous version: $OLD_VERSION"
echo "Current version: $NEW_VERSION"

# Compare versions
if [ "$NEW_VERSION" != "$OLD_VERSION" ]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "version=$NEW_VERSION" >> $GITHUB_OUTPUT
echo "Version change detected! ($OLD_VERSION -> $NEW_VERSION)"
else
echo "changed=false" >> $GITHUB_OUTPUT
echo "Version number did not change. Skipping release."
fi

- name: Build with Maven
if: steps.check_version.outputs.changed == 'true'
run: mvn -B clean install --file pom.xml

- name: Create GitHub Release
if: steps.check_version.outputs.changed == 'true'
uses: softprops/action-gh-release@v1
with:
tag_name: v${{ steps.check_version.outputs.version }}
name: ZonePractice v${{ steps.check_version.outputs.version }}
files: |
distribution/target/*.jar
!distribution/target/original-*.jar
generate_release_notes: true
25 changes: 25 additions & 0 deletions .github/workflows/sync-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Sync Dev with Master

on:
pull_request:
types: [ closed ]
branches: [ "master", "main" ]

jobs:
sync-branch:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true && github.event.pull_request.head.ref == 'dev'

permissions:
contents: write

steps:
- name: Checkout Master/Main
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.base.ref }}
fetch-depth: 0

- name: Force Sync Dev
run: |
git push origin HEAD:dev --force
14 changes: 11 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,16 @@ system before cloning or pulling updates:

## Building

1. Install JDK (Java 17+ recommended for modern builds) and Maven
2. Run: `mvn clean package`
1. **Prerequisites:** Install JDK (Java 17+ recommended for modern builds) and Maven.
2. **Install Local Dependencies:**
Since the PaperSpigot API is not available in public repositories, install it manually from the `libs` folder:
```bash
mvn install:install-file -Dfile=libs/PaperSpigot-1.8.8-R0.1-SNAPSHOT.jar -DgroupId=org.github.paperspigot -DartifactId=paperspigot-api -Dversion=1.8.8-R0.1-SNAPSHOT -Dpackaging=jar -DgeneratePom=true
```
3. **Build the Project:**
```bash
mvn clean package
```

## Installation (Server)

Expand Down Expand Up @@ -140,4 +148,4 @@ Copyright © **ZonePractice contributors**

## Contact

For issues, feature requests or contributions, use the project’s GitHub issue tracker.
For issues, feature requests or contributions, use the project’s GitHub issue tracker.
5 changes: 2 additions & 3 deletions core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>dev.nandi0813</groupId>
<artifactId>practice-parent</artifactId>
<version>6.22-SNAPSHOT</version>
<version>6.22.1-SNAPSHOT</version>
</parent>

<artifactId>practice-core</artifactId>
Expand Down Expand Up @@ -45,8 +45,7 @@
<groupId>org.github.paperspigot</groupId>
<artifactId>paperspigot-api</artifactId>
<version>1.8.8-R0.1-SNAPSHOT</version>
<scope>system</scope>
<systemPath>${basedir}/../libs/PaperSpigot-1.8.8-R0.1-SNAPSHOT.jar</systemPath>
<scope>provided</scope>
</dependency>

<!-- Scoreboard API -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,21 @@ public LMSData() {

@Override
protected void setCustomData() {
kitData.saveData(config, "kit");
if (kitData != null) {
kitData.saveData(config, "kit");
}
}

@Override
protected void getCustomData() {
kitData.getData(config, "kit");
if (kitData != null) {
kitData.getData(config, "kit");
}
}

@Override
protected void enable() throws NullPointerException, IOException {
if (!kitData.isSet()) {
if (kitData != null && !kitData.isSet()) {
throw new IOException("Kit data is not set.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,21 +20,33 @@ public JuggernautData() {

@Override
protected void setCustomData() {
juggernautKitData.saveData(this.config, "juggernaut-kit");
playerKitData.saveData(this.config, "player-kit");
if (juggernautKitData != null) {
juggernautKitData.saveData(this.config, "juggernaut-kit");
}

if (playerKitData != null) {
playerKitData.saveData(this.config, "player-kit");
}
}

@Override
protected void getCustomData() {
juggernautKitData.getData(this.config, "juggernaut-kit");
playerKitData.getData(this.config, "player-kit");
if (juggernautKitData != null) {
juggernautKitData.getData(this.config, "juggernaut-kit");
}

if (playerKitData != null) {
playerKitData.getData(this.config, "player-kit");
}
}

@Override
protected void enable() throws IOException {
if (!juggernautKitData.isSet()) {
if (juggernautKitData == null || !juggernautKitData.isSet()) {
throw new IOException("Juggernaut kit data is not set.");
} else if (!playerKitData.isSet()) {
}

if (playerKitData == null || !playerKitData.isSet()) {
throw new IOException("Player kit data is not set.");
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,6 @@ public void onPlayerMove(PlayerMoveEvent e) {
public void onPacketSend(PacketSendEvent e) {
Player player = e.getPlayer();

if (player == null) {
return;
}

if (!this.checkPlayer(player)) {
effectTo.remove(player);
entityLocations.remove(player.getEntityId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,7 @@
import org.bukkit.potion.PotionEffect;
import org.jetbrains.annotations.Nullable;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.*;

public class CustomLadderEditorGui extends GUI {

Expand Down Expand Up @@ -138,7 +135,7 @@ public void update() {
if (inventory.getItem(i) == null)
inventory.setItem(i, fillerItem);

if (VersionChecker.getBukkitVersion().isSecondHand()) {
if (Objects.requireNonNull(VersionChecker.getBukkitVersion()).isSecondHand()) {
if (customKit.getExtra() != null) {
if (customKit.getExtra().length > 0) {
inventory.setItem(14, customKit.getExtra()[0]);
Expand Down Expand Up @@ -212,7 +209,7 @@ public void handleCloseEvent(InventoryCloseEvent e) {
if (ladder.isEnabled() && ladder.isEditable() && !ladder.isFrozen()) {
ItemStack[] inventoryStorageContent = ClassImport.getClasses().getPlayerUtil().getInventoryStorageContent(player);
customKit.setInventory(inventoryStorageContent);
if (VersionChecker.getBukkitVersion().isSecondHand()) {
if (Objects.requireNonNull(VersionChecker.getBukkitVersion()).isSecondHand()) {
customKit.setExtra(new ItemStack[]{this.gui.get(1).getItem(14)});
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public void loadGUIs() {
{
GUIManager.getInstance().addGUI(new ArenaSummaryGui());

for (DisplayArena arena : ArenaManager.getInstance().getArenaList())
for (DisplayArena arena : ArenaManager.getInstance().getArenaList()) {
buildArenaSetupGUIs(arena);
}
});
}

public void removeArenaGUIs(DisplayArena arena) {
for (GUI gui : arenaSetupGUIs.get(arena).values()) {
for (Player player : gui.getInGuiPlayers().keySet())
for (Player player : gui.getInGuiPlayers().keySet()) {
GUIManager.getInstance().searchGUI(GUIType.Arena_Summary).open(player);

GUIManager.getInstance().getGuis().remove(gui);
}
}

arenaSetupGUIs.remove(arena);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,9 @@ public void loadGUIs() {

public void removeHologramGUIs(Hologram hologram) {
for (GUI gui : hologramSetupGUIs.get(hologram).values()) {
for (Player player : gui.getInGuiPlayers().keySet())
for (Player player : gui.getInGuiPlayers().keySet()) {
GUIManager.getInstance().searchGUI(GUIType.Setup_Hub).open(player);

GUIManager.getInstance().getGuis().remove(gui);
}
}

hologramSetupGUIs.remove(hologram);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@
import org.bukkit.inventory.ItemStack;
import org.bukkit.potion.PotionEffect;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Objects;
import java.util.*;

public class InventoryGui extends GUI {

private static final boolean secondHand = VersionChecker.getBukkitVersion().isSecondHand();
private static final boolean secondHand = Optional.ofNullable(VersionChecker.getBukkitVersion())
.map(VersionChecker.BukkitVersion::isSecondHand)
.orElse(false);

@Getter
private final NormalLadder ladder;
Expand Down
Loading
Loading