Compare commits
9 Commits
70fbcf913b
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ee1bf25731 | ||
|
|
37a01e1ca4 | ||
|
|
bb558bab48 | ||
|
|
39c516f5dd | ||
|
|
2d7c942c32 | ||
|
|
2906ae06e7 | ||
|
|
e850574324 | ||
|
|
ac8d1dd952 | ||
|
|
b56229a5b9 |
@@ -1,32 +0,0 @@
|
||||
name: Kotlin Maven Build
|
||||
|
||||
on: [push, pull_request]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '21'
|
||||
distribution: 'temurin'
|
||||
|
||||
- name: Cache Maven packages
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.m2/repository
|
||||
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
|
||||
restore-keys: ${{ runner.os }}-m2-
|
||||
|
||||
- name: Build with Maven
|
||||
run: mvn -B clean package --file pom.xml
|
||||
|
||||
- name: Upload Artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: motd-plugin
|
||||
path: target/*.jar
|
||||
55
.gitea/workflows/maven_build.yaml
Normal file
55
.gitea/workflows/maven_build.yaml
Normal file
@@ -0,0 +1,55 @@
|
||||
name: Maven Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ main, master, dev ]
|
||||
pull_request:
|
||||
branches: [ main, master ]
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up JDK 21
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
distribution: 'temurin'
|
||||
java-version: '21'
|
||||
cache: 'maven'
|
||||
|
||||
- name: Install Maven
|
||||
run: |
|
||||
if ! command -v mvn &> /dev/null; then
|
||||
echo "Maven not found, installing..."
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y maven
|
||||
fi
|
||||
mvn --version
|
||||
|
||||
- name: Debug Info
|
||||
run: |
|
||||
echo "Current workspace directory: $GITHUB_WORKSPACE"
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Project structure:"
|
||||
find . -type f -name "*.kt" | sort
|
||||
find . -type f -name "pom.xml"
|
||||
echo "Maven version: $(mvn --version)"
|
||||
|
||||
- name: Build MOTD (MOTD)
|
||||
run: |
|
||||
echo "Building MOTD"
|
||||
echo "Current directory: $(pwd)"
|
||||
# Run Maven build directly using the POM file path
|
||||
mvn -B clean package -f "$GITHUB_WORKSPACE/pom.xml" -Dmaven.compiler.failOnError=true
|
||||
|
||||
- name: Upload MOTD artifact
|
||||
uses: actions/upload-artifact@v3
|
||||
with:
|
||||
name: MOTD
|
||||
path: target/MOTD-*.jar
|
||||
if-no-files-found: error
|
||||
10
build.sh
Executable file
10
build.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/bash
|
||||
# Direct build script for Maven project
|
||||
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Building project with Maven..."
|
||||
|
||||
# Run Maven build using the exact pom.xml location
|
||||
mvn clean package -f "$(pwd)/pom.xml"
|
||||
|
||||
echo "Build complete. JAR file should be in target/ directory."
|
||||
46
debug_build.sh
Executable file
46
debug_build.sh
Executable file
@@ -0,0 +1,46 @@
|
||||
#!/bin/bash
|
||||
# Debug script for build issues
|
||||
|
||||
echo "=== Environment Information ==="
|
||||
echo "Current directory: $(pwd)"
|
||||
echo "Java version:"
|
||||
java -version
|
||||
echo ""
|
||||
echo "Maven version:"
|
||||
mvn --version
|
||||
echo ""
|
||||
|
||||
echo "=== Project structure ==="
|
||||
find . -type f -name "*.kt" | sort
|
||||
find . -type f -name "pom.xml"
|
||||
echo ""
|
||||
|
||||
|
||||
echo "=== Debugging build for MOTD ==="
|
||||
echo "Changing to directory: "
|
||||
cd
|
||||
echo "Current directory: $(pwd)"
|
||||
|
||||
echo "Checking for POM file:"
|
||||
ls -la pom.xml
|
||||
|
||||
echo "Checking Kotlin source files:"
|
||||
find . -type f -name "*.kt" | sort
|
||||
|
||||
echo "Compiling Kotlin sources:"
|
||||
mvn compile
|
||||
|
||||
echo "Checking for MOTDGuiHandler class:"
|
||||
find . -type f -name "MOTDGuiHandler.kt"
|
||||
grep -r "MOTDGuiHandler" --include="*.kt" .
|
||||
echo ""
|
||||
|
||||
echo "Checking package structure:"
|
||||
find ./src -type d | sort
|
||||
echo ""
|
||||
|
||||
echo "Checking import statements in MOTDCommand.kt:"
|
||||
grep -r "import" --include="MOTDCommand.kt" .
|
||||
echo ""
|
||||
|
||||
cd ..
|
||||
@@ -166,6 +166,14 @@ class MOTD : JavaPlugin() {
|
||||
}
|
||||
|
||||
// Update the server MOTD with the next quote
|
||||
|
||||
/*
|
||||
Asshole piece of crap function that doesnt work very well
|
||||
Fuck this fucking piece of crap
|
||||
|
||||
rattatwinko - 16.5.2025 10:21:37
|
||||
*/
|
||||
|
||||
fun updateServerMOTD() {
|
||||
if (quotes.isEmpty()) {
|
||||
logger.warning("No quotes available for MOTD")
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package org.server_info.MOTD
|
||||
|
||||
import MOTDGuiHandler
|
||||
import org.bukkit.ChatColor
|
||||
import org.bukkit.command.Command
|
||||
import org.bukkit.command.CommandExecutor
|
||||
|
||||
@@ -12,6 +12,7 @@ import java.util.*
|
||||
import org.bukkit.conversations.*
|
||||
import org.bukkit.entity.Player
|
||||
|
||||
@Suppress("DEPRECATION")
|
||||
class MOTDGuiHandler(private val plugin: MOTD) : Listener {
|
||||
|
||||
private val editingSessions = HashMap<UUID, EditSession>()
|
||||
|
||||
@@ -3,7 +3,7 @@ version: 1.0-SNAPSHOT
|
||||
main: org.server_info.MOTD.MOTD
|
||||
api-version: 1.19
|
||||
description: Sets the server MOTD to random quotes from config with GUI management
|
||||
author: YourName
|
||||
author: rattatwinko
|
||||
commands:
|
||||
motd:
|
||||
description: Control the MOTD quote plugin
|
||||
|
||||
Reference in New Issue
Block a user