Merge pull request #243 from sekwah41/dev/spigot-1.13-1.16
Add force enable features and proper velocity support
This commit is contained in:
commit
0ad693db0c
|
@ -3,7 +3,8 @@ name: Build Project
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- 'dev/*'
|
- '*/*'
|
||||||
|
- '!release/*'
|
||||||
tags:
|
tags:
|
||||||
- '*'
|
- '*'
|
||||||
pull_request:
|
pull_request:
|
||||||
|
@ -14,11 +15,17 @@ jobs:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v1
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 1.8
|
- name: Set up JDK 1.8
|
||||||
uses: actions/setup-java@v1
|
uses: actions/setup-java@v1
|
||||||
with:
|
with:
|
||||||
java-version: 1.8
|
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
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: Upload to Discord (If dev branch)
|
- name: Upload to Discord (If dev branch)
|
||||||
|
|
|
@ -1,3 +1,7 @@
|
||||||
|
### 0.5.13
|
||||||
|
* Added improved support for Velocity (You can now add it directly to Velocity as a plugin)
|
||||||
|
* Added 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
|
### 0.5.12
|
||||||
* Added support for Velocity.
|
* Added support for Velocity.
|
||||||
* Also fixed some issues with entity teleporting.
|
* Also fixed some issues with entity teleporting.
|
||||||
|
|
12
build.gradle
12
build.gradle
|
@ -26,12 +26,12 @@ apply plugin: 'maven-publish'
|
||||||
apply plugin: 'idea'
|
apply plugin: 'idea'
|
||||||
apply plugin: 'eclipse'
|
apply plugin: 'eclipse'
|
||||||
|
|
||||||
group = 'com.sekwah.advancedportals'
|
|
||||||
version = getPluginData("version") + '-snapshot'
|
|
||||||
|
|
||||||
def branch = System.getenv("GITHUB_REF");
|
def branch = System.getenv("GITHUB_REF");
|
||||||
def sha = System.getenv("GITHUB_SHA");
|
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' : '')
|
||||||
|
|
||||||
description = ""
|
description = ""
|
||||||
|
|
||||||
|
@ -65,6 +65,7 @@ repositories {
|
||||||
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
|
maven { url "https://hub.spigotmc.org/nexus/content/repositories/snapshots/" }
|
||||||
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
|
||||||
maven { url "https://nexus.velocitypowered.com/repository/maven-public/" }
|
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
|
// 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"
|
annotationProcessor "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT"
|
||||||
|
|
||||||
implementation "io.netty:netty-all:4.0.4.Final"
|
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'])
|
//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
|
// TODO add code to reference this but also cut the latest change logs in for the files
|
||||||
changelog = "${project.github}/blob/${sha}/CHANGELOG.md"
|
changelog = "${project.github}/blob/${sha}/CHANGELOG.md"
|
||||||
changelogType = 'markdown'
|
changelogType = 'markdown'
|
||||||
releaseType = 'beta'
|
releaseType = 'release'
|
||||||
addGameVersion '1.16'
|
addGameVersion '1.16'
|
||||||
addGameVersion '1.15'
|
addGameVersion '1.15'
|
||||||
addGameVersion '1.14'
|
addGameVersion '1.14'
|
||||||
|
|
|
@ -135,15 +135,27 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ConfigurationSection configSelection = getServer().spigot().getConfig().getConfigurationSection("settings");
|
ConfigurationSection configSelection = getServer().spigot().getConfig().getConfigurationSection("settings");
|
||||||
if (configSelection == null || !configSelection.getBoolean("bungeecord") ) {
|
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)" );
|
getLogger().info( "Bungee detected. Enabling proxy features." );
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
} catch(NullPointerException e) {
|
} 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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||||
import com.velocitypowered.api.plugin.Plugin;
|
import com.velocitypowered.api.plugin.Plugin;
|
||||||
import com.velocitypowered.api.proxy.ProxyServer;
|
import com.velocitypowered.api.proxy.ProxyServer;
|
||||||
import com.velocitypowered.api.proxy.ServerConnection;
|
import com.velocitypowered.api.proxy.ServerConnection;
|
||||||
|
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||||
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
|
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
||||||
|
@ -104,6 +105,8 @@ public class AdvancedPortalsPlugin {
|
||||||
out.writeUTF(val[1]);
|
out.writeUTF(val[1]);
|
||||||
out.writeUTF(val[2]);
|
out.writeUTF(val[2]);
|
||||||
|
|
||||||
|
serverConnection.sendPluginMessage(AP_CHANNEL, out.toByteArray());
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue