From b235dcdf5d0ea976e23baa4970a70d11ec6df17d Mon Sep 17 00:00:00 2001 From: FlorianMichael <60033407+FlorianMichael@users.noreply.github.com> Date: Mon, 29 Apr 2024 16:40:56 +0200 Subject: [PATCH] Add code --- .github/workflows/build.yml | 28 +++++ .gitignore | 113 ++++++++++++++++++ pom.xml | 62 ++++++++++ .../viaerrorhandler/ViaErrorHandler.java | 13 ++ src/main/resources/plugin.yml | 9 ++ 5 files changed, 225 insertions(+) create mode 100644 .github/workflows/build.yml create mode 100644 .gitignore create mode 100644 pom.xml create mode 100644 src/main/java/de/florianmichael/viaerrorhandler/ViaErrorHandler.java create mode 100644 src/main/resources/plugin.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..b6c6e9a --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,28 @@ +# Automatically build the project and run any configured tests for every push +# and submitted pull request. This can help catch issues that only occur on +# certain platforms or Java versions, and provides a first line of defence +# against bad commits. + +name: ViaErrorHandler CI + +on: [pull_request, push, workflow_dispatch] + +jobs: + build: + runs-on: ubuntu-22.04 + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: Set up JDK 21 + uses: actions/setup-java@v4 + with: + distribution: 'temurin' + java-version: 21 + check-latest: true + - name: Build with Maven + run: mvn install + - name: Upload Artifacts to GitHub + uses: actions/upload-artifact@v4 + with: + name: Artifacts + path: target \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8b354ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,113 @@ +### Java files ### +*.class + +# Package Files +#*.jar +*.war +*.ear + +# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml +hs_err_pid* + + + +### Intellij ### +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm +# Ignore project files +*.iml + +# Ignore IDEA directory +.idea/* + +# Include the project's dictionary +!.idea/dictionaries/ +!.idea/dictionaries/* + +# File-based project format: +*.ipr +*.iws + +### Plugin-specific files: ### +# IntelliJ +/out/ + +# mpeltonen/sbt-idea plugin +.idea_modules/ + +# JIRA plugin +atlassian-ide-plugin.xml + +# Crashlytics plugin (for Android Studio and IntelliJ) +com_crashlytics_export_strings.xml +crashlytics.properties +crashlytics-build.properties + + + +### Eclipse ### +*.pydevproject +.metadata +.gradle +bin/ +tmp/ +*.tmp +*.bak +*.swp +*~.nib +local.properties +.settings/ +.loadpath + +# Eclipse Core +.project + +# External tool builders +.externalToolBuilders/ + +# Locally stored "Eclipse launch configurations" +*.launch + +# CDT-specific +.cproject + +# JDT-specific (Eclipse Java Development Tools) +.classpath + +# PDT-specific +.buildpath + +# sbteclipse plugin +.target + +# TeXlipse plugin +.texlipse + + + +### Maven ### +target/ +pom.xml.tag +pom.xml.releaseBackup +pom.xml.versionsBackup +pom.xml.next +release.properties +dependency-reduced-pom.xml +buildNumber.properties + + + +### NetBeans ### +nbproject/private/ +build/ +nbbuild/ +dist/ +nbdist/ +nbactions.xml +nb-configuration.xml +.nb-gradle/ + + + +### Git ### +# Don't exclude the .gitignore itself +!/.gitignore diff --git a/pom.xml b/pom.xml new file mode 100644 index 0000000..28f4af6 --- /dev/null +++ b/pom.xml @@ -0,0 +1,62 @@ + + + 4.0.0 + + de.florianmichael + ViaErrorHandler + 1.0.0 + jar + + + + UTF-8 + ${projectEncoding} + ${projectEncoding} + 1.8 + 1.8 + + + + + viaversion-repo + https://repo.viaversion.com + + + spigot-repo + https://hub.spigotmc.org/nexus/content/repositories/snapshots/ + + + + + + + com.viaversion + viaversion-api + 4.6.2 + provided + + + + + org.spigotmc + spigot-api + 1.16.5-R0.1-SNAPSHOT + provided + + + + + + + . + true + src/main/resources/ + + * + + + + + \ No newline at end of file diff --git a/src/main/java/de/florianmichael/viaerrorhandler/ViaErrorHandler.java b/src/main/java/de/florianmichael/viaerrorhandler/ViaErrorHandler.java new file mode 100644 index 0000000..483c1d0 --- /dev/null +++ b/src/main/java/de/florianmichael/viaerrorhandler/ViaErrorHandler.java @@ -0,0 +1,13 @@ +package de.florianmichael.viaerrorhandler; + +import org.bukkit.plugin.java.JavaPlugin; + +public class ViaErrorHandler extends JavaPlugin { + + @Override + public void onLoad() { + System.setProperty("viaversion.strict-error-handling1_20_5", "false"); + getLogger().info("ViaVersion strict error handling disabled for 1.20.5 players!"); + } + +} diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml new file mode 100644 index 0000000..5b64a1d --- /dev/null +++ b/src/main/resources/plugin.yml @@ -0,0 +1,9 @@ +name: ViaErrorHandler +version: ${project.version} +main: de.florianmichael.viaerrorhandler.ViaErrorHandler +api-version: 1.13 + +authors: [FlorianMichael/EnZaXD] +website: https://github.com/FlorianMichael + +loadbefore: [ViaVersion] \ No newline at end of file