mirror of
https://github.com/sekwah41/Advanced-Portals.git
synced 2024-12-26 10:58:03 +01:00
Merge pull request #250 from sekwah41/dev/spigot-1.13-1.16
Release v1.16.0
This commit is contained in:
commit
100b825765
11
.github/workflows/gradle.yml
vendored
11
.github/workflows/gradle.yml
vendored
@ -3,8 +3,7 @@ name: Build Project
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- '*/*'
|
||||
- '!release/*'
|
||||
- '**'
|
||||
tags:
|
||||
- '*'
|
||||
pull_request:
|
||||
@ -28,13 +27,13 @@ jobs:
|
||||
restore-keys: ${{ runner.os }}-gradle
|
||||
- name: Build with Gradle
|
||||
run: ./gradlew build
|
||||
- name: Upload to Discord (If dev branch)
|
||||
if: startsWith(github.ref, 'refs/heads/dev/')
|
||||
- name: Upload to Discord (If pre-release tag)
|
||||
if: "startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')"
|
||||
env:
|
||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||
run: ./gradlew discordupload
|
||||
- name: Publish to Curseforge (If tagged)
|
||||
if: startsWith(github.ref, 'refs/tags/')
|
||||
- name: Publish to Curseforge (If release tag)
|
||||
if: "startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')"
|
||||
env:
|
||||
CURSE_API: ${{ secrets.CURSE_API }}
|
||||
run: ./gradlew curseforge
|
||||
|
51
.versionrc.js
Normal file
51
.versionrc.js
Normal file
@ -0,0 +1,51 @@
|
||||
let versionRegex = /(\nversion:\s)([0-9.-]+)/;
|
||||
let velocityVersionRegex = /(\sversion\s=\s")([0-9.-]+)("\))/;
|
||||
|
||||
|
||||
const ymlUpdater = {
|
||||
updater: {
|
||||
'readVersion': (contents) => {
|
||||
return versionRegex.exec(contents)[2];
|
||||
},
|
||||
'writeVersion': (contents, version) => {
|
||||
return contents.replace(versionRegex, `$1${version}`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const bungee = {
|
||||
filename: 'src/main/resources/bungee.yml',
|
||||
...ymlUpdater,
|
||||
}
|
||||
|
||||
const plugin = {
|
||||
filename: 'src/main/resources/plugin.yml',
|
||||
...ymlUpdater,
|
||||
}
|
||||
|
||||
const velocity_plugin = {
|
||||
filename: 'src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java',
|
||||
updater: {
|
||||
'readVersion': (contents) => {
|
||||
return velocityVersionRegex.exec(contents)[2];
|
||||
},
|
||||
'writeVersion': (contents, version) => {
|
||||
return contents.replace(velocityVersionRegex, `$1${version}$3`);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const files = [plugin, velocity_plugin, bungee];
|
||||
|
||||
module.exports = {
|
||||
bumpFiles: files,
|
||||
packageFiles: files,
|
||||
// In case you need to force a version change (mostly due to change of scope of the update e.g. major now instead of patch)
|
||||
//releaseAs: '0.16.0',
|
||||
header:"# Changelog\n" +
|
||||
"\n" +
|
||||
"All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.\n" +
|
||||
"\n" +
|
||||
"For the release changelogs see [CHANGELOG.md](CHANGELOG.md) \n" +
|
||||
"For the snapshot changelogs see [SNAPSHOT_CHANGELOG.md](SNAPSHOT_CHANGELOG.md)\n",
|
||||
}
|
46
CHANGELOG.md
46
CHANGELOG.md
@ -1,46 +0,0 @@
|
||||
### 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
|
||||
* Added support for Velocity.
|
||||
* Also fixed some issues with entity teleporting.
|
||||
### 0.5.11
|
||||
* Missing changelogs
|
||||
### 0.5.10
|
||||
* Missing changelogs
|
||||
### 0.5.10
|
||||
* Added fix for command portals spam triggering if they didn't teleport you out.
|
||||
* Made portals not activate if you were teleported into them by another portal (to allow linking zones like a star trek warp pad)
|
||||
### 0.5.9
|
||||
* Missing changelogs
|
||||
### 0.5.8
|
||||
* Missing changelogs
|
||||
### 0.5.7
|
||||
* Extra checks added by @tmantti to fix slow connections to new servers from activating the destination location too quick.
|
||||
### 0.5.6
|
||||
* Fixed packet exploit affecting destinations (only effecting versions 0.5.0 to 0.5.5).
|
||||
### 0.5.5
|
||||
* Added support for 1.16
|
||||
* Reworked chat menus to better use Spigot API
|
||||
* Changed edit menu to have Activate instead of Teleport to destination
|
||||
* Compat code changed. You must now use Spigot rather than CraftBukkit.
|
||||
### 0.5.4
|
||||
* Added bungee backup methods to ensure bungee and desti work correctly together
|
||||
* Fixed protection region issue
|
||||
* Reworked the warp command and fixed the surrounding permissions
|
||||
* Disabling gateway beams is now enabled for placing the blocks as well as by a few other means
|
||||
### 0.5.3
|
||||
* Fixed destination bug.
|
||||
### 0.5.2
|
||||
* Fixed issue with bungee destinations.
|
||||
### 0.5.1
|
||||
* Fixed warp permission info
|
||||
### 0.5.0
|
||||
* Added command:
|
||||
* Fix for bungee warps
|
||||
### 0.4.0
|
||||
* Individual portal cooldown added
|
||||
* Bungee improvements
|
||||
### Earlier
|
||||
* See github releases and spigot pages for more info.
|
45
README.md
45
README.md
@ -12,12 +12,9 @@ Advanced Portals ![GitHub Workflow Status](https://img.shields.io/github/workflo
|
||||
==============
|
||||
An advanced portals plugin for bukkit made by sekwah41 designed to have a wide range of features which are easy to use. It adds a bunch of commands to create and edit portals and destinations. This plugin not only enable normal teleportation but also cross server teleportation for networks using bungee.
|
||||
|
||||
# Branch Layout
|
||||
* [master](https://github.com/sekwah41/Advanced-Portals/) (Release Build)
|
||||
* [dev](https://github.com/sekwah41/Advanced-Portals/tree/dev) (Dev Build)
|
||||
* [recode](https://github.com/sekwah41/Advanced-Portals/tree/recode) (Recode)
|
||||
|
||||
Once the recode is done the master branch will be releases and the dev branch will be where work is done.
|
||||
# Recode
|
||||
We are currently slowly working on a complete re-code of the plugin with a full API.
|
||||
For now maintaining the current 1.13+ spigot versions is our main priority.
|
||||
|
||||
# Help
|
||||
[Command Documentation & Guides](https://www.guilded.gg/Sekwah/groups/MDqAZyrD/channels/72ffdaa3-9273-4722-bf47-b75408b371af/docs/1807463914)
|
||||
@ -31,17 +28,33 @@ Once the recode is done the master branch will be releases and the dev branch wi
|
||||
# Usage Data
|
||||
Usage stats can be found here https://bstats.org/plugin/bukkit/AdvancedPortals
|
||||
|
||||
# Velocity Support
|
||||
We add basic Velocity support though it isn't really a priority.
|
||||
|
||||
By default, the bungee: tag works without there being a plugin on velocity however for desti: to work
|
||||
for now ensure that on spigot you have the bungeecord setting enabled to register the necessary packet channels.
|
||||
|
||||
We will look into adding better support for proxies (Especially Velocity as it looks better)
|
||||
|
||||
# API
|
||||
|
||||
The api isn't implemented in this version, sorry for any inconvenience. Check the recode tree for possibly a working recode at some point.
|
||||
|
||||
# Contribution
|
||||
If you are going to change any of the reflection make sure you test it against the suggested supported versions at the moment e.g. 1.13 as well as 1.14 otherwise most will be accepted from just reviewing the code unless it changes something drastic which would effect other functionality in a bad way.
|
||||
# Contributing
|
||||
Please ensure that your commits are in the following style for PR's
|
||||
|
||||
https://www.conventionalcommits.org/en/v1.0.0/
|
||||
|
||||
Accepted tags mostly follow the Angular style and are meant to only loosely be followed.
|
||||
When commits close an issue refer in the commit description in the following style (Refs #1, #2, #3)
|
||||
## Types available
|
||||
* **build**: Changes that affect the build system or external dependencies
|
||||
* **ci**: Changes to our CI configuration files and scripts
|
||||
* **docs**: Documentation only changes
|
||||
* **feat**: A new feature
|
||||
* **fix**: A bug fix
|
||||
* **perf**: A code change that improves performance
|
||||
* **refactor**: A code change that neither fixes a bug nor adds a feature
|
||||
* **style**: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
|
||||
<!---
|
||||
We don't currently do tests. But in case.
|
||||
* **test**: Adding missing tests or correcting existing tests
|
||||
-->
|
||||
|
||||
## Scopes available
|
||||
Scopes are only needed if relating to specific features just to make them easier to find.
|
||||
_I'll expand the list as I work more on the project._
|
||||
* **proxy** (Proxy specific features and issues)
|
||||
|
||||
|
223
build.gradle
223
build.gradle
@ -1,34 +1,41 @@
|
||||
import org.apache.commons.codec.Charsets
|
||||
import org.apache.http.HttpEntity
|
||||
import org.apache.http.HttpResponse
|
||||
import org.apache.http.client.HttpClient
|
||||
import org.apache.http.client.config.CookieSpecs
|
||||
import org.apache.http.client.config.RequestConfig
|
||||
import org.apache.http.client.methods.CloseableHttpResponse
|
||||
import org.apache.http.client.methods.HttpPost
|
||||
import org.apache.http.entity.ContentType
|
||||
import org.apache.http.entity.mime.MultipartEntityBuilder
|
||||
import org.apache.http.impl.client.CloseableHttpClient
|
||||
import org.apache.http.impl.client.HttpClientBuilder
|
||||
import org.apache.http.impl.client.HttpClients
|
||||
import org.apache.http.client.methods.HttpGet
|
||||
import com.google.gson.Gson
|
||||
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'idea'
|
||||
|
||||
buildscript {
|
||||
repositories {
|
||||
maven {url "https://plugins.gradle.org/m2/"}
|
||||
mavenCentral()
|
||||
mavenLocal()
|
||||
jcenter()
|
||||
}
|
||||
dependencies {
|
||||
classpath "org.apache.httpcomponents:httpmime:4.5.13"
|
||||
classpath "com.google.code.gson:gson:2.8.6"
|
||||
classpath "org.apache.httpcomponents:httpclient:4.5.13"
|
||||
}
|
||||
}
|
||||
|
||||
plugins {
|
||||
id "com.matthewprenger.cursegradle" version "1.4.0"
|
||||
}
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'maven-publish'
|
||||
apply plugin: 'idea'
|
||||
apply plugin: 'eclipse'
|
||||
|
||||
def branch = System.getenv("GITHUB_REF");
|
||||
def sha = System.getenv("GITHUB_SHA");
|
||||
def isDevBranch = branch == null || (!(branch.startsWith("refs/heads/release/") || branch.startsWith("refs/tags/")))
|
||||
def isDevBranch = branch == null || !(branch.startsWith("refs/tags/") && !branch.contains("-"))
|
||||
|
||||
group = 'com.sekwah.advancedportals'
|
||||
version = getPluginData("version") + (isDevBranch ? '-SNAPSHOT' : '')
|
||||
@ -70,6 +77,7 @@ repositories {
|
||||
|
||||
// includeLibs just says to include the library in the final jar
|
||||
dependencies {
|
||||
|
||||
//implementation "org.bukkit:bukkit:1.16.1-R0.1-SNAPSHOT"
|
||||
implementation "org.spigotmc:spigot-api:1.16.1-R0.1-SNAPSHOT"
|
||||
implementation "net.md-5:bungeecord-api:1.15-SNAPSHOT"
|
||||
@ -101,7 +109,7 @@ task discordupload {
|
||||
|
||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create()
|
||||
builder.addTextBody("content", "New automated dev build\n\n" +
|
||||
"Current Features: <${project.github}/blob/${sha}/CHANGELOG.md>")
|
||||
"Current Features: <${project.github}/blob/${sha}/docs/CHANGELOG.md>")
|
||||
|
||||
builder.addBinaryBody("file", file(jar.archiveFile).newInputStream(), ContentType.APPLICATION_OCTET_STREAM, jar.archiveName)
|
||||
|
||||
@ -119,31 +127,154 @@ task discordupload {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.curseforge.enabled = System.getenv("CURSE_API") != null
|
||||
|
||||
curseforge {
|
||||
logger.info("Curse api: " + System.getenv("CURSE_API"))
|
||||
if (System.getenv("CURSE_API") != null) {
|
||||
apiKey = System.getenv("CURSE_API")
|
||||
}
|
||||
project {
|
||||
id = project.curse_project_id
|
||||
// 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 = 'release'
|
||||
addGameVersion '1.16'
|
||||
addGameVersion '1.15'
|
||||
addGameVersion '1.14'
|
||||
addGameVersion '1.13'
|
||||
String getValueFromCurseAPI(apiKey, endpoint) {
|
||||
String API_BASE_URL = 'https://minecraft.curseforge.com'
|
||||
|
||||
mainArtifact(jar){
|
||||
Gson gson = new Gson()
|
||||
|
||||
HttpClient client = HttpClientBuilder.create()
|
||||
.setDefaultRequestConfig(RequestConfig.custom()
|
||||
.setCookieSpec(CookieSpecs.IGNORE_COOKIES).build()).build()
|
||||
|
||||
HttpGet get = new HttpGet(API_BASE_URL + endpoint)
|
||||
get.setHeader('X-Api-Token', apiKey)
|
||||
|
||||
HttpResponse response = client.execute(get)
|
||||
|
||||
int statusCode = response.statusLine.statusCode
|
||||
|
||||
if (statusCode == 200) {
|
||||
byte[] data = response.entity.content.bytes
|
||||
return new String(data, Charsets.UTF_8)
|
||||
} else {
|
||||
if (response.getFirstHeader('content-type').value.contains('json')) {
|
||||
InputStreamReader reader = new InputStreamReader(response.entity.content)
|
||||
reader.close()
|
||||
throw new RuntimeException("[CurseForge] Error")
|
||||
} else {
|
||||
throw new RuntimeException("[CurseForge] HTTP Error Code $response.statusLine.statusCode: $response.statusLine.reasonPhrase")
|
||||
}
|
||||
//addArtifact sourcesJar
|
||||
//addArtifact deobfJar
|
||||
//addArtifact javadocJar
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
/**
|
||||
* Upload a single file (in case you also want to upload the other files like source n stuff)
|
||||
* @param json
|
||||
* @param file
|
||||
* @return
|
||||
* @throws IOException
|
||||
* @throws URISyntaxException
|
||||
*/
|
||||
UploadResponse uploadFile(Metadata metadata, File file, String apiKey, Gson gson) throws IOException, URISyntaxException {
|
||||
String API_BASE_URL = 'https://minecraft.curseforge.com'
|
||||
String UPLOAD_URL = "/api/projects/%s/upload-file"
|
||||
// Upload
|
||||
// Important info
|
||||
String uploadUrl = String.format(API_BASE_URL + UPLOAD_URL, project.curse_project_id)
|
||||
|
||||
HttpClient client = HttpClientBuilder.create()
|
||||
.setDefaultRequestConfig(RequestConfig.custom()
|
||||
.setCookieSpec(CookieSpecs.IGNORE_COOKIES).build()).build()
|
||||
|
||||
HttpPost post = new HttpPost(uploadUrl)
|
||||
post.setHeader('X-Api-Token', apiKey)
|
||||
|
||||
|
||||
// https://support.curseforge.com/en/support/solutions/articles/9000197321-curseforge-api
|
||||
post.setEntity(MultipartEntityBuilder.create()
|
||||
.addTextBody('metadata', gson.toJson(metadata), ContentType.APPLICATION_JSON)
|
||||
.addBinaryBody('file', file)
|
||||
.build())
|
||||
|
||||
HttpResponse response = client.execute(post)
|
||||
InputStreamReader reader = new InputStreamReader(response.entity.content)
|
||||
UploadResponse uploadResponse = gson.fromJson(reader, UploadResponse)
|
||||
reader.close()
|
||||
return uploadResponse
|
||||
}
|
||||
|
||||
class GameVersion {
|
||||
int id
|
||||
int gameVersionTypeID
|
||||
String name
|
||||
String slug
|
||||
}
|
||||
|
||||
/**
|
||||
* As described here https://support.curseforge.com/en/support/solutions/articles/9000197321-curseforge-api
|
||||
*/
|
||||
class Metadata {
|
||||
String changelog
|
||||
String changelogType
|
||||
int[] gameVersions
|
||||
String releaseType
|
||||
}
|
||||
|
||||
class UploadResponse {
|
||||
int id;
|
||||
}
|
||||
|
||||
|
||||
// Based on https://github.com/matthewprenger/CurseGradle as it didnt support Bukkit uploads at the time.
|
||||
task curseforge {
|
||||
dependsOn(jar)
|
||||
doLast {
|
||||
String apiKey = null
|
||||
|
||||
if (System.getenv("CURSE_API") != null) {
|
||||
apiKey = System.getenv("CURSE_API")
|
||||
}
|
||||
|
||||
if(apiKey != null) {
|
||||
|
||||
Gson gson = new Gson()
|
||||
|
||||
//String VERSION_TYPES_URL = "/api/game/version-types"
|
||||
int gameVersionTypeID = 1
|
||||
String VERSION_URL = "/api/game/versions"
|
||||
println("Uploading to CurseForge")
|
||||
|
||||
// Get game versions
|
||||
String gameVersionsString = getValueFromCurseAPI(apiKey, VERSION_URL)
|
||||
GameVersion[] gameVersions = gson.fromJson(gameVersionsString, GameVersion[].class)
|
||||
def versions = gameVersions.findAll {it.gameVersionTypeID == gameVersionTypeID}
|
||||
|
||||
String[] supportedVersions = [
|
||||
"1.16",
|
||||
"1.15",
|
||||
"1.14",
|
||||
"1.13"
|
||||
]
|
||||
|
||||
def supportedGameVersions = versions.findAll {supportedVersions.contains(it.name)}
|
||||
int[] supportedGameVersionIds = supportedGameVersions.collect {it.id}.toArray()
|
||||
|
||||
println("Supported Version Id's ${supportedGameVersionIds}")
|
||||
|
||||
Metadata uploadMetadata = new Metadata();
|
||||
|
||||
uploadMetadata.changelog = "${project.github}/blob/${sha}/CHANGELOG.md"
|
||||
uploadMetadata.changelogType = "markdown"
|
||||
uploadMetadata.releaseType = isDevBranch ? "beta" : "release"
|
||||
uploadMetadata.gameVersions = supportedGameVersionIds
|
||||
|
||||
def uploadId = uploadFile(uploadMetadata, file(jar.archiveFile), apiKey, gson)
|
||||
|
||||
println("Uploaded with ID: ${uploadId.id}")
|
||||
|
||||
println("Published build")
|
||||
|
||||
} else {
|
||||
println("Discord webhook unspecified")
|
||||
}
|
||||
}
|
||||
// id = project.curse_project_id
|
||||
// // 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 = 'release'
|
||||
}
|
||||
|
||||
task copyPlugin {
|
||||
@ -183,3 +314,33 @@ task runJar() {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* These are needed as standard-version doesnt allow for the ability to skip tag versions for the changelog.
|
||||
* Well it does but not on purpose and it breaks things.
|
||||
*
|
||||
* Tagging is skipped so that the release can be merged and confirmed (A little long winded but just to stop mistakes)
|
||||
*/
|
||||
task updateChangelog {
|
||||
doLast{
|
||||
exec {
|
||||
commandLine 'cmd', '/c', 'npx standard-version@9.3.0 -i docs/CHANGELOG.md -t (v)[0-9]+.[0-0]+.[0-0]+(?!-) --skip.tag'
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
}
|
||||
exec {
|
||||
commandLine 'cmd', '/c', 'npx standard-version@9.3.0 --skip.changelog --skip.bump --skip.tag'
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
task updateChangelogPreRelease(type: Exec) {
|
||||
commandLine 'cmd', '/c', 'npx standard-version@9.3.0 --prerelease -i docs/SNAPSHOT_CHANGELOG.md'
|
||||
ext.output = {
|
||||
return standardOutput.toString()
|
||||
}
|
||||
}
|
||||
|
88
docs/CHANGELOG.md
Normal file
88
docs/CHANGELOG.md
Normal file
@ -0,0 +1,88 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
For the release changelogs see [CHANGELOG.md](CHANGELOG.md)
|
||||
For the snapshot changelogs see [SNAPSHOT_CHANGELOG.md](SNAPSHOT_CHANGELOG.md)
|
||||
|
||||
## 0.16.0 (2021-05-18)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* **proxy:** Added a ForceEnableProxySupport config option ([99c810e](https://github.com/sekwah41/Advanced-Portals/commit/99c810e1beeee743734ec451ffe5df312eec8726))
|
||||
* **proxy:** Added Velocity support ([b243b4d](https://github.com/sekwah41/Advanced-Portals/commit/b243b4d889b8039cb800d981d44d85da06ff62d5))
|
||||
* **proxy:** Modern forwarding will be automatically detected. ([f3c8f73](https://github.com/sekwah41/Advanced-Portals/commit/f3c8f73975857a4e5d31a6a21111eee8b7888bdd))
|
||||
* Added configurable proxy teleport delay ([a1121ad](https://github.com/sekwah41/Advanced-Portals/commit/a1121adc10addfcce515d1358d1274232109fdfd))
|
||||
|
||||
### 0.5.12
|
||||
|
||||
* Added support for Velocity.
|
||||
* Also fixed some issues with entity teleporting.
|
||||
|
||||
### 0.5.11
|
||||
|
||||
* Missing changelogs
|
||||
|
||||
### 0.5.10
|
||||
|
||||
* Missing changelogs
|
||||
|
||||
### 0.5.10
|
||||
|
||||
* Added fix for command portals spam triggering if they didn't teleport you out.
|
||||
* Made portals not activate if you were teleported into them by another portal (to allow linking zones like a star trek warp pad)
|
||||
|
||||
### 0.5.9
|
||||
|
||||
* Missing changelogs
|
||||
|
||||
### 0.5.8
|
||||
|
||||
* Missing changelogs
|
||||
|
||||
### 0.5.7
|
||||
|
||||
|
||||
* Extra checks added by @tmantti to fix slow connections to new servers from activating the destination location too quick.
|
||||
|
||||
### 0.5.6
|
||||
* Fixed packet exploit affecting destinations (only effecting versions 0.5.0 to 0.5.5).
|
||||
|
||||
### 0.5.5
|
||||
* Added support for 1.16
|
||||
* Reworked chat menus to better use Spigot API
|
||||
* Changed edit menu to have Activate instead of Teleport to destination
|
||||
* Compat code changed. You must now use Spigot rather than CraftBukkit.
|
||||
|
||||
### 0.5.4
|
||||
* Added bungee backup methods to ensure bungee and desti work correctly together
|
||||
* Fixed protection region issue
|
||||
* Reworked the warp command and fixed the surrounding permissions
|
||||
* Disabling gateway beams is now enabled for placing the blocks as well as by a few other means
|
||||
|
||||
### 0.5.3
|
||||
|
||||
* Fixed destination bug.
|
||||
|
||||
### 0.5.2
|
||||
|
||||
* Fixed issue with bungee destinations.
|
||||
|
||||
### 0.5.1
|
||||
|
||||
* Fixed warp permission info
|
||||
|
||||
### 0.5.0
|
||||
|
||||
* Added command:
|
||||
* Fix for bungee warps
|
||||
|
||||
### 0.4.0
|
||||
|
||||
* Individual portal cooldown added
|
||||
* Bungee improvements
|
||||
|
||||
### Earlier
|
||||
|
||||
* See github releases and spigot pages for more info.
|
26
docs/SNAPSHOT_CHANGELOG.md
Normal file
26
docs/SNAPSHOT_CHANGELOG.md
Normal file
@ -0,0 +1,26 @@
|
||||
# Changelog
|
||||
|
||||
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
||||
|
||||
For the release changelogs see [CHANGELOG.md](CHANGELOG.md)
|
||||
For the snapshot changelogs see [SNAPSHOT_CHANGELOG.md](SNAPSHOT_CHANGELOG.md)
|
||||
|
||||
### [0.5.13-2](https://github.com/sekwah41/Advanced-Portals/compare/v0.5.13-1...v0.5.13-2) (2021-05-14)
|
||||
|
||||
* No code changes, just updated the changelog generation.
|
||||
|
||||
### 0.5.13-1 (2021-05-12)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* Added configurable proxy teleport delay ([a1121ad](https://github.com/sekwah41/Advanced-Portals/commit/a1121adc10addfcce515d1358d1274232109fdfd))
|
||||
|
||||
### 0.5.13-0 (2021-05-12)
|
||||
|
||||
* Build Tool Change: Updated versioning and changelog tooling and standards.
|
||||
* 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
|
||||
|
||||
|
@ -4,13 +4,15 @@ import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
public class ConfigHelper {
|
||||
|
||||
public static String CONFIG_VERSION = "ConfigVersion";
|
||||
public static final String CONFIG_VERSION = "ConfigVersion";
|
||||
|
||||
public static String COMMAND_LOGS = "CommandLogs";
|
||||
public static final String COMMAND_LOGS = "CommandLogs";
|
||||
|
||||
public static String FORCE_ENABLE_PROXY_SUPPORT = "ForceEnableProxySupport";
|
||||
public static final String FORCE_ENABLE_PROXY_SUPPORT = "ForceEnableProxySupport";
|
||||
|
||||
public static String DISABLE_GATEWAY_BEAM = "DisableGatewayBeam";
|
||||
public static final String PROXY_TELEPORT_DELAY = "ProxyTeleportDelay";
|
||||
|
||||
public static final String DISABLE_GATEWAY_BEAM = "DisableGatewayBeam";
|
||||
|
||||
private final FileConfiguration config;
|
||||
|
||||
@ -22,7 +24,7 @@ public class ConfigHelper {
|
||||
* Recursively for each time there is a future update
|
||||
*/
|
||||
public void update() {
|
||||
String configVersion = config.getString("ConfigVersion");
|
||||
String configVersion = config.getString(CONFIG_VERSION);
|
||||
// Added in 0.5.4
|
||||
if(configVersion == null || configVersion.equals("true") || configVersion.equals("0.5.3")) {
|
||||
config.set(ConfigHelper.CONFIG_VERSION, "0.5.4");
|
||||
@ -35,6 +37,7 @@ public class ConfigHelper {
|
||||
} else if(configVersion.equals("0.5.10") || configVersion.equals("0.5.11")) {
|
||||
config.set(ConfigHelper.CONFIG_VERSION, "0.5.13");
|
||||
config.set(ConfigHelper.FORCE_ENABLE_PROXY_SUPPORT, false);
|
||||
config.set(ConfigHelper.PROXY_TELEPORT_DELAY, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3,6 +3,8 @@ package com.sekwah.advancedportals.bukkit.listeners;
|
||||
import com.google.common.io.ByteArrayDataInput;
|
||||
import com.google.common.io.ByteStreams;
|
||||
import com.sekwah.advancedportals.bukkit.AdvancedPortalsPlugin;
|
||||
import com.sekwah.advancedportals.bukkit.config.ConfigAccessor;
|
||||
import com.sekwah.advancedportals.bukkit.config.ConfigHelper;
|
||||
import com.sekwah.advancedportals.bukkit.destinations.Destination;
|
||||
import com.sekwah.advancedportals.bungee.BungeeMessages;
|
||||
import org.bukkit.entity.Player;
|
||||
@ -13,9 +15,12 @@ import java.util.UUID;
|
||||
public class PluginMessageReceiver implements PluginMessageListener {
|
||||
|
||||
private final AdvancedPortalsPlugin plugin;
|
||||
private final int teleportDelay;
|
||||
|
||||
public PluginMessageReceiver(AdvancedPortalsPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||
teleportDelay = config.getConfig().getInt(ConfigHelper.PROXY_TELEPORT_DELAY, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -34,22 +39,33 @@ public class PluginMessageReceiver implements PluginMessageListener {
|
||||
|
||||
Player targetPlayer = this.plugin.getServer().getPlayer(UUID.fromString(bungeeUUID));
|
||||
|
||||
if (targetPlayer != null) {
|
||||
Destination.warp(targetPlayer, targetDestination, false, true);
|
||||
|
||||
}
|
||||
else {
|
||||
plugin.getPlayerDestiMap().put(bungeeUUID, targetDestination);
|
||||
|
||||
if(teleportDelay <= 0) {
|
||||
teleportPlayerToDesti(targetPlayer, targetDestination, bungeeUUID);
|
||||
} else {
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
|
||||
plugin.getPlayerDestiMap().remove(bungeeUUID),
|
||||
20L * 10
|
||||
teleportPlayerToDesti(targetPlayer, targetDestination, bungeeUUID),
|
||||
20L * teleportDelay
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void teleportPlayerToDesti(Player player, String desti, String bungeeUUID) {
|
||||
if (player != null) {
|
||||
Destination.warp(player, desti, false, true);
|
||||
|
||||
}
|
||||
else {
|
||||
plugin.getPlayerDestiMap().put(bungeeUUID, desti);
|
||||
|
||||
plugin.getServer().getScheduler().scheduleSyncDelayedTask(plugin, () ->
|
||||
plugin.getPlayerDestiMap().remove(bungeeUUID),
|
||||
20L * 10
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Example forward packet.
|
||||
*
|
||||
|
@ -12,7 +12,6 @@ import com.velocitypowered.api.event.proxy.ProxyInitializeEvent;
|
||||
import com.velocitypowered.api.plugin.Plugin;
|
||||
import com.velocitypowered.api.proxy.ProxyServer;
|
||||
import com.velocitypowered.api.proxy.ServerConnection;
|
||||
import com.velocitypowered.api.proxy.messages.ChannelIdentifier;
|
||||
import com.velocitypowered.api.proxy.messages.LegacyChannelIdentifier;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
@ -24,7 +23,7 @@ import java.util.concurrent.TimeUnit;
|
||||
*/
|
||||
@Plugin(id = "advancedportals", name = "Advanced Portals",
|
||||
url = "https://www.spigotmc.org/resources/advanced-portals.14356/",
|
||||
version = "0.5.13")
|
||||
version = "0.16.0")
|
||||
public class AdvancedPortalsPlugin {
|
||||
|
||||
public HashMap<String, String[]> PlayerDestiMap = new HashMap<>();
|
||||
|
@ -1,4 +1,4 @@
|
||||
main: com.sekwah.advancedportals.bungee.AdvancedPortalsPlugin
|
||||
name: AdvancedPortals
|
||||
version: 0.5.13
|
||||
version: 0.16.0
|
||||
author: sekwah41
|
||||
|
@ -91,3 +91,7 @@ CommandLogs: true
|
||||
|
||||
# If you want to use bungee or velocity and it is not automatically detected (make sure you have advanced portals on the proxy, especially with velocity)
|
||||
ForceEnableProxySupport: false
|
||||
|
||||
# How many seconds after the proxy event fires should the player be teleported (should help with on spawn plugins and such)
|
||||
# 0 is disabled and anything higher causes a delay.
|
||||
ProxyTeleportDelay: 0
|
||||
|
@ -1,6 +1,6 @@
|
||||
main: com.sekwah.advancedportals.bukkit.AdvancedPortalsPlugin
|
||||
name: AdvancedPortals
|
||||
version: 0.5.13
|
||||
version: 0.16.0
|
||||
author: sekwah41
|
||||
description: An advanced portals plugin for bukkit.
|
||||
api-version: 1.13
|
||||
|
Loading…
Reference in New Issue
Block a user