From e8ecde5b4eec255ecebae03998c59e76463e1cc9 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Thu, 22 Apr 2021 11:56:20 +0100 Subject: [PATCH 1/3] Updated changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8959df5..4c29fd2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### 0.5.13 +* Added improved support for Velocity, including a ForceEnableProxySupport config option in case any are not detected +* Modern forwarding will be automatically detected. You will no longer need to manually set ForceEnableProxySupport ### 0.5.12 * Added support for Velocity. * Also fixed some issues with entity teleporting. From 7034eee7b29b4334f6d12cfb7c857d75c64c5dcb Mon Sep 17 00:00:00 2001 From: Sekwah Date: Wed, 5 May 2021 02:14:25 +0100 Subject: [PATCH 2/3] Updated jar file naming to match maven standards --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 71aa065..375941e 100644 --- a/build.gradle +++ b/build.gradle @@ -31,7 +31,7 @@ def sha = System.getenv("GITHUB_SHA"); def isDevBranch = !(branch && (branch.startsWith("refs/heads/release/") || branch.startsWith("refs/tags/"))); group = 'com.sekwah.advancedportals' -version = getPluginData("version") + '-snapshot' + (isDevBranch ? '-dev' : '') +version = getPluginData("version") + (isDevBranch ? '-SNAPSHOT' : '') description = "" From 5c1f71276508c97715d133146a852e52c7f729f1 Mon Sep 17 00:00:00 2001 From: Sekwah Date: Sun, 9 May 2021 03:45:31 +0100 Subject: [PATCH 3/3] Added auto detection at modern forwarding --- .github/workflows/gradle.yml | 11 ++++++++-- build.gradle | 6 +++-- .../bukkit/AdvancedPortalsPlugin.java | 22 ++++++++++++++----- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 2f43ac9..74ae1e3 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -3,7 +3,8 @@ name: Build Project on: push: branches: - - 'dev/*' + - '*/*' + - '!release/*' tags: - '*' pull_request: @@ -14,11 +15,17 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - uses: actions/checkout@v2 - name: Set up JDK 1.8 uses: actions/setup-java@v1 with: java-version: 1.8 + - name: Cache Gradle packages + uses: actions/cache@v2 + with: + path: ~/.gradle/caches + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }} + restore-keys: ${{ runner.os }}-gradle - name: Build with Gradle run: ./gradlew build - name: Upload to Discord (If dev branch) diff --git a/build.gradle b/build.gradle index 375941e..416bfbd 100644 --- a/build.gradle +++ b/build.gradle @@ -28,7 +28,7 @@ apply plugin: 'eclipse' def branch = System.getenv("GITHUB_REF"); def sha = System.getenv("GITHUB_SHA"); -def isDevBranch = !(branch && (branch.startsWith("refs/heads/release/") || branch.startsWith("refs/tags/"))); +def isDevBranch = branch == null || (!(branch.startsWith("refs/heads/release/") || branch.startsWith("refs/tags/"))) group = 'com.sekwah.advancedportals' version = getPluginData("version") + (isDevBranch ? '-SNAPSHOT' : '') @@ -65,6 +65,7 @@ repositories { maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" } maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } maven { url "https://nexus.velocitypowered.com/repository/maven-public/" } + maven { url 'https://papermc.io/repo/repository/maven-public/' } } // includeLibs just says to include the library in the final jar @@ -77,6 +78,7 @@ dependencies { annotationProcessor "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT" implementation "io.netty:netty-all:4.0.4.Final" + compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT' //compile fileTree(dir: 'libs', include: ['*.jar']) } @@ -129,7 +131,7 @@ curseforge { // TODO add code to reference this but also cut the latest change logs in for the files changelog = "${project.github}/blob/${sha}/CHANGELOG.md" changelogType = 'markdown' - releaseType = 'beta' + releaseType = 'release' addGameVersion '1.16' addGameVersion '1.15' addGameVersion '1.14' diff --git a/src/main/java/com/sekwah/advancedportals/bukkit/AdvancedPortalsPlugin.java b/src/main/java/com/sekwah/advancedportals/bukkit/AdvancedPortalsPlugin.java index e5b0e62..d419106 100644 --- a/src/main/java/com/sekwah/advancedportals/bukkit/AdvancedPortalsPlugin.java +++ b/src/main/java/com/sekwah/advancedportals/bukkit/AdvancedPortalsPlugin.java @@ -135,15 +135,27 @@ public class AdvancedPortalsPlugin extends JavaPlugin { try { ConfigurationSection configSelection = getServer().spigot().getConfig().getConfigurationSection("settings"); - if (configSelection == null || !configSelection.getBoolean("bungeecord") ) { - getLogger().warning( "Advanced bungee features disabled for Advanced Portals as bungee isn't enabled on the server (spigot.yml)" ); - return false; + if (configSelection != null && configSelection.getBoolean("bungeecord") ) { + getLogger().info( "Bungee detected. Enabling proxy features." ); + return true; } } catch(NullPointerException e) { - return false; } - return true; + // Will be valid if paperspigot is being used. Otherwise catch. + try { + ConfigurationSection configSelection = getServer().spigot().getPaperConfig().getConfigurationSection("settings"); + ConfigurationSection velocity = configSelection != null ? configSelection.getConfigurationSection("velocity-support") : null; + if (velocity != null && velocity.getBoolean("enabled") ) { + getLogger().info( "Modern forwarding detected. Enabling proxy features." ); + return true; + } + } catch(NullPointerException e) { + } + + getLogger().warning( "Proxy features disabled for Advanced Portals as bungee isn't enabled on the server (spigot.yml) " + + "or if you are using Paper settings.velocity-support.enabled may not be enabled (paper.yml)" ); + return false; }