Compare commits
99 Commits
v0.6.0
...
spigot-1.1
Author | SHA1 | Date |
---|---|---|
renovate[bot] | 689d4a4fe9 | |
renovate[bot] | f0671fb8b8 | |
renovate[bot] | 9cf6d9e991 | |
Tad Hunt | b0a93c2c35 | |
renovate[bot] | 5229339a8c | |
renovate[bot] | 1a759dcc76 | |
renovate[bot] | 93a6aface2 | |
renovate[bot] | 0b64f47b8a | |
renovate[bot] | 617ccfd66a | |
Osiris-Team | e808668fce | |
renovate[bot] | 91d52b8c1b | |
renovate[bot] | eb71f1c1d1 | |
renovate[bot] | 15956b4844 | |
renovate[bot] | 4f60d8e319 | |
renovate[bot] | f5f06167db | |
renovate[bot] | 0f595fac7d | |
renovate[bot] | 051fc6c92e | |
renovate[bot] | 22483ac052 | |
renovate[bot] | 51aa6dac47 | |
renovate[bot] | 029f117fc1 | |
Renovate Bot | 87cd76cdeb | |
Renovate Bot | 34b0127f99 | |
Renovate Bot | 7d3597faad | |
Renovate Bot | 58e7e3ad78 | |
Renovate Bot | 6906772138 | |
Renovate Bot | 080aae4a9e | |
Renovate Bot | f6620ef2eb | |
Renovate Bot | 05359480a3 | |
Renovate Bot | a317acce3d | |
Renovate Bot | 9b7c09955e | |
Renovate Bot | 8eb3a2926b | |
Renovate Bot | 71e67f2010 | |
Sekwah | 5df74aae28 | |
Sekwah | 4904d806be | |
Sekwah | 9a64ae58c7 | |
Renovate Bot | c504909668 | |
Renovate Bot | 5b79228be7 | |
Renovate Bot | 6ab4c363ac | |
Renovate Bot | 5751879abd | |
Renovate Bot | 7d82fa3879 | |
Sekwah | 1bad72bbc2 | |
Sekwah | f8bec4c1ee | |
Sekwah | 75d2be30fe | |
Sekwah | 787c1d09b4 | |
Sekwah | 20c56219f9 | |
Sekwah | 778ad2ab31 | |
JOO200 | e3021367ab | |
JOO200 | fdb22ab8b5 | |
JOO200 | d16ccb7717 | |
Renovate Bot | 2207324598 | |
Renovate Bot | d916deb3a9 | |
Sekwah | 659fcca7ee | |
Mohammed Al-Dahleh | 3928922de3 | |
Sekwah | a9e660db65 | |
Renovate Bot | 486cff7e09 | |
Renovate Bot | d09ad72491 | |
Renovate Bot | 7d5e96f291 | |
Sekwah | 393ad01d45 | |
Renovate Bot | 71d08da9dc | |
Renovate Bot | f225363e67 | |
Renovate Bot | 162505553f | |
Renovate Bot | 812f4c78dc | |
Renovate Bot | 0ab32790eb | |
Renovate Bot | 0be605fe3a | |
Sekwah | 64f0f5113e | |
Sekwah | fb80fbb515 | |
Sekwah | 81d64ecc5a | |
Renovate Bot | aacf626635 | |
Renovate Bot | 12ab00f004 | |
Renovate Bot | 065fa22852 | |
Sekwah | 012ddf6e36 | |
Sekwah | 9b3adf7ba4 | |
Sekwah | ab9dbe027e | |
Sekwah | 62307c6bcf | |
Renovate Bot | e2b0723d24 | |
Renovate Bot | 1a57a509e6 | |
Sekwah | ee8f0ff3d0 | |
Sekwah | 05d2a51fbf | |
Sekwah | e73d84afa3 | |
Renovate Bot | d4b642ec23 | |
Sekwah | bc683183f6 | |
Sekwah | 3a5460cff3 | |
Sekwah | f364828176 | |
Renovate Bot | dfe5cfc26d | |
Sekwah | ebd94fd081 | |
Renovate Bot | ffee4fbbbe | |
Renovate Bot | dcf8456511 | |
Renovate Bot | 1ac1fe7e2e | |
Sekwah | c51a556ac7 | |
Sekwah | eafe7f1d9c | |
Sekwah | ff95908bf2 | |
Sekwah | d2e69771c5 | |
Sekwah | 17a81dede7 | |
Renovate Bot | efc9ad4715 | |
Sekwah | 7c78f414ac | |
Sekwah | bfea4b2836 | |
Sekwah | b1be39b908 | |
Sekwah | 68ba7dc76b | |
Sekwah | cd96c0d2c0 |
|
@ -0,0 +1,32 @@
|
||||||
|
{
|
||||||
|
"baseBranch": "spigot-1.13-1.16",
|
||||||
|
"plugins": [
|
||||||
|
[
|
||||||
|
"gradle",
|
||||||
|
{
|
||||||
|
"gradleCommand": "./gradlew",
|
||||||
|
"gradleOptions": [""]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
[
|
||||||
|
"exec",
|
||||||
|
{
|
||||||
|
"canary": "./gradlew build discord"
|
||||||
|
}
|
||||||
|
],
|
||||||
|
["conventional-commits", { "preset": "angular" }],
|
||||||
|
"released",
|
||||||
|
["upload-assets", ["./build/libs/*.jar"]]
|
||||||
|
],
|
||||||
|
"owner": "sekwah41",
|
||||||
|
"repo": "Advanced-Portals",
|
||||||
|
"name": "Sekwah",
|
||||||
|
"email": "contact@sekwah.com",
|
||||||
|
"onlyPublishWithReleaseLabel": true,
|
||||||
|
"shipit": {
|
||||||
|
"onlyGraduateWithReleaseLabel": true
|
||||||
|
},
|
||||||
|
"canary": {
|
||||||
|
"message": "📦 Published PR to [discord](https://discord.sekwah.com/) as canary version: %v"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
# What Changed
|
||||||
|
Whatever changed here
|
||||||
|
|
||||||
|
## Release Notes
|
||||||
|
If anything should be commented in the changelog release notes.
|
||||||
|
|
||||||
|
**NOTE:** Please remove this unless something important needs to be shared.
|
||||||
|
It's just to save time looking up what is needed in the event we need to.
|
|
@ -1,12 +1,6 @@
|
||||||
name: Build Project
|
name: Release
|
||||||
|
|
||||||
on:
|
on: [push, workflow_dispatch]
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- '**'
|
|
||||||
tags:
|
|
||||||
- '*'
|
|
||||||
pull_request:
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -15,25 +9,39 @@ jobs:
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
- name: Set up JDK 1.8
|
|
||||||
uses: actions/setup-java@v1
|
|
||||||
with:
|
|
||||||
java-version: 1.8
|
|
||||||
- name: Cache Gradle packages
|
- name: Cache Gradle packages
|
||||||
uses: actions/cache@v2
|
uses: actions/cache@v2
|
||||||
with:
|
with:
|
||||||
path: ~/.gradle/caches
|
path: ~/.gradle/caches
|
||||||
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}
|
||||||
restore-keys: ${{ runner.os }}-gradle
|
restore-keys: ${{ runner.os }}-gradle
|
||||||
|
- name: Cache Node packages
|
||||||
|
uses: actions/cache@v2
|
||||||
|
with:
|
||||||
|
path: node_modules
|
||||||
|
key: ${{ runner.os }}-node-${{ hashFiles('**/package.json') }}
|
||||||
|
restore-keys: ${{ runner.os }}-node
|
||||||
|
- name: Set up JDK 8
|
||||||
|
uses: actions/setup-java@v3
|
||||||
|
with:
|
||||||
|
distribution: 'zulu'
|
||||||
|
java-version: 8
|
||||||
|
- name: Use Node.js 12.x
|
||||||
|
uses: actions/setup-node@v2
|
||||||
|
with:
|
||||||
|
node-version: 12.x
|
||||||
|
- name: Prepare repository
|
||||||
|
run: |
|
||||||
|
git fetch --unshallow --tags
|
||||||
|
yarn install --frozen-lockfile
|
||||||
|
echo $(yarn bin) >> $GITHUB_PATH
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew build
|
||||||
- name: Upload to Discord (If pre-release tag)
|
- name: Create Release
|
||||||
if: "startsWith(github.ref, 'refs/tags/v') && contains(github.ref, '-')"
|
|
||||||
env:
|
|
||||||
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
|
||||||
run: ./gradlew discordupload
|
|
||||||
- name: Publish to Curseforge (If release tag)
|
|
||||||
if: "startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')"
|
|
||||||
env:
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
CURSE_API: ${{ secrets.CURSE_API }}
|
CURSE_API: ${{ secrets.CURSE_API }}
|
||||||
run: ./gradlew curseforge
|
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
|
||||||
|
run: |
|
||||||
|
auto shipit
|
||||||
|
|
||||||
|
|
|
@ -7,10 +7,11 @@
|
||||||
*.war
|
*.war
|
||||||
*.ear
|
*.ear
|
||||||
|
|
||||||
|
node_modules/
|
||||||
*.iml
|
*.iml
|
||||||
*.iws
|
*.iws
|
||||||
*.ipr
|
*.ipr
|
||||||
|
.env
|
||||||
out/
|
out/
|
||||||
logs/
|
logs/
|
||||||
classes/
|
classes/
|
||||||
|
|
|
@ -1,51 +0,0 @@
|
||||||
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",
|
|
||||||
}
|
|
|
@ -0,0 +1,240 @@
|
||||||
|
# v0.9.2 (Thu Feb 24 2022)
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- fix: Removes the false positive warning from McAntiMalware [#318](https://github.com/sekwah41/Advanced-Portals/pull/318) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): Update Deps ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency com.sk89q.worldedit:worldedit-bukkit to v7.2.9 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update Deps [#316](https://github.com/sekwah41/Advanced-Portals/pull/316) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency gradle to v7.3.3 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.9.1 (Fri Dec 17 2021)
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- fix: Error in position checks for portal creation [#310](https://github.com/sekwah41/Advanced-Portals/pull/310) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(ci): Update release support flags ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
|
||||||
|
#### Authors: 1
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.9.0 (Wed Dec 15 2021)
|
||||||
|
|
||||||
|
#### 🚀 Enhancement
|
||||||
|
|
||||||
|
- feat: WorldEdit Integration, fix logic error [#307](https://github.com/sekwah41/Advanced-Portals/pull/307) ([@JOO200](https://github.com/JOO200))
|
||||||
|
- feat: Added WorldEdit Integration [#307](https://github.com/sekwah41/Advanced-Portals/pull/307) ([@JOO200](https://github.com/JOO200))
|
||||||
|
- feat: Adds ability to configure warp message [#302](https://github.com/sekwah41/Advanced-Portals/pull/302) ([@maldahleh](https://github.com/maldahleh))
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- chore(deps): Update Velocity to 3.1.0 [#307](https://github.com/sekwah41/Advanced-Portals/pull/307) ([@JOO200](https://github.com/JOO200))
|
||||||
|
- chore(deps): Update Deps ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency gradle to v7.3.1 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- docs: Update changelog ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(ci): Allow manual triggering ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): Update Deps to v10.32.3 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency gradle to v7.3 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency io.netty:netty-all to v4.1.70.Final ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(ci): Update to list 1.17 as supported automatically ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): Update dependency io.netty:netty-all to v4.1.69.Final ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update Deps to v10.32.1 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update Deps to v10.32.0 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): Update dependency com.velocitypowered:velocity-api to v1.1.9 ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
#### Authors: 4
|
||||||
|
|
||||||
|
- [@JOO200](https://github.com/JOO200)
|
||||||
|
- Mohammed Al-Dahleh ([@maldahleh](https://github.com/maldahleh))
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.8.0 (Wed Sep 01 2021)
|
||||||
|
|
||||||
|
#### 🚀 Enhancement
|
||||||
|
|
||||||
|
- feat: Allow the ability to disable the proxy warning message [#292](https://github.com/sekwah41/Advanced-Portals/pull/292) ([@maldahleh](https://github.com/maldahleh))
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- chore(deps): Update Deps ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(ci): Update rennovate config ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Mohammed Al-Dahleh ([@maldahleh](https://github.com/maldahleh))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.7.2 (Wed Jul 14 2021)
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- fix: Issue where portal events activate too early in survival [#280](https://github.com/sekwah41/Advanced-Portals/pull/280) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): update dependency com.velocitypowered:velocity-api to v1.1.9 [#278](https://github.com/sekwah41/Advanced-Portals/pull/278) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): update dependency gradle to v7.1.1 [#277](https://github.com/sekwah41/Advanced-Portals/pull/277) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.7.1 (Wed Jun 30 2021)
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- fix: Access to portal warp command locked behind wrong perm [#275](https://github.com/sekwah41/Advanced-Portals/pull/275) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): update dependency gradle to v7 [#271](https://github.com/sekwah41/Advanced-Portals/pull/271) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.7.0 (Sun Jun 27 2021)
|
||||||
|
|
||||||
|
#### 🚀 Enhancement
|
||||||
|
|
||||||
|
- feat: Added missing commands from tab complete [#270](https://github.com/sekwah41/Advanced-Portals/pull/270) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- chore(deps): update dependency net.md-5:bungeecord-api to v1.16-r0.4 [#269](https://github.com/sekwah41/Advanced-Portals/pull/269) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(ci): removed verbose mode for release ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): update dependency com.google.code.gson:gson to v2.8.7 [#262](https://github.com/sekwah41/Advanced-Portals/pull/262) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): update dependency gradle to v6.9 [#267](https://github.com/sekwah41/Advanced-Portals/pull/267) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- chore(deps): update dependency com.velocitypowered:velocity-api to v1.1.8 [#266](https://github.com/sekwah41/Advanced-Portals/pull/266) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# v0.6.1 (Sun Jun 27 2021)
|
||||||
|
|
||||||
|
#### 🐛 Bug Fix
|
||||||
|
|
||||||
|
- chore(ci): Remove isDevBranch remains [#265](https://github.com/sekwah41/Advanced-Portals/pull/265) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(ci): Fix forgotten sha in build gradle [#264](https://github.com/sekwah41/Advanced-Portals/pull/264) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(ci): Update version-bumping task order [#263](https://github.com/sekwah41/Advanced-Portals/pull/263) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(deps): pin dependencies [#261](https://github.com/sekwah41/Advanced-Portals/pull/261) ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
- fix: Spigot 1.17 error message [#260](https://github.com/sekwah41/Advanced-Portals/pull/260) ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- chore(ci): Swapping build pipeline ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- ci: Fixed java version ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- ci: Fix changelog reference ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- ci: Updated build pipelines to newer module ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
|
||||||
|
#### Authors: 2
|
||||||
|
|
||||||
|
- Sekwah ([@sekwah41](https://github.com/sekwah41))
|
||||||
|
- WhiteSource Renovate ([@renovate-bot](https://github.com/renovate-bot))
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
# 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.6.0 (2021-05-19)
|
||||||
|
|
||||||
|
|
||||||
|
### 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.
|
|
@ -33,6 +33,10 @@ Usage stats can be found here https://bstats.org/plugin/bukkit/AdvancedPortals
|
||||||
The api isn't implemented in this version, sorry for any inconvenience. Check the recode tree for possibly a working recode at some point.
|
The api isn't implemented in this version, sorry for any inconvenience. Check the recode tree for possibly a working recode at some point.
|
||||||
|
|
||||||
# Contributing
|
# Contributing
|
||||||
|
|
||||||
|
Don't worry about updating the file numbers in `bungee.yml`, `plugin.yml` and `AdvancedPortalsPlugin.java`.
|
||||||
|
They will be updated automatically before builds.
|
||||||
|
|
||||||
Please ensure that your commits are in the following style for PR's
|
Please ensure that your commits are in the following style for PR's
|
||||||
|
|
||||||
https://www.conventionalcommits.org/en/v1.0.0/
|
https://www.conventionalcommits.org/en/v1.0.0/
|
||||||
|
|
187
build.gradle
187
build.gradle
|
@ -1,3 +1,4 @@
|
||||||
|
import com.google.gson.Gson
|
||||||
import org.apache.commons.codec.Charsets
|
import org.apache.commons.codec.Charsets
|
||||||
import org.apache.http.HttpEntity
|
import org.apache.http.HttpEntity
|
||||||
import org.apache.http.HttpResponse
|
import org.apache.http.HttpResponse
|
||||||
|
@ -5,40 +6,45 @@ import org.apache.http.client.HttpClient
|
||||||
import org.apache.http.client.config.CookieSpecs
|
import org.apache.http.client.config.CookieSpecs
|
||||||
import org.apache.http.client.config.RequestConfig
|
import org.apache.http.client.config.RequestConfig
|
||||||
import org.apache.http.client.methods.CloseableHttpResponse
|
import org.apache.http.client.methods.CloseableHttpResponse
|
||||||
|
import org.apache.http.client.methods.HttpGet
|
||||||
import org.apache.http.client.methods.HttpPost
|
import org.apache.http.client.methods.HttpPost
|
||||||
import org.apache.http.entity.ContentType
|
import org.apache.http.entity.ContentType
|
||||||
import org.apache.http.entity.mime.MultipartEntityBuilder
|
import org.apache.http.entity.mime.MultipartEntityBuilder
|
||||||
import org.apache.http.impl.client.CloseableHttpClient
|
import org.apache.http.impl.client.CloseableHttpClient
|
||||||
import org.apache.http.impl.client.HttpClientBuilder
|
import org.apache.http.impl.client.HttpClientBuilder
|
||||||
import org.apache.http.impl.client.HttpClients
|
import org.apache.http.impl.client.HttpClients
|
||||||
import org.apache.http.client.methods.HttpGet
|
|
||||||
import com.google.gson.Gson
|
|
||||||
|
|
||||||
|
import java.util.regex.Matcher
|
||||||
apply plugin: 'java'
|
import java.util.regex.Pattern
|
||||||
apply plugin: 'maven-publish'
|
|
||||||
apply plugin: 'idea'
|
|
||||||
|
|
||||||
buildscript {
|
buildscript {
|
||||||
repositories {
|
repositories {
|
||||||
maven {url "https://plugins.gradle.org/m2/"}
|
maven { url "https://plugins.gradle.org/m2/" }
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
mavenLocal()
|
mavenLocal()
|
||||||
jcenter()
|
jcenter()
|
||||||
}
|
}
|
||||||
dependencies {
|
dependencies {
|
||||||
classpath "org.apache.httpcomponents:httpmime:4.5.13"
|
classpath "org.apache.httpcomponents:httpmime:4.5.14"
|
||||||
classpath "com.google.code.gson:gson:2.8.6"
|
classpath "com.google.code.gson:gson:2.10.1"
|
||||||
classpath "org.apache.httpcomponents:httpclient:4.5.13"
|
classpath "org.apache.httpcomponents:httpclient:4.5.14"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id 'net.researchgate.release' version '2.8.1'
|
||||||
|
}
|
||||||
|
|
||||||
|
apply plugin: 'java'
|
||||||
|
apply plugin: 'idea'
|
||||||
|
|
||||||
def branch = System.getenv("GITHUB_REF");
|
def branch = System.getenv("GITHUB_REF");
|
||||||
def sha = System.getenv("GITHUB_SHA");
|
if (branch != null) {
|
||||||
def isDevBranch = branch == null || !(branch.startsWith("refs/tags/") && !branch.contains("-"))
|
branch = branch.replace('refs/heads/', '')
|
||||||
|
}
|
||||||
|
def isCanary = version.toString().contains('canary')
|
||||||
|
|
||||||
group = 'com.sekwah.advancedportals'
|
group = 'com.sekwah.advancedportals'
|
||||||
version = getPluginData("version") + (isDevBranch ? '-SNAPSHOT' : '')
|
|
||||||
|
|
||||||
description = ""
|
description = ""
|
||||||
|
|
||||||
|
@ -52,9 +58,9 @@ tasks.withType(JavaCompile) {
|
||||||
String getPluginData(String tag) {
|
String getPluginData(String tag) {
|
||||||
File file = file("src/main/resources/plugin.yml")
|
File file = file("src/main/resources/plugin.yml")
|
||||||
String version = "notfound"
|
String version = "notfound"
|
||||||
file.readLines("UTF-8").each {String line ->
|
file.readLines("UTF-8").each { String line ->
|
||||||
line = line.trim()
|
line = line.trim()
|
||||||
if(line.startsWith(tag)) {
|
if (line.startsWith(tag)) {
|
||||||
version = line.substring(tag.length() + 2, line.length())
|
version = line.substring(tag.length() + 2, line.length())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -73,6 +79,7 @@ repositories {
|
||||||
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/' }
|
maven { url 'https://papermc.io/repo/repository/maven-public/' }
|
||||||
|
maven { url 'https://maven.enginehub.org/repo/' } // WorldEdit
|
||||||
}
|
}
|
||||||
|
|
||||||
// includeLibs just says to include the library in the final jar
|
// includeLibs just says to include the library in the final jar
|
||||||
|
@ -80,14 +87,15 @@ dependencies {
|
||||||
|
|
||||||
//implementation "org.bukkit:bukkit:1.16.1-R0.1-SNAPSHOT"
|
//implementation "org.bukkit:bukkit:1.16.1-R0.1-SNAPSHOT"
|
||||||
implementation "org.spigotmc:spigot-api: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"
|
implementation "net.md-5:bungeecord-api:1.16-R0.4"
|
||||||
|
|
||||||
implementation "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT"
|
implementation "com.velocitypowered:velocity-api:3.1.1"
|
||||||
annotationProcessor "com.velocitypowered:velocity-api:1.1.0-SNAPSHOT"
|
annotationProcessor "com.velocitypowered:velocity-api:3.1.1"
|
||||||
|
|
||||||
implementation "io.netty:netty-all:4.0.4.Final"
|
implementation "io.netty:netty-all:4.1.87.Final"
|
||||||
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
|
compileOnly 'com.destroystokyo.paper:paper-api:1.16.5-R0.1-SNAPSHOT'
|
||||||
|
|
||||||
|
implementation "com.sk89q.worldedit:worldedit-bukkit:7.2.13"
|
||||||
//compile fileTree(dir: 'libs', include: ['*.jar'])
|
//compile fileTree(dir: 'libs', include: ['*.jar'])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -101,15 +109,20 @@ task discordupload {
|
||||||
doLast {
|
doLast {
|
||||||
String discordWebhook = System.getenv("DISCORD_WEBHOOK")
|
String discordWebhook = System.getenv("DISCORD_WEBHOOK")
|
||||||
|
|
||||||
if(discordWebhook != null) {
|
if (discordWebhook != null) {
|
||||||
println("Logging Into Discord")
|
println("Logging Into Discord")
|
||||||
|
|
||||||
CloseableHttpClient httpClient = HttpClients.createDefault()
|
CloseableHttpClient httpClient = HttpClients.createDefault()
|
||||||
HttpPost uploadFile = new HttpPost(discordWebhook)
|
HttpPost uploadFile = new HttpPost(discordWebhook)
|
||||||
|
|
||||||
MultipartEntityBuilder builder = MultipartEntityBuilder.create()
|
MultipartEntityBuilder builder = MultipartEntityBuilder.create()
|
||||||
builder.addTextBody("content", "New automated dev build\n\n" +
|
|
||||||
"Current Features: <${project.github}/blob/${sha}/docs/CHANGELOG.md>")
|
if (isCanary) {
|
||||||
|
builder.addTextBody("content", "New canary Build")
|
||||||
|
} else {
|
||||||
|
builder.addTextBody("content", "New release build\n\n" +
|
||||||
|
"Current Features: <${project.github}/blob/${branch}/CHANGELOG.md>")
|
||||||
|
}
|
||||||
|
|
||||||
builder.addBinaryBody("file", file(jar.archiveFile).newInputStream(), ContentType.APPLICATION_OCTET_STREAM, jar.archiveName)
|
builder.addBinaryBody("file", file(jar.archiveFile).newInputStream(), ContentType.APPLICATION_OCTET_STREAM, jar.archiveName)
|
||||||
|
|
||||||
|
@ -204,7 +217,7 @@ class GameVersion {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* As described here https://support.curseforge.com/en/support/solutions/articles/9000197321-curseforge-api
|
* As described here https://support.curseforge.com/en/support/solutions/articles/9000197321-curseforge-api
|
||||||
*/
|
*/
|
||||||
class Metadata {
|
class Metadata {
|
||||||
String changelog
|
String changelog
|
||||||
String changelogType
|
String changelogType
|
||||||
|
@ -227,9 +240,9 @@ task curseforge {
|
||||||
apiKey = System.getenv("CURSE_API")
|
apiKey = System.getenv("CURSE_API")
|
||||||
}
|
}
|
||||||
|
|
||||||
if(apiKey != null) {
|
if (apiKey != null) {
|
||||||
|
|
||||||
Gson gson = new Gson()
|
Gson gson = new Gson()
|
||||||
|
|
||||||
//String VERSION_TYPES_URL = "/api/game/version-types"
|
//String VERSION_TYPES_URL = "/api/game/version-types"
|
||||||
int gameVersionTypeID = 1
|
int gameVersionTypeID = 1
|
||||||
|
@ -239,25 +252,27 @@ task curseforge {
|
||||||
// Get game versions
|
// Get game versions
|
||||||
String gameVersionsString = getValueFromCurseAPI(apiKey, VERSION_URL)
|
String gameVersionsString = getValueFromCurseAPI(apiKey, VERSION_URL)
|
||||||
GameVersion[] gameVersions = gson.fromJson(gameVersionsString, GameVersion[].class)
|
GameVersion[] gameVersions = gson.fromJson(gameVersionsString, GameVersion[].class)
|
||||||
def versions = gameVersions.findAll {it.gameVersionTypeID == gameVersionTypeID}
|
def versions = gameVersions.findAll { it.gameVersionTypeID == gameVersionTypeID }
|
||||||
|
|
||||||
String[] supportedVersions = [
|
String[] supportedVersions = [
|
||||||
"1.16",
|
"1.18",
|
||||||
"1.15",
|
"1.17",
|
||||||
"1.14",
|
"1.16",
|
||||||
"1.13"
|
"1.15",
|
||||||
|
"1.14",
|
||||||
|
"1.13"
|
||||||
]
|
]
|
||||||
|
|
||||||
def supportedGameVersions = versions.findAll {supportedVersions.contains(it.name)}
|
def supportedGameVersions = versions.findAll { supportedVersions.contains(it.name) }
|
||||||
int[] supportedGameVersionIds = supportedGameVersions.collect {it.id}.toArray()
|
int[] supportedGameVersionIds = supportedGameVersions.collect { it.id }.toArray()
|
||||||
|
|
||||||
println("Supported Version Id's ${supportedGameVersionIds}")
|
println("Supported Version Id's ${supportedGameVersionIds}")
|
||||||
|
|
||||||
Metadata uploadMetadata = new Metadata();
|
Metadata uploadMetadata = new Metadata();
|
||||||
|
|
||||||
uploadMetadata.changelog = "${project.github}/blob/${sha}/docs/CHANGELOG.md"
|
uploadMetadata.changelog = "${project.github}/blob/${branch}/CHANGELOG.md"
|
||||||
uploadMetadata.changelogType = "markdown"
|
uploadMetadata.changelogType = "markdown"
|
||||||
uploadMetadata.releaseType = isDevBranch ? "beta" : "release"
|
uploadMetadata.releaseType = "release"
|
||||||
uploadMetadata.gameVersions = supportedGameVersionIds
|
uploadMetadata.gameVersions = supportedGameVersionIds
|
||||||
|
|
||||||
def uploadId = uploadFile(uploadMetadata, file(jar.archiveFile), apiKey, gson)
|
def uploadId = uploadFile(uploadMetadata, file(jar.archiveFile), apiKey, gson)
|
||||||
|
@ -272,7 +287,6 @@ task curseforge {
|
||||||
}
|
}
|
||||||
// id = project.curse_project_id
|
// id = project.curse_project_id
|
||||||
// // 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"
|
|
||||||
// changelogType = 'markdown'
|
// changelogType = 'markdown'
|
||||||
// releaseType = 'release'
|
// releaseType = 'release'
|
||||||
}
|
}
|
||||||
|
@ -280,7 +294,7 @@ task curseforge {
|
||||||
task copyPlugin {
|
task copyPlugin {
|
||||||
doLast {
|
doLast {
|
||||||
copy {
|
copy {
|
||||||
if(System.env.MC_SERVER_LOC == null) {
|
if (System.env.MC_SERVER_LOC == null) {
|
||||||
throw new Exception('You must set the server location and jar to use')
|
throw new Exception('You must set the server location and jar to use')
|
||||||
}
|
}
|
||||||
println "$buildDir/libs/Advanced-Portals-${version}.jar"
|
println "$buildDir/libs/Advanced-Portals-${version}.jar"
|
||||||
|
@ -290,7 +304,7 @@ task copyPlugin {
|
||||||
include "*.jar"
|
include "*.jar"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch(RuntimeException e) {
|
catch (RuntimeException e) {
|
||||||
println e.getLocalizedMessage()
|
println e.getLocalizedMessage()
|
||||||
}
|
}
|
||||||
from file("$buildDir/libs/Advanced-Portals-${version}.jar")
|
from file("$buildDir/libs/Advanced-Portals-${version}.jar")
|
||||||
|
@ -303,7 +317,7 @@ task copyPlugin {
|
||||||
// DIReallyKnowWhatIAmDoingISwear is to remove the stupid pause spigot has at the start
|
// DIReallyKnowWhatIAmDoingISwear is to remove the stupid pause spigot has at the start
|
||||||
task runJar() {
|
task runJar() {
|
||||||
doLast {
|
doLast {
|
||||||
if(System.env.MC_SERVER_LOC == null || System.env.MC_SERVER_JAR == null) {
|
if (System.env.MC_SERVER_LOC == null || System.env.MC_SERVER_JAR == null) {
|
||||||
throw new Exception('You must set the server location and jar to use MC_SERVER_LOC and MC_SERVER_JAR')
|
throw new Exception('You must set the server location and jar to use MC_SERVER_LOC and MC_SERVER_JAR')
|
||||||
}
|
}
|
||||||
javaexec {
|
javaexec {
|
||||||
|
@ -315,42 +329,77 @@ task runJar() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
task publish {
|
||||||
* These are needed as standard-version doesnt allow for the ability to skip tag versions for the changelog.
|
doLast {
|
||||||
* Well it does but not on purpose and it breaks things.
|
println "This is a dummy task to run others for version: ${version}"
|
||||||
*
|
|
||||||
* 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) {
|
// https://github.com/researchgate/gradle-release
|
||||||
commandLine 'cmd', '/c', 'npx standard-version@9.3.0 --prerelease -i docs/SNAPSHOT_CHANGELOG.md --skip.tag'
|
// Only other plugin I can find using auto & gradle https://github.com/intuit/hooks
|
||||||
ext.output = {
|
release {
|
||||||
return standardOutput.toString()
|
failOnPublishNeeded = false
|
||||||
|
failOnSnapshotDependencies = false
|
||||||
|
git {
|
||||||
|
requireBranch = ''
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// Disable tasks because something we have is causing -x to be ignored
|
||||||
|
createReleaseTag.enabled = false
|
||||||
|
preTagCommit.enabled = false
|
||||||
|
commitNewVersion.enabled = false
|
||||||
|
}
|
||||||
|
|
||||||
|
task cleanbuildfolder {
|
||||||
|
doFirst {
|
||||||
|
println "Cleaning up previous builds (to stop publishing old ones by mistake)"
|
||||||
|
project.delete(files("${buildDir}/libs"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
void updateFileVersion(String fileLoc, Pattern pattern, Closure<String> stringClosure) {
|
||||||
* Just to stop having to manually tagging. Probably could do this easier but meh stops typos or other issues.
|
File file = new File(projectDir, fileLoc)
|
||||||
*/
|
Matcher m = pattern.matcher(file.text)
|
||||||
task tagRelease(type: Exec) {
|
if (m.find()) {
|
||||||
commandLine 'cmd', '/c', 'npx standard-version@9.3.0 --prerelease -i docs/SNAPSHOT_CHANGELOG.md --skip.changelog --skip.bump'
|
def newVersion = stringClosure.call(m)
|
||||||
ext.output = {
|
println "Replacing ${pattern.toString()} in ${fileLoc} with '${newVersion}'"
|
||||||
return standardOutput.toString()
|
file.text = file.text.replaceAll(pattern, newVersion)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Just to keep all numbers the same (as they are dotted all over the place)
|
||||||
|
task updateVersionNumbers {
|
||||||
|
doFirst {
|
||||||
|
def versionRegex = ~/(\nversion:\s)([0-9.-]+)/
|
||||||
|
def velocityVersionRegex = ~/(\sversion\s=\s")([0-9.-]+)("\))/
|
||||||
|
|
||||||
|
updateFileVersion("src/main/resources/bungee.yml", versionRegex,
|
||||||
|
{ Matcher m ->
|
||||||
|
return "${m.group(1)}${getVersion()}"
|
||||||
|
})
|
||||||
|
|
||||||
|
updateFileVersion("src/main/resources/plugin.yml", versionRegex,
|
||||||
|
{ Matcher m ->
|
||||||
|
return "${m.group(1)}${getVersion()}"
|
||||||
|
})
|
||||||
|
|
||||||
|
updateFileVersion("src/main/java/com/sekwah/advancedportals/velocity/AdvancedPortalsPlugin.java",
|
||||||
|
velocityVersionRegex,
|
||||||
|
{ Matcher m ->
|
||||||
|
return "${m.group(1)}${getVersion()}${m.group(3)}"
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
updateVersion.finalizedBy 'updateVersionNumbers'
|
||||||
|
|
||||||
|
compileJava.dependsOn 'cleanbuildfolder'
|
||||||
|
|
||||||
|
// Publish rules
|
||||||
|
// Current behavior seems to be canary or release. Though pre-releases may break this pattern.
|
||||||
|
publish.dependsOn 'build'
|
||||||
|
publish.finalizedBy 'discordupload'
|
||||||
|
if (!isCanary) {
|
||||||
|
publish.finalizedBy 'curseforge'
|
||||||
|
}
|
||||||
|
|
|
@ -1,88 +0,0 @@
|
||||||
# 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.6.0 (2021-05-19)
|
|
||||||
|
|
||||||
|
|
||||||
### 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.
|
|
|
@ -1,26 +0,0 @@
|
||||||
# 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,3 +4,4 @@ org.gradle.caching=true
|
||||||
|
|
||||||
github=https://github.com/sekwah41/Advanced-Portals
|
github=https://github.com/sekwah41/Advanced-Portals
|
||||||
curse_project_id=86001
|
curse_project_id=86001
|
||||||
|
version=0.9.2
|
||||||
|
|
Binary file not shown.
|
@ -1,6 +1,6 @@
|
||||||
#Sun Jan 19 19:02:36 KST 2020
|
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-6.0.1-all.zip
|
|
||||||
distributionBase=GRADLE_USER_HOME
|
distributionBase=GRADLE_USER_HOME
|
||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStorePath=wrapper/dists
|
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-all.zip
|
||||||
|
networkTimeout=10000
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
|
zipStorePath=wrapper/dists
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/usr/bin/env sh
|
#!/bin/sh
|
||||||
|
|
||||||
#
|
#
|
||||||
# Copyright 2015 the original author or authors.
|
# Copyright © 2015-2021 the original authors.
|
||||||
#
|
#
|
||||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
# you may not use this file except in compliance with the License.
|
# you may not use this file except in compliance with the License.
|
||||||
|
@ -17,78 +17,113 @@
|
||||||
#
|
#
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
##
|
#
|
||||||
## Gradle start up script for UN*X
|
# Gradle start up script for POSIX generated by Gradle.
|
||||||
##
|
#
|
||||||
|
# Important for running:
|
||||||
|
#
|
||||||
|
# (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is
|
||||||
|
# noncompliant, but you have some other compliant shell such as ksh or
|
||||||
|
# bash, then to run this script, type that shell name before the whole
|
||||||
|
# command line, like:
|
||||||
|
#
|
||||||
|
# ksh Gradle
|
||||||
|
#
|
||||||
|
# Busybox and similar reduced shells will NOT work, because this script
|
||||||
|
# requires all of these POSIX shell features:
|
||||||
|
# * functions;
|
||||||
|
# * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,
|
||||||
|
# «${var#prefix}», «${var%suffix}», and «$( cmd )»;
|
||||||
|
# * compound commands having a testable exit status, especially «case»;
|
||||||
|
# * various built-in commands including «command», «set», and «ulimit».
|
||||||
|
#
|
||||||
|
# Important for patching:
|
||||||
|
#
|
||||||
|
# (2) This script targets any POSIX shell, so it avoids extensions provided
|
||||||
|
# by Bash, Ksh, etc; in particular arrays are avoided.
|
||||||
|
#
|
||||||
|
# The "traditional" practice of packing multiple parameters into a
|
||||||
|
# space-separated string is a well documented source of bugs and security
|
||||||
|
# problems, so this is (mostly) avoided, by progressively accumulating
|
||||||
|
# options in "$@", and eventually passing that to Java.
|
||||||
|
#
|
||||||
|
# Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,
|
||||||
|
# and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;
|
||||||
|
# see the in-line comments for details.
|
||||||
|
#
|
||||||
|
# There are tweaks for specific operating systems such as AIX, CygWin,
|
||||||
|
# Darwin, MinGW, and NonStop.
|
||||||
|
#
|
||||||
|
# (3) This script is generated from the Groovy template
|
||||||
|
# https://github.com/gradle/gradle/blob/HEAD/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
|
||||||
|
# within the Gradle project.
|
||||||
|
#
|
||||||
|
# You can find Gradle at https://github.com/gradle/gradle/.
|
||||||
|
#
|
||||||
##############################################################################
|
##############################################################################
|
||||||
|
|
||||||
# Attempt to set APP_HOME
|
# Attempt to set APP_HOME
|
||||||
# Resolve links: $0 may be a link
|
|
||||||
PRG="$0"
|
|
||||||
# Need this for relative symlinks.
|
|
||||||
while [ -h "$PRG" ] ; do
|
|
||||||
ls=`ls -ld "$PRG"`
|
|
||||||
link=`expr "$ls" : '.*-> \(.*\)$'`
|
|
||||||
if expr "$link" : '/.*' > /dev/null; then
|
|
||||||
PRG="$link"
|
|
||||||
else
|
|
||||||
PRG=`dirname "$PRG"`"/$link"
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
SAVED="`pwd`"
|
|
||||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
|
||||||
APP_HOME="`pwd -P`"
|
|
||||||
cd "$SAVED" >/dev/null
|
|
||||||
|
|
||||||
APP_NAME="Gradle"
|
# Resolve links: $0 may be a link
|
||||||
APP_BASE_NAME=`basename "$0"`
|
app_path=$0
|
||||||
|
|
||||||
|
# Need this for daisy-chained symlinks.
|
||||||
|
while
|
||||||
|
APP_HOME=${app_path%"${app_path##*/}"} # leaves a trailing /; empty if no leading path
|
||||||
|
[ -h "$app_path" ]
|
||||||
|
do
|
||||||
|
ls=$( ls -ld "$app_path" )
|
||||||
|
link=${ls#*' -> '}
|
||||||
|
case $link in #(
|
||||||
|
/*) app_path=$link ;; #(
|
||||||
|
*) app_path=$APP_HOME$link ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
|
# This is normally unused
|
||||||
|
# shellcheck disable=SC2034
|
||||||
|
APP_BASE_NAME=${0##*/}
|
||||||
|
APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
|
||||||
|
|
||||||
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
|
||||||
|
|
||||||
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
# Use the maximum available, or set MAX_FD != -1 to use that value.
|
||||||
MAX_FD="maximum"
|
MAX_FD=maximum
|
||||||
|
|
||||||
warn () {
|
warn () {
|
||||||
echo "$*"
|
echo "$*"
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
die () {
|
die () {
|
||||||
echo
|
echo
|
||||||
echo "$*"
|
echo "$*"
|
||||||
echo
|
echo
|
||||||
exit 1
|
exit 1
|
||||||
}
|
} >&2
|
||||||
|
|
||||||
# OS specific support (must be 'true' or 'false').
|
# OS specific support (must be 'true' or 'false').
|
||||||
cygwin=false
|
cygwin=false
|
||||||
msys=false
|
msys=false
|
||||||
darwin=false
|
darwin=false
|
||||||
nonstop=false
|
nonstop=false
|
||||||
case "`uname`" in
|
case "$( uname )" in #(
|
||||||
CYGWIN* )
|
CYGWIN* ) cygwin=true ;; #(
|
||||||
cygwin=true
|
Darwin* ) darwin=true ;; #(
|
||||||
;;
|
MSYS* | MINGW* ) msys=true ;; #(
|
||||||
Darwin* )
|
NONSTOP* ) nonstop=true ;;
|
||||||
darwin=true
|
|
||||||
;;
|
|
||||||
MINGW* )
|
|
||||||
msys=true
|
|
||||||
;;
|
|
||||||
NONSTOP* )
|
|
||||||
nonstop=true
|
|
||||||
;;
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||||
|
|
||||||
|
|
||||||
# Determine the Java command to use to start the JVM.
|
# Determine the Java command to use to start the JVM.
|
||||||
if [ -n "$JAVA_HOME" ] ; then
|
if [ -n "$JAVA_HOME" ] ; then
|
||||||
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
|
||||||
# IBM's JDK on AIX uses strange locations for the executables
|
# IBM's JDK on AIX uses strange locations for the executables
|
||||||
JAVACMD="$JAVA_HOME/jre/sh/java"
|
JAVACMD=$JAVA_HOME/jre/sh/java
|
||||||
else
|
else
|
||||||
JAVACMD="$JAVA_HOME/bin/java"
|
JAVACMD=$JAVA_HOME/bin/java
|
||||||
fi
|
fi
|
||||||
if [ ! -x "$JAVACMD" ] ; then
|
if [ ! -x "$JAVACMD" ] ; then
|
||||||
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
|
||||||
|
@ -97,7 +132,7 @@ Please set the JAVA_HOME variable in your environment to match the
|
||||||
location of your Java installation."
|
location of your Java installation."
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
JAVACMD="java"
|
JAVACMD=java
|
||||||
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
|
|
||||||
Please set the JAVA_HOME variable in your environment to match the
|
Please set the JAVA_HOME variable in your environment to match the
|
||||||
|
@ -105,79 +140,105 @@ location of your Java installation."
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Increase the maximum file descriptors if we can.
|
# Increase the maximum file descriptors if we can.
|
||||||
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
|
if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
|
||||||
MAX_FD_LIMIT=`ulimit -H -n`
|
case $MAX_FD in #(
|
||||||
if [ $? -eq 0 ] ; then
|
max*)
|
||||||
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
|
# In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
|
||||||
MAX_FD="$MAX_FD_LIMIT"
|
# shellcheck disable=SC3045
|
||||||
fi
|
MAX_FD=$( ulimit -H -n ) ||
|
||||||
ulimit -n $MAX_FD
|
warn "Could not query maximum file descriptor limit"
|
||||||
if [ $? -ne 0 ] ; then
|
esac
|
||||||
warn "Could not set maximum file descriptor limit: $MAX_FD"
|
case $MAX_FD in #(
|
||||||
fi
|
'' | soft) :;; #(
|
||||||
else
|
*)
|
||||||
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
|
# In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
|
||||||
fi
|
# shellcheck disable=SC3045
|
||||||
fi
|
ulimit -n "$MAX_FD" ||
|
||||||
|
warn "Could not set maximum file descriptor limit to $MAX_FD"
|
||||||
# For Darwin, add options to specify how the application appears in the dock
|
|
||||||
if $darwin; then
|
|
||||||
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
|
|
||||||
fi
|
|
||||||
|
|
||||||
# For Cygwin or MSYS, switch paths to Windows format before running java
|
|
||||||
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
|
|
||||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
|
||||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
|
||||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
|
||||||
|
|
||||||
# We build the pattern for arguments to be converted via cygpath
|
|
||||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
|
||||||
SEP=""
|
|
||||||
for dir in $ROOTDIRSRAW ; do
|
|
||||||
ROOTDIRS="$ROOTDIRS$SEP$dir"
|
|
||||||
SEP="|"
|
|
||||||
done
|
|
||||||
OURCYGPATTERN="(^($ROOTDIRS))"
|
|
||||||
# Add a user-defined pattern to the cygpath arguments
|
|
||||||
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
|
|
||||||
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
|
|
||||||
fi
|
|
||||||
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
|
||||||
i=0
|
|
||||||
for arg in "$@" ; do
|
|
||||||
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
|
|
||||||
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
|
|
||||||
|
|
||||||
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
|
|
||||||
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
|
|
||||||
else
|
|
||||||
eval `echo args$i`="\"$arg\""
|
|
||||||
fi
|
|
||||||
i=`expr $i + 1`
|
|
||||||
done
|
|
||||||
case $i in
|
|
||||||
0) set -- ;;
|
|
||||||
1) set -- "$args0" ;;
|
|
||||||
2) set -- "$args0" "$args1" ;;
|
|
||||||
3) set -- "$args0" "$args1" "$args2" ;;
|
|
||||||
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
|
|
||||||
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
|
|
||||||
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
|
|
||||||
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
|
|
||||||
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
|
|
||||||
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
|
|
||||||
esac
|
esac
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Escape application args
|
# Collect all arguments for the java command, stacking in reverse order:
|
||||||
save () {
|
# * args from the command line
|
||||||
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
|
# * the main class name
|
||||||
echo " "
|
# * -classpath
|
||||||
}
|
# * -D...appname settings
|
||||||
APP_ARGS=`save "$@"`
|
# * --module-path (only if needed)
|
||||||
|
# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
|
||||||
|
|
||||||
# Collect all arguments for the java command, following the shell quoting and substitution rules
|
# For Cygwin or MSYS, switch paths to Windows format before running java
|
||||||
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
|
if "$cygwin" || "$msys" ; then
|
||||||
|
APP_HOME=$( cygpath --path --mixed "$APP_HOME" )
|
||||||
|
CLASSPATH=$( cygpath --path --mixed "$CLASSPATH" )
|
||||||
|
|
||||||
|
JAVACMD=$( cygpath --unix "$JAVACMD" )
|
||||||
|
|
||||||
|
# Now convert the arguments - kludge to limit ourselves to /bin/sh
|
||||||
|
for arg do
|
||||||
|
if
|
||||||
|
case $arg in #(
|
||||||
|
-*) false ;; # don't mess with options #(
|
||||||
|
/?*) t=${arg#/} t=/${t%%/*} # looks like a POSIX filepath
|
||||||
|
[ -e "$t" ] ;; #(
|
||||||
|
*) false ;;
|
||||||
|
esac
|
||||||
|
then
|
||||||
|
arg=$( cygpath --path --ignore --mixed "$arg" )
|
||||||
|
fi
|
||||||
|
# Roll the args list around exactly as many times as the number of
|
||||||
|
# args, so each arg winds up back in the position where it started, but
|
||||||
|
# possibly modified.
|
||||||
|
#
|
||||||
|
# NB: a `for` loop captures its iteration list before it begins, so
|
||||||
|
# changing the positional parameters here affects neither the number of
|
||||||
|
# iterations, nor the values presented in `arg`.
|
||||||
|
shift # remove old arg
|
||||||
|
set -- "$@" "$arg" # push replacement arg
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Collect all arguments for the java command;
|
||||||
|
# * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of
|
||||||
|
# shell script including quotes and variable substitutions, so put them in
|
||||||
|
# double quotes to make sure that they get re-expanded; and
|
||||||
|
# * put everything else in single quotes, so that it's not re-expanded.
|
||||||
|
|
||||||
|
set -- \
|
||||||
|
"-Dorg.gradle.appname=$APP_BASE_NAME" \
|
||||||
|
-classpath "$CLASSPATH" \
|
||||||
|
org.gradle.wrapper.GradleWrapperMain \
|
||||||
|
"$@"
|
||||||
|
|
||||||
|
# Stop when "xargs" is not available.
|
||||||
|
if ! command -v xargs >/dev/null 2>&1
|
||||||
|
then
|
||||||
|
die "xargs is not available"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Use "xargs" to parse quoted args.
|
||||||
|
#
|
||||||
|
# With -n1 it outputs one arg per line, with the quotes and backslashes removed.
|
||||||
|
#
|
||||||
|
# In Bash we could simply go:
|
||||||
|
#
|
||||||
|
# readarray ARGS < <( xargs -n1 <<<"$var" ) &&
|
||||||
|
# set -- "${ARGS[@]}" "$@"
|
||||||
|
#
|
||||||
|
# but POSIX shell has neither arrays nor command substitution, so instead we
|
||||||
|
# post-process each arg (as a line of input to sed) to backslash-escape any
|
||||||
|
# character that might be a shell metacharacter, then use eval to reverse
|
||||||
|
# that process (while maintaining the separation between arguments), and wrap
|
||||||
|
# the whole thing up as a single "set" statement.
|
||||||
|
#
|
||||||
|
# This will of course break if any of these variables contains a newline or
|
||||||
|
# an unmatched quote.
|
||||||
|
#
|
||||||
|
|
||||||
|
eval "set -- $(
|
||||||
|
printf '%s\n' "$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS" |
|
||||||
|
xargs -n1 |
|
||||||
|
sed ' s~[^-[:alnum:]+,./:=@_]~\\&~g; ' |
|
||||||
|
tr '\n' ' '
|
||||||
|
)" '"$@"'
|
||||||
|
|
||||||
exec "$JAVACMD" "$@"
|
exec "$JAVACMD" "$@"
|
||||||
|
|
|
@ -1,100 +1,92 @@
|
||||||
@rem
|
@rem
|
||||||
@rem Copyright 2015 the original author or authors.
|
@rem Copyright 2015 the original author or authors.
|
||||||
@rem
|
@rem
|
||||||
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
@rem Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
@rem you may not use this file except in compliance with the License.
|
@rem you may not use this file except in compliance with the License.
|
||||||
@rem You may obtain a copy of the License at
|
@rem You may obtain a copy of the License at
|
||||||
@rem
|
@rem
|
||||||
@rem https://www.apache.org/licenses/LICENSE-2.0
|
@rem https://www.apache.org/licenses/LICENSE-2.0
|
||||||
@rem
|
@rem
|
||||||
@rem Unless required by applicable law or agreed to in writing, software
|
@rem Unless required by applicable law or agreed to in writing, software
|
||||||
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
@rem distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
@rem See the License for the specific language governing permissions and
|
@rem See the License for the specific language governing permissions and
|
||||||
@rem limitations under the License.
|
@rem limitations under the License.
|
||||||
@rem
|
@rem
|
||||||
|
|
||||||
@if "%DEBUG%" == "" @echo off
|
@if "%DEBUG%"=="" @echo off
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
@rem
|
@rem
|
||||||
@rem Gradle startup script for Windows
|
@rem Gradle startup script for Windows
|
||||||
@rem
|
@rem
|
||||||
@rem ##########################################################################
|
@rem ##########################################################################
|
||||||
|
|
||||||
@rem Set local scope for the variables with windows NT shell
|
@rem Set local scope for the variables with windows NT shell
|
||||||
if "%OS%"=="Windows_NT" setlocal
|
if "%OS%"=="Windows_NT" setlocal
|
||||||
|
|
||||||
set DIRNAME=%~dp0
|
set DIRNAME=%~dp0
|
||||||
if "%DIRNAME%" == "" set DIRNAME=.
|
if "%DIRNAME%"=="" set DIRNAME=.
|
||||||
set APP_BASE_NAME=%~n0
|
@rem This is normally unused
|
||||||
set APP_HOME=%DIRNAME%
|
set APP_BASE_NAME=%~n0
|
||||||
|
set APP_HOME=%DIRNAME%
|
||||||
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
|
||||||
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
|
||||||
|
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
|
||||||
@rem Find java.exe
|
|
||||||
if defined JAVA_HOME goto findJavaFromJavaHome
|
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
|
||||||
|
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
|
||||||
set JAVA_EXE=java.exe
|
|
||||||
%JAVA_EXE% -version >NUL 2>&1
|
@rem Find java.exe
|
||||||
if "%ERRORLEVEL%" == "0" goto init
|
if defined JAVA_HOME goto findJavaFromJavaHome
|
||||||
|
|
||||||
echo.
|
set JAVA_EXE=java.exe
|
||||||
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
%JAVA_EXE% -version >NUL 2>&1
|
||||||
echo.
|
if %ERRORLEVEL% equ 0 goto execute
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
|
||||||
goto fail
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
:findJavaFromJavaHome
|
echo location of your Java installation.
|
||||||
set JAVA_HOME=%JAVA_HOME:"=%
|
|
||||||
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
goto fail
|
||||||
|
|
||||||
if exist "%JAVA_EXE%" goto init
|
:findJavaFromJavaHome
|
||||||
|
set JAVA_HOME=%JAVA_HOME:"=%
|
||||||
echo.
|
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
|
||||||
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
|
||||||
echo.
|
if exist "%JAVA_EXE%" goto execute
|
||||||
echo Please set the JAVA_HOME variable in your environment to match the
|
|
||||||
echo location of your Java installation.
|
echo.
|
||||||
|
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
|
||||||
goto fail
|
echo.
|
||||||
|
echo Please set the JAVA_HOME variable in your environment to match the
|
||||||
:init
|
echo location of your Java installation.
|
||||||
@rem Get command-line arguments, handling Windows variants
|
|
||||||
|
goto fail
|
||||||
if not "%OS%" == "Windows_NT" goto win9xME_args
|
|
||||||
|
:execute
|
||||||
:win9xME_args
|
@rem Setup the command line
|
||||||
@rem Slurp the command line arguments.
|
|
||||||
set CMD_LINE_ARGS=
|
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
||||||
set _SKIP=2
|
|
||||||
|
|
||||||
:win9xME_args_slurp
|
@rem Execute Gradle
|
||||||
if "x%~1" == "x" goto execute
|
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
|
||||||
|
|
||||||
set CMD_LINE_ARGS=%*
|
:end
|
||||||
|
@rem End local scope for the variables with windows NT shell
|
||||||
:execute
|
if %ERRORLEVEL% equ 0 goto mainEnd
|
||||||
@rem Setup the command line
|
|
||||||
|
:fail
|
||||||
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
|
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
||||||
|
rem the _cmd.exe /c_ return code!
|
||||||
@rem Execute Gradle
|
set EXIT_CODE=%ERRORLEVEL%
|
||||||
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
|
if %EXIT_CODE% equ 0 set EXIT_CODE=1
|
||||||
|
if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
|
||||||
:end
|
exit /b %EXIT_CODE%
|
||||||
@rem End local scope for the variables with windows NT shell
|
|
||||||
if "%ERRORLEVEL%"=="0" goto mainEnd
|
:mainEnd
|
||||||
|
if "%OS%"=="Windows_NT" endlocal
|
||||||
:fail
|
|
||||||
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
|
:omega
|
||||||
rem the _cmd.exe /c_ return code!
|
|
||||||
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
|
|
||||||
exit /b 1
|
|
||||||
|
|
||||||
:mainEnd
|
|
||||||
if "%OS%"=="Windows_NT" endlocal
|
|
||||||
|
|
||||||
:omega
|
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
{
|
||||||
|
"devDependencies": {
|
||||||
|
"conventional-changelog-angular": "5.0.13",
|
||||||
|
"@auto-it/conventional-commits": "10.37.6",
|
||||||
|
"@auto-it/exec": "10.37.6",
|
||||||
|
"@auto-it/first-time-contributor": "10.37.6",
|
||||||
|
"@auto-it/gradle": "10.37.6",
|
||||||
|
"@auto-it/released": "10.37.6",
|
||||||
|
"@auto-it/upload-assets": "10.37.6",
|
||||||
|
"auto": "10.37.6"
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,15 @@
|
||||||
|
{
|
||||||
|
"extends": [
|
||||||
|
"config:base"
|
||||||
|
],
|
||||||
|
"packageRules": [
|
||||||
|
{
|
||||||
|
"commitMessagePrefix": "chore(deps):",
|
||||||
|
"matchUpdateTypes": ["minor", "patch"],
|
||||||
|
"automerge": true,
|
||||||
|
"automergeType": "branch",
|
||||||
|
"groupName": "Deps",
|
||||||
|
"schedule": ["every weekend"]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -6,6 +6,7 @@ import com.sekwah.advancedportals.bukkit.config.ConfigAccessor;
|
||||||
import com.sekwah.advancedportals.bukkit.listeners.Listeners;
|
import com.sekwah.advancedportals.bukkit.listeners.Listeners;
|
||||||
import com.sekwah.advancedportals.bukkit.portals.AdvancedPortal;
|
import com.sekwah.advancedportals.bukkit.portals.AdvancedPortal;
|
||||||
import com.sekwah.advancedportals.bukkit.portals.Portal;
|
import com.sekwah.advancedportals.bukkit.portals.Portal;
|
||||||
|
import com.sekwah.advancedportals.bukkit.util.WorldEditIntegration;
|
||||||
import net.md_5.bungee.api.ChatColor;
|
import net.md_5.bungee.api.ChatColor;
|
||||||
import net.md_5.bungee.api.chat.*;
|
import net.md_5.bungee.api.chat.*;
|
||||||
import org.bukkit.*;
|
import org.bukkit.*;
|
||||||
|
@ -54,6 +55,15 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||||
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
|
ConfigAccessor portalConfig = new ConfigAccessor(plugin, "portals.yml");
|
||||||
if (!(sender instanceof Player)) {
|
if (!(sender instanceof Player)) {
|
||||||
|
if(args.length == 1) {
|
||||||
|
if(args[0].equalsIgnoreCase("reload")) {
|
||||||
|
Listeners.reloadValues(plugin);
|
||||||
|
Portal.loadPortals();
|
||||||
|
sender.sendMessage("portal reloaded.");
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
sender.sendMessage(PluginMessages.customPrefixFail + " You cannot use commands with the console.");
|
sender.sendMessage(PluginMessages.customPrefixFail + " You cannot use commands with the console.");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -120,6 +130,11 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
break;
|
break;
|
||||||
case "wand":
|
case "wand":
|
||||||
case "selector":
|
case "selector":
|
||||||
|
if (plugin.isWorldEditActive()) {
|
||||||
|
sender.sendMessage(PluginMessages.customPrefix
|
||||||
|
+ " Use the WorldEdit wand to select stuff. Checkout //wand.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
String ItemID = config.getConfig().getString("AxeItemId");
|
String ItemID = config.getConfig().getString("AxeItemId");
|
||||||
|
|
||||||
Material WandMaterial = Material.getMaterial(ItemID);
|
Material WandMaterial = Material.getMaterial(ItemID);
|
||||||
|
@ -187,244 +202,7 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
PluginMessages.customPrefix + " You have been given a \u00A7ePortal Block\u00A7a!");
|
PluginMessages.customPrefix + " You have been given a \u00A7ePortal Block\u00A7a!");
|
||||||
break;
|
break;
|
||||||
case "create":
|
case "create":
|
||||||
if (player.hasMetadata("Pos1World") && player.hasMetadata("Pos2World")) {
|
return createPortalRequest(player, args);
|
||||||
if (player.getMetadata("Pos1World").get(0).asString()
|
|
||||||
.equals(player.getMetadata("Pos2World").get(0).asString())
|
|
||||||
&& player.getMetadata("Pos1World").get(0).asString()
|
|
||||||
.equals(player.getLocation().getWorld().getName())) {
|
|
||||||
if (args.length >= 2) { // may make this next piece of code more efficient, maybe check
|
|
||||||
// against a list of available variables or something
|
|
||||||
// TODO change system to use arrays and hashmaps
|
|
||||||
boolean hasName = false;
|
|
||||||
boolean hasTriggerBlock = false;
|
|
||||||
boolean hasDestination = false;
|
|
||||||
boolean isBungeePortal = false;
|
|
||||||
boolean needsPermission = false;
|
|
||||||
boolean executesCommand = false;
|
|
||||||
String destination = null;
|
|
||||||
String portalName = null;
|
|
||||||
String triggerBlock = null;
|
|
||||||
String serverName = null;
|
|
||||||
String permission = null;
|
|
||||||
String portalCommand = null;
|
|
||||||
|
|
||||||
ArrayList<PortalArg> extraData = new ArrayList<>();
|
|
||||||
|
|
||||||
// Is completely changed in the recode but for now im leaving it as this
|
|
||||||
// horrible mess...
|
|
||||||
for (int i = 1; i < args.length; i++) {
|
|
||||||
if (startsWithPortalArg("name:", args[i])) {
|
|
||||||
portalName = args[i].replaceFirst("name:", "");
|
|
||||||
if (portalName.equals("")) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You must include a name for the portal that isnt nothing!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
hasName = true;
|
|
||||||
portalName = args[i].replaceFirst("name:", "");
|
|
||||||
} else if (startsWithPortalArg("destination:", args[i])) {
|
|
||||||
hasDestination = true;
|
|
||||||
destination = args[i].toLowerCase().replaceFirst("destination:", "");
|
|
||||||
} else if (startsWithPortalArg("desti:", args[i])) {
|
|
||||||
hasDestination = true;
|
|
||||||
destination = args[i].toLowerCase().replaceFirst("desti:", "");
|
|
||||||
} else if (startsWithPortalArg("triggerblock:", args[i])) {
|
|
||||||
hasTriggerBlock = true;
|
|
||||||
triggerBlock = args[i].toLowerCase().replaceFirst("triggerblock:", "");
|
|
||||||
} else if (this.startsWithPortalArg("bungee:", args[i])) {
|
|
||||||
isBungeePortal = true;
|
|
||||||
serverName = args[i].substring("bungee:".length());
|
|
||||||
} else if (startsWithPortalArg("permission:", args[i])) {
|
|
||||||
needsPermission = true;
|
|
||||||
permission = args[i].toLowerCase().replaceFirst("permission:", "");
|
|
||||||
extraData.add(new PortalArg("permission", permission));
|
|
||||||
} else if (startsWithPortalArg("delayed:", args[i])) {
|
|
||||||
boolean delayed = Boolean
|
|
||||||
.parseBoolean(args[i].toLowerCase().replaceFirst("delayed:", ""));
|
|
||||||
extraData.add(new PortalArg("delayed", Boolean.toString(delayed)));
|
|
||||||
} else if (startsWithPortalArg("message:", args[i])) {
|
|
||||||
String message = parseArgVariable(args, i, "message:");
|
|
||||||
if (message == null) {
|
|
||||||
player.sendMessage(
|
|
||||||
PluginMessages.customPrefixFail + " Message quotes not closed!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
extraData.add(new PortalArg("message", message));
|
|
||||||
} else if (startsWithPortalArg("command:", args[i])) {
|
|
||||||
executesCommand = true;
|
|
||||||
portalCommand = parseArgVariable(args, i, "command:");
|
|
||||||
if (portalCommand == null) {
|
|
||||||
player.sendMessage(
|
|
||||||
PluginMessages.customPrefixFail + " Command quotes not closed!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
i += this.portalArgsStringLength - 1;
|
|
||||||
if (portalCommand.startsWith("#")
|
|
||||||
&& !(this.plugin.getSettings().enabledCommandLevel("c")
|
|
||||||
&& (sender.hasPermission(
|
|
||||||
"advancedportals.createportal.commandlevel.console")
|
|
||||||
|| sender.isOp()))) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need permission to make a console command portal!");
|
|
||||||
return true;
|
|
||||||
} else if (portalCommand.startsWith("!")
|
|
||||||
&& !(this.plugin.getSettings().enabledCommandLevel("o")
|
|
||||||
&& (sender.hasPermission(
|
|
||||||
"advancedportals.createportal.commandlevel.op")
|
|
||||||
|| sender.isOp()))) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need permission to make a op command portal!");
|
|
||||||
return true;
|
|
||||||
} else if (portalCommand.startsWith("%")
|
|
||||||
&& !(this.plugin.getSettings().enabledCommandLevel("b")
|
|
||||||
&& (sender.hasPermission(
|
|
||||||
"advancedportals.createportal.commandlevel.bungee")
|
|
||||||
|| sender.isOp()))) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need permission to make a bungee command portal!");
|
|
||||||
return true;
|
|
||||||
} else if (portalCommand.startsWith("^")
|
|
||||||
&& !(this.plugin.getSettings().enabledCommandLevel("p")
|
|
||||||
&& (sender.hasPermission(
|
|
||||||
"advancedportals.createportal.commandlevel.perms")
|
|
||||||
|| sender.isOp()))) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need permission to make a all perms command portal!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
extraData.add(new PortalArg("command.1", portalCommand));
|
|
||||||
} else if (startsWithPortalArg("cooldowndelay:", args[i])) {
|
|
||||||
String cooldownDelay = parseArgVariable(args, i, "cooldowndelay:");
|
|
||||||
extraData.add(new PortalArg("cooldowndelay", cooldownDelay));
|
|
||||||
} else if (startsWithPortalArg("leavedesti:", args[i])) {
|
|
||||||
String leaveDesti = parseArgVariable(args, i, "leavedesti:");
|
|
||||||
extraData.add(new PortalArg("leavedesti", leaveDesti));
|
|
||||||
} else if (startsWithPortalArg("particlein:", args[i])) {
|
|
||||||
String value = parseArgVariable(args, i, "particlein:");
|
|
||||||
extraData.add(new PortalArg("particlein", value));
|
|
||||||
} else if (startsWithPortalArg("particleout:", args[i])) {
|
|
||||||
String value = parseArgVariable(args, i, "particleout:");
|
|
||||||
extraData.add(new PortalArg("particleout", value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (!hasName) {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You must include a name for the portal that you are creating in the variables!");
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
World world = org.bukkit.Bukkit
|
|
||||||
.getWorld(player.getMetadata("Pos1World").get(0).asString());
|
|
||||||
Location pos1 = new Location(world, player.getMetadata("Pos1X").get(0).asInt(),
|
|
||||||
player.getMetadata("Pos1Y").get(0).asInt(),
|
|
||||||
player.getMetadata("Pos1Z").get(0).asInt());
|
|
||||||
Location pos2 = new Location(world, player.getMetadata("Pos2X").get(0).asInt(),
|
|
||||||
player.getMetadata("Pos2Y").get(0).asInt(),
|
|
||||||
player.getMetadata("Pos2Z").get(0).asInt());
|
|
||||||
|
|
||||||
ConfigAccessor desticonfig = new ConfigAccessor(plugin, "destinations.yml");
|
|
||||||
String destiPosX = desticonfig.getConfig().getString(destination + ".pos.X");
|
|
||||||
|
|
||||||
if (!Portal.portalExists(portalName)) {
|
|
||||||
|
|
||||||
player.sendMessage("");
|
|
||||||
player.sendMessage(PluginMessages.customPrefix
|
|
||||||
+ "\u00A7e You have created a new portal with the following details:");
|
|
||||||
player.sendMessage("\u00A7aname: \u00A7e" + portalName);
|
|
||||||
if (hasDestination) {
|
|
||||||
if (!isBungeePortal && destiPosX == null) {
|
|
||||||
player.sendMessage("\u00A7cdestination: \u00A7e" + destination
|
|
||||||
+ " (destination does not exist)");
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
player.sendMessage("\u00A7adestination: \u00A7e" + destination);
|
|
||||||
}
|
|
||||||
|
|
||||||
} else {
|
|
||||||
player.sendMessage(
|
|
||||||
"\u00A7cdestination: \u00A7eN/A (will not teleport to a location)");
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isBungeePortal) {
|
|
||||||
player.sendMessage("\u00A7abungee: \u00A7e" + serverName);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (needsPermission) {
|
|
||||||
player.sendMessage("\u00A7apermission: \u00A7e" + permission);
|
|
||||||
} else {
|
|
||||||
player.sendMessage("\u00A7apermission: \u00A7e(none needed)");
|
|
||||||
}
|
|
||||||
|
|
||||||
for (PortalArg portalArg : extraData) {
|
|
||||||
if (!ignoreExtras.contains(portalArg.argName)) {
|
|
||||||
player.sendMessage(
|
|
||||||
"\u00A7a" + portalArg.argName + ": \u00A7e" + portalArg.value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (executesCommand) {
|
|
||||||
player.sendMessage("\u00A7acommand: \u00A7e" + portalCommand);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (hasTriggerBlock) {
|
|
||||||
Set<Material> materialSet = Portal
|
|
||||||
.getMaterialSet(triggerBlock.toUpperCase().split(","));
|
|
||||||
if (materialSet.size() != 0) {
|
|
||||||
player.sendMessage(
|
|
||||||
"\u00A7atriggerBlock: \u00A7e" + triggerBlock.toUpperCase());
|
|
||||||
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
|
||||||
portalArgs = extraData.toArray(portalArgs);
|
|
||||||
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
|
||||||
materialSet, serverName, portalArgs));
|
|
||||||
if(materialSet.contains(Material.END_GATEWAY)) {
|
|
||||||
AdvancedPortal portal = Portal.getPortal(portalName);
|
|
||||||
if(portal != null) {
|
|
||||||
disableBeacons(portal);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
|
||||||
player.sendMessage("\u00A7ctriggerBlock: \u00A7edefault("
|
|
||||||
+ Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
|
||||||
|
|
||||||
player.sendMessage("\u00A7c" + triggerBlock.toUpperCase()
|
|
||||||
+ " no valid blocks were listed so the default has been set.");
|
|
||||||
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
|
||||||
portalArgs = extraData.toArray(portalArgs);
|
|
||||||
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
|
||||||
serverName, portalArgs));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
|
||||||
player.sendMessage("\u00A7atriggerBlock: \u00A7edefault("
|
|
||||||
+ Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
|
||||||
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
|
||||||
portalArgs = extraData.toArray(portalArgs);
|
|
||||||
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
|
||||||
serverName, portalArgs));
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
sender.sendMessage(
|
|
||||||
PluginMessages.customPrefixFail + " A portal by that name already exists!");
|
|
||||||
}
|
|
||||||
|
|
||||||
// add code to save the portal to the portal config and reload the portals
|
|
||||||
|
|
||||||
player.sendMessage("");
|
|
||||||
} else {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need to at least add the name of the portal as a variable, \u00A7cType \u00A7e/portal variables\u00A7c"
|
|
||||||
+ " for a full list of currently available variables and an example command!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " The points you have selected need to be in the same world!");
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
player.sendMessage(PluginMessages.customPrefixFail
|
|
||||||
+ " You need to have two points selected to make a portal!");
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case "variables":
|
case "variables":
|
||||||
sender.sendMessage(
|
sender.sendMessage(
|
||||||
PluginMessages.customPrefix +
|
PluginMessages.customPrefix +
|
||||||
|
@ -631,6 +409,14 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
case "help":
|
case "help":
|
||||||
helpCommand(sender, command, args);
|
helpCommand(sender, command, args);
|
||||||
break;
|
break;
|
||||||
|
case "bukkitpage":
|
||||||
|
sender.sendMessage(
|
||||||
|
PluginMessages.customPrefix + " Bukkit Page: http://dev.bukkit.org/bukkit-plugins/advanced-portals/");
|
||||||
|
break;
|
||||||
|
case "helppage":
|
||||||
|
sender.sendMessage(
|
||||||
|
PluginMessages.customPrefix + " Help Page: https://www.guilded.gg/Sekwah/groups/MDqAZyrD/channels/72ffdaa3-9273-4722-bf47-b75408b371af/docs/1090356006");
|
||||||
|
break;
|
||||||
case "show":
|
case "show":
|
||||||
if (args.length > 1) {
|
if (args.length > 1) {
|
||||||
String posX = portalConfig.getConfig().getString(args[1] + ".pos1.X");
|
String posX = portalConfig.getConfig().getString(args[1] + ".pos1.X");
|
||||||
|
@ -658,6 +444,24 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case "we-selection":
|
||||||
|
if (!Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail + " WorldEdit is not enabled.");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (args.length <= 1) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail + " Specify a portal name!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
AdvancedPortal wePortal = Portal.getPortal(args[1]);
|
||||||
|
if (wePortal == null) {
|
||||||
|
sender.sendMessage(PluginMessages.customPrefixFail + " No portal by that name exists!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
WorldEditIntegration.explainRegion(player, wePortal.getPos1(), wePortal.getPos2());
|
||||||
|
player.sendMessage(PluginMessages.customPrefix
|
||||||
|
+ " The portal has been selected with worldedit!");
|
||||||
|
break;
|
||||||
case "reload":
|
case "reload":
|
||||||
sender.sendMessage(PluginMessages.customPrefix + " Reloaded values!");
|
sender.sendMessage(PluginMessages.customPrefix + " Reloaded values!");
|
||||||
Listeners.reloadValues(plugin);
|
Listeners.reloadValues(plugin);
|
||||||
|
@ -711,6 +515,272 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private boolean checkValidSelection(Player player) {
|
||||||
|
if (plugin.isWorldEditActive()) {
|
||||||
|
if (!WorldEditIntegration.validateSelection(player)) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " Your WorldEdit selection is invalid!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!player.hasMetadata("Pos1World") || !player.hasMetadata("Pos2World")) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need to have two points selected to make a portal!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (!player.getMetadata("Pos1World").get(0).asString()
|
||||||
|
.equals(player.getMetadata("Pos2World").get(0).asString())
|
||||||
|
|| !player.getMetadata("Pos1World").get(0).asString()
|
||||||
|
.equals(player.getLocation().getWorld().getName())) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " The points you have selected need to be in the same world as each other and yourself!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean createPortalRequest(Player player, String[] args) {
|
||||||
|
if (!checkValidSelection(player)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (args.length < 2) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need to at least add the name of the portal as a variable, \u00A7cType \u00A7e/portal variables\u00A7c"
|
||||||
|
+ " for a full list of currently available variables and an example command!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// may make this next piece of code more efficient, maybe check
|
||||||
|
// against a list of available variables or something
|
||||||
|
// TODO change system to use arrays and hashmaps
|
||||||
|
boolean hasName = false;
|
||||||
|
boolean hasTriggerBlock = false;
|
||||||
|
boolean hasDestination = false;
|
||||||
|
boolean isBungeePortal = false;
|
||||||
|
boolean needsPermission = false;
|
||||||
|
boolean executesCommand = false;
|
||||||
|
String destination = null;
|
||||||
|
String portalName = null;
|
||||||
|
String triggerBlock = null;
|
||||||
|
String serverName = null;
|
||||||
|
String permission = null;
|
||||||
|
String portalCommand = null;
|
||||||
|
|
||||||
|
ArrayList<PortalArg> extraData = new ArrayList<>();
|
||||||
|
|
||||||
|
// Is completely changed in the recode but for now im leaving it as this
|
||||||
|
// horrible mess...
|
||||||
|
for (int i = 1; i < args.length; i++) {
|
||||||
|
if (startsWithPortalArg("name:", args[i])) {
|
||||||
|
portalName = args[i].replaceFirst("name:", "");
|
||||||
|
if (portalName.equals("")) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You must include a name for the portal that isnt nothing!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
hasName = true;
|
||||||
|
portalName = args[i].replaceFirst("name:", "");
|
||||||
|
} else if (startsWithPortalArg("destination:", args[i])) {
|
||||||
|
hasDestination = true;
|
||||||
|
destination = args[i].toLowerCase().replaceFirst("destination:", "");
|
||||||
|
} else if (startsWithPortalArg("desti:", args[i])) {
|
||||||
|
hasDestination = true;
|
||||||
|
destination = args[i].toLowerCase().replaceFirst("desti:", "");
|
||||||
|
} else if (startsWithPortalArg("triggerblock:", args[i])) {
|
||||||
|
hasTriggerBlock = true;
|
||||||
|
triggerBlock = args[i].toLowerCase().replaceFirst("triggerblock:", "");
|
||||||
|
} else if (this.startsWithPortalArg("bungee:", args[i])) {
|
||||||
|
isBungeePortal = true;
|
||||||
|
serverName = args[i].substring("bungee:".length());
|
||||||
|
} else if (startsWithPortalArg("permission:", args[i])) {
|
||||||
|
needsPermission = true;
|
||||||
|
permission = args[i].toLowerCase().replaceFirst("permission:", "");
|
||||||
|
extraData.add(new PortalArg("permission", permission));
|
||||||
|
} else if (startsWithPortalArg("delayed:", args[i])) {
|
||||||
|
boolean delayed = Boolean
|
||||||
|
.parseBoolean(args[i].toLowerCase().replaceFirst("delayed:", ""));
|
||||||
|
extraData.add(new PortalArg("delayed", Boolean.toString(delayed)));
|
||||||
|
} else if (startsWithPortalArg("message:", args[i])) {
|
||||||
|
String message = parseArgVariable(args, i, "message:");
|
||||||
|
if (message == null) {
|
||||||
|
player.sendMessage(
|
||||||
|
PluginMessages.customPrefixFail + " Message quotes not closed!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
extraData.add(new PortalArg("message", message));
|
||||||
|
} else if (startsWithPortalArg("command:", args[i])) {
|
||||||
|
executesCommand = true;
|
||||||
|
portalCommand = parseArgVariable(args, i, "command:");
|
||||||
|
if (portalCommand == null) {
|
||||||
|
player.sendMessage(
|
||||||
|
PluginMessages.customPrefixFail + " Command quotes not closed!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
i += this.portalArgsStringLength - 1;
|
||||||
|
if (portalCommand.startsWith("#")
|
||||||
|
&& !(this.plugin.getSettings().enabledCommandLevel("c")
|
||||||
|
&& (player.hasPermission(
|
||||||
|
"advancedportals.createportal.commandlevel.console")
|
||||||
|
|| player.isOp()))) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need permission to make a console command portal!");
|
||||||
|
return true;
|
||||||
|
} else if (portalCommand.startsWith("!")
|
||||||
|
&& !(this.plugin.getSettings().enabledCommandLevel("o")
|
||||||
|
&& (player.hasPermission(
|
||||||
|
"advancedportals.createportal.commandlevel.op")
|
||||||
|
|| player.isOp()))) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need permission to make a op command portal!");
|
||||||
|
return true;
|
||||||
|
} else if (portalCommand.startsWith("%")
|
||||||
|
&& !(this.plugin.getSettings().enabledCommandLevel("b")
|
||||||
|
&& (player.hasPermission(
|
||||||
|
"advancedportals.createportal.commandlevel.bungee")
|
||||||
|
|| player.isOp()))) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need permission to make a bungee command portal!");
|
||||||
|
return true;
|
||||||
|
} else if (portalCommand.startsWith("^")
|
||||||
|
&& !(this.plugin.getSettings().enabledCommandLevel("p")
|
||||||
|
&& (player.hasPermission(
|
||||||
|
"advancedportals.createportal.commandlevel.perms")
|
||||||
|
|| player.isOp()))) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You need permission to make a all perms command portal!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
extraData.add(new PortalArg("command.1", portalCommand));
|
||||||
|
} else if (startsWithPortalArg("cooldowndelay:", args[i])) {
|
||||||
|
String cooldownDelay = parseArgVariable(args, i, "cooldowndelay:");
|
||||||
|
extraData.add(new PortalArg("cooldowndelay", cooldownDelay));
|
||||||
|
} else if (startsWithPortalArg("leavedesti:", args[i])) {
|
||||||
|
String leaveDesti = parseArgVariable(args, i, "leavedesti:");
|
||||||
|
extraData.add(new PortalArg("leavedesti", leaveDesti));
|
||||||
|
} else if (startsWithPortalArg("particlein:", args[i])) {
|
||||||
|
String value = parseArgVariable(args, i, "particlein:");
|
||||||
|
extraData.add(new PortalArg("particlein", value));
|
||||||
|
} else if (startsWithPortalArg("particleout:", args[i])) {
|
||||||
|
String value = parseArgVariable(args, i, "particleout:");
|
||||||
|
extraData.add(new PortalArg("particleout", value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!hasName) {
|
||||||
|
player.sendMessage(PluginMessages.customPrefixFail
|
||||||
|
+ " You must include a name for the portal that you are creating in the variables!");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
Location pos1, pos2;
|
||||||
|
if (plugin.isWorldEditActive()) {
|
||||||
|
pos1 = WorldEditIntegration.getPos1(player);
|
||||||
|
pos2 = WorldEditIntegration.getPos2(player);
|
||||||
|
} else {
|
||||||
|
World world = Bukkit
|
||||||
|
.getWorld(player.getMetadata("Pos1World").get(0).asString());
|
||||||
|
pos1 = new Location(world, player.getMetadata("Pos1X").get(0).asInt(),
|
||||||
|
player.getMetadata("Pos1Y").get(0).asInt(),
|
||||||
|
player.getMetadata("Pos1Z").get(0).asInt());
|
||||||
|
pos2 = new Location(world, player.getMetadata("Pos2X").get(0).asInt(),
|
||||||
|
player.getMetadata("Pos2Y").get(0).asInt(),
|
||||||
|
player.getMetadata("Pos2Z").get(0).asInt());
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigAccessor desticonfig = new ConfigAccessor(plugin, "destinations.yml");
|
||||||
|
String destiPosX = desticonfig.getConfig().getString(destination + ".pos.X");
|
||||||
|
|
||||||
|
if (!Portal.portalExists(portalName)) {
|
||||||
|
|
||||||
|
player.sendMessage("");
|
||||||
|
player.sendMessage(PluginMessages.customPrefix
|
||||||
|
+ "\u00A7e You have created a new portal with the following details:");
|
||||||
|
player.sendMessage("\u00A7aname: \u00A7e" + portalName);
|
||||||
|
if (hasDestination) {
|
||||||
|
if (!isBungeePortal && destiPosX == null) {
|
||||||
|
player.sendMessage("\u00A7cdestination: \u00A7e" + destination
|
||||||
|
+ " (destination does not exist)");
|
||||||
|
return true;
|
||||||
|
} else {
|
||||||
|
player.sendMessage("\u00A7adestination: \u00A7e" + destination);
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
player.sendMessage(
|
||||||
|
"\u00A7cdestination: \u00A7eN/A (will not teleport to a location)");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isBungeePortal) {
|
||||||
|
player.sendMessage("\u00A7abungee: \u00A7e" + serverName);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (needsPermission) {
|
||||||
|
player.sendMessage("\u00A7apermission: \u00A7e" + permission);
|
||||||
|
} else {
|
||||||
|
player.sendMessage("\u00A7apermission: \u00A7e(none needed)");
|
||||||
|
}
|
||||||
|
|
||||||
|
for (PortalArg portalArg : extraData) {
|
||||||
|
if (!ignoreExtras.contains(portalArg.argName)) {
|
||||||
|
player.sendMessage(
|
||||||
|
"\u00A7a" + portalArg.argName + ": \u00A7e" + portalArg.value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (executesCommand) {
|
||||||
|
player.sendMessage("\u00A7acommand: \u00A7e" + portalCommand);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (hasTriggerBlock) {
|
||||||
|
Set<Material> materialSet = Portal
|
||||||
|
.getMaterialSet(triggerBlock.toUpperCase().split(","));
|
||||||
|
if (materialSet.size() != 0) {
|
||||||
|
player.sendMessage(
|
||||||
|
"\u00A7atriggerBlock: \u00A7e" + triggerBlock.toUpperCase());
|
||||||
|
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
||||||
|
portalArgs = extraData.toArray(portalArgs);
|
||||||
|
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
||||||
|
materialSet, serverName, portalArgs));
|
||||||
|
if(materialSet.contains(Material.END_GATEWAY)) {
|
||||||
|
AdvancedPortal portal = Portal.getPortal(portalName);
|
||||||
|
if(portal != null) {
|
||||||
|
disableBeacons(portal);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
||||||
|
player.sendMessage("\u00A7ctriggerBlock: \u00A7edefault("
|
||||||
|
+ Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
||||||
|
|
||||||
|
player.sendMessage("\u00A7c" + triggerBlock.toUpperCase()
|
||||||
|
+ " no valid blocks were listed so the default has been set.");
|
||||||
|
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
||||||
|
portalArgs = extraData.toArray(portalArgs);
|
||||||
|
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
||||||
|
serverName, portalArgs));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
ConfigAccessor Config = new ConfigAccessor(plugin, "config.yml");
|
||||||
|
player.sendMessage("\u00A7atriggerBlock: \u00A7edefault("
|
||||||
|
+ Config.getConfig().getString("DefaultPortalTriggerBlock") + ")");
|
||||||
|
PortalArg[] portalArgs = new PortalArg[extraData.size()];
|
||||||
|
portalArgs = extraData.toArray(portalArgs);
|
||||||
|
player.sendMessage(Portal.create(pos1, pos2, portalName, destination,
|
||||||
|
serverName, portalArgs));
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
player.sendMessage(
|
||||||
|
PluginMessages.customPrefixFail + " A portal by that name already exists!");
|
||||||
|
}
|
||||||
|
|
||||||
|
// add code to save the portal to the portal config and reload the portals
|
||||||
|
|
||||||
|
player.sendMessage("");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private boolean startsWithPortalArg(String portalArg, String arg) {
|
private boolean startsWithPortalArg(String portalArg, String arg) {
|
||||||
return arg.toLowerCase().startsWith(portalArg) && arg.length() > portalArg.length();
|
return arg.toLowerCase().startsWith(portalArg) && arg.length() > portalArg.length();
|
||||||
}
|
}
|
||||||
|
@ -718,7 +788,8 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
private void helpCommand(CommandSender sender, String command, String[] args) {
|
private void helpCommand(CommandSender sender, String command, String[] args) {
|
||||||
// Add pages if there starts to become too many
|
// Add pages if there starts to become too many
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
sendMenu(sender, "Help Menu", "\u00A76/" + command + " selector \u00A7a- gives you a region selector",
|
sendMenu(sender, "Help Menu",
|
||||||
|
"\u00A76/" + command + " selector \u00A7a- gives you a region selector",
|
||||||
"\u00A76/" + command + " create \u00A7c[tags] \u00A7a- creates a portal with a selection ",
|
"\u00A76/" + command + " create \u00A7c[tags] \u00A7a- creates a portal with a selection ",
|
||||||
"\u00A76/" + command + " portalblock \u00A7a- gives you a portal block",
|
"\u00A76/" + command + " portalblock \u00A7a- gives you a portal block",
|
||||||
"\u00A76/" + command + " endportalblock \u00A7a- gives you an end portal block",
|
"\u00A76/" + command + " endportalblock \u00A7a- gives you an end portal block",
|
||||||
|
@ -889,8 +960,14 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
if (sender.hasPermission("advancedportals.createportal")) {
|
if (sender.hasPermission("advancedportals.createportal")) {
|
||||||
if (args.length == 1 || (args.length == 2 && args[0].equalsIgnoreCase("help"))) {
|
if (args.length == 1 || (args.length == 2 && args[0].equalsIgnoreCase("help"))) {
|
||||||
autoComplete.addAll(Arrays.asList("create", "list", "portalblock", "select", "unselect", "command",
|
autoComplete.addAll(Arrays.asList("create", "list", "portalblock", "select", "unselect", "command",
|
||||||
"selector", "show", "gatewayblock", "endportalblock", "variables", "wand", "disablebeacon", "remove", "rename",
|
"show", "gatewayblock", "endportalblock", "variables", "disablebeacon", "remove", "rename",
|
||||||
"help", "bukkitpage", "helppage"));
|
"help", "bukkitpage", "helppage"));
|
||||||
|
if (Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
|
||||||
|
autoComplete.add("we-selection");
|
||||||
|
}
|
||||||
|
if (!plugin.isWorldEditActive()) {
|
||||||
|
autoComplete.addAll(Arrays.asList("selector", "wand"));
|
||||||
|
}
|
||||||
} else if (args[0].equalsIgnoreCase("create")) {
|
} else if (args[0].equalsIgnoreCase("create")) {
|
||||||
|
|
||||||
boolean hasName = false;
|
boolean hasName = false;
|
||||||
|
@ -996,8 +1073,10 @@ public class AdvancedPortalsCommand implements CommandExecutor, TabCompleter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (args.length == 2 && (args[0].equalsIgnoreCase("remove")
|
else if (args.length == 2 &&
|
||||||
|| args[0].equalsIgnoreCase("disablebeacon"))) {
|
(args[0].equalsIgnoreCase("remove")
|
||||||
|
|| args[0].equalsIgnoreCase("disablebeacon")
|
||||||
|
|| args[0].equalsIgnoreCase("we-selection"))) {
|
||||||
for (AdvancedPortal portal : Portal.portals) {
|
for (AdvancedPortal portal : Portal.portals) {
|
||||||
autoComplete.add(portal.getName());
|
autoComplete.add(portal.getName());
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.sekwah.advancedportals.bukkit.listeners.*;
|
||||||
import com.sekwah.advancedportals.bukkit.metrics.Metrics;
|
import com.sekwah.advancedportals.bukkit.metrics.Metrics;
|
||||||
import com.sekwah.advancedportals.bukkit.portals.Portal;
|
import com.sekwah.advancedportals.bukkit.portals.Portal;
|
||||||
import com.sekwah.advancedportals.bungee.BungeeMessages;
|
import com.sekwah.advancedportals.bungee.BungeeMessages;
|
||||||
|
import org.bukkit.Bukkit;
|
||||||
import org.bukkit.configuration.ConfigurationSection;
|
import org.bukkit.configuration.ConfigurationSection;
|
||||||
import org.bukkit.configuration.file.FileConfiguration;
|
import org.bukkit.configuration.file.FileConfiguration;
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
|
@ -24,6 +25,9 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
protected boolean isProxyPluginEnabled = false;
|
protected boolean isProxyPluginEnabled = false;
|
||||||
|
|
||||||
protected boolean forceRegisterProxyChannels = false;
|
protected boolean forceRegisterProxyChannels = false;
|
||||||
|
protected boolean disableProxyWarning = false;
|
||||||
|
|
||||||
|
private boolean worldEditActive = false;
|
||||||
|
|
||||||
protected static final Map<String, String> PLAYER_DESTI_MAP = new HashMap<>();
|
protected static final Map<String, String> PLAYER_DESTI_MAP = new HashMap<>();
|
||||||
|
|
||||||
|
@ -45,6 +49,7 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
|
|
||||||
FileConfiguration pluginConfig = config.getConfig();
|
FileConfiguration pluginConfig = config.getConfig();
|
||||||
forceRegisterProxyChannels = pluginConfig.getBoolean(ConfigHelper.FORCE_ENABLE_PROXY_SUPPORT, false);
|
forceRegisterProxyChannels = pluginConfig.getBoolean(ConfigHelper.FORCE_ENABLE_PROXY_SUPPORT, false);
|
||||||
|
disableProxyWarning = pluginConfig.getBoolean(ConfigHelper.DISABLE_PROXY_WARNING, false);
|
||||||
|
|
||||||
ConfigAccessor portalConfig = new ConfigAccessor(this, "portals.yml");
|
ConfigAccessor portalConfig = new ConfigAccessor(this, "portals.yml");
|
||||||
portalConfig.saveDefaultConfig();
|
portalConfig.saveDefaultConfig();
|
||||||
|
@ -73,8 +78,12 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
|
|
||||||
for (Player player:
|
for (Player player:
|
||||||
this.getServer().getOnlinePlayers()) {
|
this.getServer().getOnlinePlayers()) {
|
||||||
player.removeMetadata("hasWarped", this);
|
player.removeMetadata(Listeners.HAS_WARPED, this);
|
||||||
player.removeMetadata("lavaWarped", this);
|
player.removeMetadata(Listeners.LAVA_WARPED, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (settings.enabledWorldEditIntegration() && Bukkit.getPluginManager().isPluginEnabled("WorldEdit")) {
|
||||||
|
worldEditActive = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// thanks to the new config accessor code the config.saveDefaultConfig(); will now
|
// thanks to the new config accessor code the config.saveDefaultConfig(); will now
|
||||||
|
@ -139,7 +148,8 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
getLogger().info( "Bungee detected. Enabling proxy features." );
|
getLogger().info( "Bungee detected. Enabling proxy features." );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch(NullPointerException e) {
|
} catch(NoSuchMethodError | NullPointerException e) {
|
||||||
|
if(!disableProxyWarning) getLogger().info("BungeeCord config not detected, ignoring settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Will be valid if paperspigot is being used. Otherwise catch.
|
// Will be valid if paperspigot is being used. Otherwise catch.
|
||||||
|
@ -150,10 +160,11 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
getLogger().info( "Modern forwarding detected. Enabling proxy features." );
|
getLogger().info( "Modern forwarding detected. Enabling proxy features." );
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} catch(NullPointerException e) {
|
} catch(NoSuchMethodError | NullPointerException e) {
|
||||||
|
if(!disableProxyWarning) getLogger().info("Paper config not detected, ignoring paper settings");
|
||||||
}
|
}
|
||||||
|
|
||||||
getLogger().warning( "Proxy features disabled for Advanced Portals as bungee isn't enabled on the server (spigot.yml) " +
|
if(!disableProxyWarning) 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)" );
|
"or if you are using Paper settings.velocity-support.enabled may not be enabled (paper.yml)" );
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -168,4 +179,8 @@ public class AdvancedPortalsPlugin extends JavaPlugin {
|
||||||
public Settings getSettings() {
|
public Settings getSettings() {
|
||||||
return settings;
|
return settings;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isWorldEditActive() {
|
||||||
|
return worldEditActive;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,27 +1,34 @@
|
||||||
package com.sekwah.advancedportals.bukkit;
|
package com.sekwah.advancedportals.bukkit;
|
||||||
|
|
||||||
import com.sekwah.advancedportals.bukkit.config.ConfigAccessor;
|
import com.sekwah.advancedportals.bukkit.config.ConfigAccessor;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
|
|
||||||
public class PluginMessages {
|
public class PluginMessages {
|
||||||
private final AdvancedPortalsPlugin plugin;
|
private static String WARP_MESSAGE;
|
||||||
public boolean useCustomPrefix = false;
|
public boolean useCustomPrefix = false;
|
||||||
public static String customPrefix = "\u00A7a[\u00A7eAdvancedPortals\u00A7a]";
|
public static String customPrefix = "\u00A7a[\u00A7eAdvancedPortals\u00A7a]";
|
||||||
public static String customPrefixFail = "\u00A7c[\u00A77AdvancedPortals\u00A7c]";
|
public static String customPrefixFail = "\u00A7c[\u00A77AdvancedPortals\u00A7c]";
|
||||||
|
|
||||||
public PluginMessages (AdvancedPortalsPlugin plugin) {
|
public PluginMessages (AdvancedPortalsPlugin plugin) {
|
||||||
this.plugin = plugin;
|
ConfigAccessor config = new ConfigAccessor(plugin, "config.yml");
|
||||||
ConfigAccessor config = new ConfigAccessor(this.plugin, "config.yml");
|
|
||||||
this.useCustomPrefix = config.getConfig().getBoolean("UseCustomPrefix");
|
this.useCustomPrefix = config.getConfig().getBoolean("UseCustomPrefix");
|
||||||
if (useCustomPrefix) {
|
if (useCustomPrefix) {
|
||||||
PluginMessages.customPrefix = config.getConfig().getString("CustomPrefix").replaceAll("&(?=[0-9a-fk-or])", "\u00A7");
|
PluginMessages.customPrefix = config.getConfig().getString("CustomPrefix").replaceAll("&(?=[0-9a-fk-or])", "\u00A7");
|
||||||
PluginMessages.customPrefixFail = config.getConfig().getString("CustomPrefixFail").replaceAll("&(?=[0-9a-fk-or])", "\u00A7");
|
PluginMessages.customPrefixFail = config.getConfig().getString("CustomPrefixFail").replaceAll("&(?=[0-9a-fk-or])", "\u00A7");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
WARP_MESSAGE = ChatColor.translateAlternateColorCodes('&', config.getConfig().getString("WarpMessage", "&aYou have warped to &e<warp>&a"));
|
||||||
}
|
}
|
||||||
|
|
||||||
// This class is so then the common messages in commands or just messages over the commands are the same and can be
|
// This class is so then the common messages in commands or just messages over the commands are the same and can be
|
||||||
// easily changed.
|
// easily changed.
|
||||||
|
|
||||||
|
public static String getWarpMessage(String warp) {
|
||||||
|
String cleanedWarp = warp.replace("_", " ");
|
||||||
|
return WARP_MESSAGE.replace("<warp>", cleanedWarp);
|
||||||
|
}
|
||||||
|
|
||||||
public static void UnknownCommand(CommandSender sender, String command) {
|
public static void UnknownCommand(CommandSender sender, String command) {
|
||||||
sender.sendMessage(customPrefixFail + " You need to type something after /" + command + "\n");
|
sender.sendMessage(customPrefixFail + " You need to type something after /" + command + "\n");
|
||||||
sender.sendMessage("\u00A7cIf you do not know what you can put or would like some help with the commands please type \u00A7e" + '"' + "\u00A7e/" + command + " help" + '"' + "\u00A7c\n");
|
sender.sendMessage("\u00A7cIf you do not know what you can put or would like some help with the commands please type \u00A7e" + '"' + "\u00A7e/" + command + " help" + '"' + "\u00A7c\n");
|
||||||
|
|
|
@ -15,10 +15,13 @@ public class Settings {
|
||||||
|
|
||||||
private String commandLevels = "n";
|
private String commandLevels = "n";
|
||||||
|
|
||||||
|
private boolean worldEditEnabled = false;
|
||||||
|
|
||||||
public enum PortalConfigOption {
|
public enum PortalConfigOption {
|
||||||
COMMAND_LEVELS("CommandLevels"),
|
COMMAND_LEVELS("CommandLevels"),
|
||||||
WARP_PARTICLES("WarpParticles"),
|
WARP_PARTICLES("WarpParticles"),
|
||||||
WARP_SOUND("WarpSound");
|
WARP_SOUND("WarpSound"),
|
||||||
|
WORLDEDIT_INTEGRATION("WorldEditIntegration");
|
||||||
|
|
||||||
private final String target;
|
private final String target;
|
||||||
|
|
||||||
|
@ -38,6 +41,8 @@ public class Settings {
|
||||||
|
|
||||||
commandLevels = config.getConfig().getString(COMMAND_LEVELS.value(), "opcb");
|
commandLevels = config.getConfig().getString(COMMAND_LEVELS.value(), "opcb");
|
||||||
|
|
||||||
|
worldEditEnabled = config.getConfig().getBoolean(WORLDEDIT_INTEGRATION.value(), false);
|
||||||
|
|
||||||
assert commandLevels != null;
|
assert commandLevels != null;
|
||||||
if(commandLevels.equals("opchek")) {
|
if(commandLevels.equals("opchek")) {
|
||||||
commandLevels = "opcb";
|
commandLevels = "opcb";
|
||||||
|
@ -63,4 +68,8 @@ public class Settings {
|
||||||
public int getCurrentWarpParticles() {
|
public int getCurrentWarpParticles() {
|
||||||
return currentWarpParticles;
|
return currentWarpParticles;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean enabledWorldEditIntegration() {
|
||||||
|
return worldEditEnabled;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ public class ConfigHelper {
|
||||||
public static final String COMMAND_LOGS = "CommandLogs";
|
public static final String COMMAND_LOGS = "CommandLogs";
|
||||||
|
|
||||||
public static final String FORCE_ENABLE_PROXY_SUPPORT = "ForceEnableProxySupport";
|
public static final String FORCE_ENABLE_PROXY_SUPPORT = "ForceEnableProxySupport";
|
||||||
|
public static final String DISABLE_PROXY_WARNING = "DisableProxyWarning";
|
||||||
|
|
||||||
public static final String PROXY_TELEPORT_DELAY = "ProxyTeleportDelay";
|
public static final String PROXY_TELEPORT_DELAY = "ProxyTeleportDelay";
|
||||||
|
|
||||||
|
@ -34,6 +35,7 @@ public class ConfigHelper {
|
||||||
} else if(configVersion.equals("0.5.4")) {
|
} else if(configVersion.equals("0.5.4")) {
|
||||||
config.set(ConfigHelper.CONFIG_VERSION, "0.5.11");
|
config.set(ConfigHelper.CONFIG_VERSION, "0.5.11");
|
||||||
config.set(ConfigHelper.COMMAND_LOGS, true);
|
config.set(ConfigHelper.COMMAND_LOGS, true);
|
||||||
|
update();
|
||||||
} else if(configVersion.equals("0.5.10") || configVersion.equals("0.5.11")) {
|
} else if(configVersion.equals("0.5.10") || configVersion.equals("0.5.11")) {
|
||||||
config.set(ConfigHelper.CONFIG_VERSION, "0.5.13");
|
config.set(ConfigHelper.CONFIG_VERSION, "0.5.13");
|
||||||
config.set(ConfigHelper.FORCE_ENABLE_PROXY_SUPPORT, false);
|
config.set(ConfigHelper.FORCE_ENABLE_PROXY_SUPPORT, false);
|
||||||
|
|
|
@ -164,10 +164,10 @@ public class Destination {
|
||||||
|
|
||||||
if (PORTAL_MESSAGE_DISPLAY == 1) {
|
if (PORTAL_MESSAGE_DISPLAY == 1) {
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
player.sendMessage(PluginMessages.customPrefix + "\u00A7a You have been warped to \u00A7e" + dest.replaceAll("_", " ") + "\u00A7a.");
|
player.sendMessage(PluginMessages.customPrefix + PluginMessages.getWarpMessage(dest));
|
||||||
player.sendMessage("");
|
player.sendMessage("");
|
||||||
} else if (PORTAL_MESSAGE_DISPLAY == 2 && !hideActionbar) {
|
} else if (PORTAL_MESSAGE_DISPLAY == 2 && !hideActionbar) {
|
||||||
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText("\u00A7aYou have warped to \u00A7e" + dest.replaceAll("_", " ") + "\u00A7a."));
|
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, TextComponent.fromLegacyText(PluginMessages.getWarpMessage(dest)));
|
||||||
}
|
}
|
||||||
|
|
||||||
Location newLoc = player.getLocation();
|
Location newLoc = player.getLocation();
|
||||||
|
|
|
@ -34,6 +34,9 @@ public class Listeners implements Listener {
|
||||||
|
|
||||||
private final AdvancedPortalsPlugin plugin;
|
private final AdvancedPortalsPlugin plugin;
|
||||||
|
|
||||||
|
public static String HAS_WARPED = "hasWarped";
|
||||||
|
public static String LAVA_WARPED = "lavaWarped";
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public Listeners(AdvancedPortalsPlugin plugin) {
|
public Listeners(AdvancedPortalsPlugin plugin) {
|
||||||
this.plugin = plugin;
|
this.plugin = plugin;
|
||||||
|
@ -133,14 +136,11 @@ public class Listeners implements Listener {
|
||||||
for (Location loc : locations) {
|
for (Location loc : locations) {
|
||||||
if (delayed ? Portal.locationInPortal(portal, loc, 1)
|
if (delayed ? Portal.locationInPortal(portal, loc, 1)
|
||||||
: Portal.locationInPortalTrigger(portal, loc)) {
|
: Portal.locationInPortalTrigger(portal, loc)) {
|
||||||
if (portal.getTriggers().contains(Material.NETHER_PORTAL)) {
|
|
||||||
if (player.getGameMode().equals(GameMode.CREATIVE)) {
|
player.setMetadata(HAS_WARPED, new FixedMetadataValue(plugin, true));
|
||||||
player.setMetadata("hasWarped", new FixedMetadataValue(plugin, true));
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new RemoveWarpData(player), 10);
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new RemoveWarpData(player), 10);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (portal.getTriggers().contains(Material.LAVA)) {
|
if (portal.getTriggers().contains(Material.LAVA)) {
|
||||||
player.setMetadata("lavaWarped", new FixedMetadataValue(plugin, true));
|
player.setMetadata(LAVA_WARPED, new FixedMetadataValue(plugin, true));
|
||||||
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new RemoveLavaData(player), 10);
|
Bukkit.getScheduler().scheduleSyncDelayedTask(plugin, new RemoveLavaData(player), 10);
|
||||||
}
|
}
|
||||||
if (portal.inPortal.contains(player.getUniqueId()))
|
if (portal.inPortal.contains(player.getUniqueId()))
|
||||||
|
@ -231,7 +231,7 @@ public class Listeners implements Listener {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
player.removeMetadata("lavaWarped", plugin);
|
player.removeMetadata(LAVA_WARPED, plugin);
|
||||||
player.setFireTicks(0);
|
player.setFireTicks(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -247,7 +247,7 @@ public class Listeners implements Listener {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (player != null && player.isOnline()) {
|
if (player != null && player.isOnline()) {
|
||||||
player.removeMetadata("hasWarped", plugin);
|
player.removeMetadata(HAS_WARPED, plugin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -263,7 +263,7 @@ public class Listeners implements Listener {
|
||||||
if (event.getEntity() instanceof Player && (event.getCause() == EntityDamageEvent.DamageCause.LAVA
|
if (event.getEntity() instanceof Player && (event.getCause() == EntityDamageEvent.DamageCause.LAVA
|
||||||
|| event.getCause() == EntityDamageEvent.DamageCause.FIRE
|
|| event.getCause() == EntityDamageEvent.DamageCause.FIRE
|
||||||
|| event.getCause() == EntityDamageEvent.DamageCause.FIRE_TICK)) {
|
|| event.getCause() == EntityDamageEvent.DamageCause.FIRE_TICK)) {
|
||||||
if (event.getEntity().hasMetadata("lavaWarped")
|
if (event.getEntity().hasMetadata(LAVA_WARPED)
|
||||||
| Portal.inPortalTriggerRegion(event.getEntity().getLocation()))
|
| Portal.inPortalTriggerRegion(event.getEntity().getLocation()))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
@ -276,14 +276,14 @@ public class Listeners implements Listener {
|
||||||
}
|
}
|
||||||
Player player = event.getPlayer();
|
Player player = event.getPlayer();
|
||||||
|
|
||||||
if (!player.hasMetadata("hasWarped")) {
|
if (!player.hasMetadata(HAS_WARPED)) {
|
||||||
Location loc = event.getFrom();
|
Location loc = event.getFrom();
|
||||||
Location eyeLoc = new Location(loc.getWorld(), loc.getX(), loc.getY() + player.getEyeHeight(), loc.getZ());
|
Location eyeLoc = new Location(loc.getWorld(), loc.getX(), loc.getY() + player.getEyeHeight(), loc.getZ());
|
||||||
|
|
||||||
checkTriggerLocations(player, true, loc, eyeLoc);
|
checkTriggerLocations(player, true, loc, eyeLoc);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.hasMetadata("hasWarped") | Portal.inPortalRegion(event.getFrom(), 1))
|
if (player.hasMetadata(HAS_WARPED) | Portal.inPortalRegion(event.getFrom(), 1))
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -329,8 +329,8 @@ public class Listeners implements Listener {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (player.hasPermission("advancedportals.createportal")) {
|
if (player.hasPermission("advancedportals.createportal")) {
|
||||||
|
if (!plugin.getSettings().enabledWorldEditIntegration()
|
||||||
if (event.getItem() != null && event.getItem().getType() == WandMaterial // was type id
|
&& event.getItem() != null && event.getItem().getType() == WandMaterial // was type id
|
||||||
&& (!UseOnlyServerAxe || (checkItemForName(event.getItem()) && event.getItem().getItemMeta()
|
&& (!UseOnlyServerAxe || (checkItemForName(event.getItem()) && event.getItem().getItemMeta()
|
||||||
.getDisplayName().equals("\u00A7ePortal Region Selector")))) {
|
.getDisplayName().equals("\u00A7ePortal Region Selector")))) {
|
||||||
|
|
||||||
|
@ -371,7 +371,6 @@ public class Listeners implements Listener {
|
||||||
// Returns the event so no more code is executed(stops unnecessary code being
|
// Returns the event so no more code is executed(stops unnecessary code being
|
||||||
// executed)
|
// executed)
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (checkItemForName(event.getItem())
|
} else if (checkItemForName(event.getItem())
|
||||||
&& event.getItem().getItemMeta().getDisplayName().equals("\u00A75Portal Block Placer")
|
&& event.getItem().getItemMeta().getDisplayName().equals("\u00A75Portal Block Placer")
|
||||||
&& event.getAction() == Action.LEFT_CLICK_BLOCK
|
&& event.getAction() == Action.LEFT_CLICK_BLOCK
|
||||||
|
|
|
@ -577,12 +577,15 @@ public class Portal {
|
||||||
} else if (command.startsWith("!") && plugin.getSettings().enabledCommandLevel("o")) {
|
} else if (command.startsWith("!") && plugin.getSettings().enabledCommandLevel("o")) {
|
||||||
command = command.substring(1);
|
command = command.substring(1);
|
||||||
boolean wasOp = player.isOp();
|
boolean wasOp = player.isOp();
|
||||||
try {
|
if(!wasOp) {
|
||||||
player.setOp(true);
|
try {
|
||||||
|
player.setOp(true);
|
||||||
|
player.chat("/" + command);
|
||||||
|
} finally {
|
||||||
|
player.setOp(false);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
player.chat("/" + command);
|
player.chat("/" + command);
|
||||||
// player.performCommand(command);
|
|
||||||
} finally {
|
|
||||||
player.setOp(wasOp);
|
|
||||||
}
|
}
|
||||||
} else if (command.startsWith("^") && plugin.getSettings().enabledCommandLevel("p")) {
|
} else if (command.startsWith("^") && plugin.getSettings().enabledCommandLevel("p")) {
|
||||||
command = command.substring(1);
|
command = command.substring(1);
|
||||||
|
|
|
@ -0,0 +1,47 @@
|
||||||
|
package com.sekwah.advancedportals.bukkit.util;
|
||||||
|
|
||||||
|
import com.sk89q.worldedit.IncompleteRegionException;
|
||||||
|
import com.sk89q.worldedit.LocalSession;
|
||||||
|
import com.sk89q.worldedit.WorldEdit;
|
||||||
|
import com.sk89q.worldedit.bukkit.BukkitAdapter;
|
||||||
|
import com.sk89q.worldedit.regions.CuboidRegion;
|
||||||
|
import com.sk89q.worldedit.regions.Region;
|
||||||
|
import com.sk89q.worldedit.regions.RegionSelector;
|
||||||
|
import com.sk89q.worldedit.regions.selector.CuboidRegionSelector;
|
||||||
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
|
||||||
|
public class WorldEditIntegration {
|
||||||
|
private static Region getCurrentSelection(Player player) {
|
||||||
|
LocalSession localSession = WorldEdit.getInstance().getSessionManager().get(BukkitAdapter.adapt(player));
|
||||||
|
try {
|
||||||
|
return localSession.getSelection(BukkitAdapter.adapt(player.getWorld()));
|
||||||
|
} catch (IncompleteRegionException e) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static boolean validateSelection(Player player) {
|
||||||
|
return getCurrentSelection(player) instanceof CuboidRegion;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Location getPos1(Player player) {
|
||||||
|
Region currentSelection = getCurrentSelection(player);
|
||||||
|
if (!(currentSelection instanceof CuboidRegion)) return null;
|
||||||
|
return BukkitAdapter.adapt(player.getWorld(), ((CuboidRegion) currentSelection).getPos1());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Location getPos2(Player player) {
|
||||||
|
Region currentSelection = getCurrentSelection(player);
|
||||||
|
if (currentSelection == null) return null;;
|
||||||
|
return BukkitAdapter.adapt(player.getWorld(), ((CuboidRegion) currentSelection).getPos2());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void explainRegion(Player player, Location pos1, Location pos2) {
|
||||||
|
LocalSession localSession = WorldEdit.getInstance().getSessionManager().get(BukkitAdapter.adapt(player));
|
||||||
|
RegionSelector selector = new CuboidRegionSelector(BukkitAdapter.adapt(player.getWorld()), BukkitAdapter.asBlockVector(pos1), BukkitAdapter.asBlockVector(pos2));
|
||||||
|
localSession.setRegionSelector(BukkitAdapter.adapt(player.getWorld()), selector);
|
||||||
|
selector.explainRegionAdjust(BukkitAdapter.adapt(player), localSession);
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -23,7 +23,8 @@ import java.util.concurrent.TimeUnit;
|
||||||
*/
|
*/
|
||||||
@Plugin(id = "advancedportals", name = "Advanced Portals",
|
@Plugin(id = "advancedportals", name = "Advanced Portals",
|
||||||
url = "https://www.spigotmc.org/resources/advanced-portals.14356/",
|
url = "https://www.spigotmc.org/resources/advanced-portals.14356/",
|
||||||
version = "0.6.0")
|
authors = {"sekwah"},
|
||||||
|
version = "0.9.2")
|
||||||
public class AdvancedPortalsPlugin {
|
public class AdvancedPortalsPlugin {
|
||||||
|
|
||||||
public HashMap<String, String[]> PlayerDestiMap = new HashMap<>();
|
public HashMap<String, String[]> PlayerDestiMap = new HashMap<>();
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
main: com.sekwah.advancedportals.bungee.AdvancedPortalsPlugin
|
main: com.sekwah.advancedportals.bungee.AdvancedPortalsPlugin
|
||||||
name: AdvancedPortals
|
name: AdvancedPortals
|
||||||
version: 0.6.0
|
version: 0.9.2
|
||||||
author: sekwah41
|
author: sekwah
|
||||||
|
|
|
@ -65,6 +65,9 @@ CustomPrefix: '&a[&eAdvancedPortals&a]'
|
||||||
|
|
||||||
CustomPrefixFail: '&c[&7AdvancedPortals&c]'
|
CustomPrefixFail: '&c[&7AdvancedPortals&c]'
|
||||||
|
|
||||||
|
# Message sent to player in chat/action bar on warp
|
||||||
|
WarpMessage: '&aYou have warped to &e<warp>&a.'
|
||||||
|
|
||||||
BlockSpectatorMode: false
|
BlockSpectatorMode: false
|
||||||
|
|
||||||
PortalCooldown: 5 # How long after trying to enter a portal until the player can try to enter another. 0 or lower to deactivate.
|
PortalCooldown: 5 # How long after trying to enter a portal until the player can try to enter another. 0 or lower to deactivate.
|
||||||
|
@ -95,3 +98,10 @@ ForceEnableProxySupport: false
|
||||||
# How many seconds after the proxy event fires should the player be teleported (should help with on spawn plugins and such)
|
# 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.
|
# 0 is disabled and anything higher causes a delay.
|
||||||
ProxyTeleportDelay: 0
|
ProxyTeleportDelay: 0
|
||||||
|
|
||||||
|
# Just in case you are not using the proxy and dont want the warning message
|
||||||
|
DisableProxyWarning: false
|
||||||
|
|
||||||
|
# Whether the integration with worldedit should be enabled.
|
||||||
|
# This will force AdvancedPortals to use WorldEdit selections.
|
||||||
|
WorldEditIntegration: false
|
|
@ -1,15 +1,19 @@
|
||||||
main: com.sekwah.advancedportals.bukkit.AdvancedPortalsPlugin
|
main: com.sekwah.advancedportals.bukkit.AdvancedPortalsPlugin
|
||||||
name: AdvancedPortals
|
name: AdvancedPortals
|
||||||
version: 0.6.0
|
version: 0.9.2
|
||||||
author: sekwah41
|
author: sekwah
|
||||||
description: An advanced portals plugin for bukkit.
|
description: An advanced portals plugin for bukkit.
|
||||||
api-version: 1.13
|
api-version: 1.13
|
||||||
|
|
||||||
|
softdepend:
|
||||||
|
- WorldEdit
|
||||||
|
|
||||||
commands:
|
commands:
|
||||||
advancedportals:
|
advancedportals:
|
||||||
description: The main command for the advanced portals
|
description: The main command for the advanced portals
|
||||||
aliases: [portals, aportals, portal, ap]
|
aliases: [portals, aportals, portal, ap]
|
||||||
usage: /<command>
|
usage: /<command>
|
||||||
permission: advancedportals.portal
|
permission: advancedportals.portalcommand
|
||||||
destination:
|
destination:
|
||||||
description: Can be used to access portal destinations.
|
description: Can be used to access portal destinations.
|
||||||
aliases: [desti]
|
aliases: [desti]
|
||||||
|
@ -50,6 +54,9 @@ permissions:
|
||||||
advancedportals.portal:
|
advancedportals.portal:
|
||||||
description: Allows use of portal commands
|
description: Allows use of portal commands
|
||||||
default: op
|
default: op
|
||||||
|
advancedportals.portalcommand:
|
||||||
|
description: Access to the portal command. This is seperate to allow access to portal warps without the rest.
|
||||||
|
default: true
|
||||||
advancedportals.build:
|
advancedportals.build:
|
||||||
description: Allows you to build in the portal regions
|
description: Allows you to build in the portal regions
|
||||||
default: op
|
default: op
|
||||||
|
|
Loading…
Reference in New Issue