diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
deleted file mode 100644
index 983d12c..0000000
--- a/.github/workflows/build.yml
+++ /dev/null
@@ -1,22 +0,0 @@
-name: Maven CI/CD
-
-on:
- push:
- branches: [ main ]
- pull_request:
- branches: [ main ]
-
-jobs:
- build_and_test:
-
- runs-on: ubuntu-latest
-
- steps:
- - uses: actions/checkout@v2
- - name: Set up JDK 8
- uses: actions/setup-java@v1
- with:
- java-version: 1.8
-
- - name: Build with Maven
- run: mvn -B package --file pom.xml
diff --git a/.github/workflows/call.github_release.yml b/.github/workflows/call.github_release.yml
new file mode 100644
index 0000000..94253c7
--- /dev/null
+++ b/.github/workflows/call.github_release.yml
@@ -0,0 +1,34 @@
+name: 'Call: GitHub Release'
+
+on:
+ workflow_call:
+ inputs:
+ release_mode:
+ description: 'Release mode'
+ required: true
+ type: string
+ version_bump:
+ description: 'Version bump'
+ required: false
+ type: string
+ promote_from:
+ description: 'Promote from'
+ required: false
+ type: string
+ outputs:
+ release_created:
+ description: 'Release created'
+ value: ${{ jobs.github_release.outputs.release_created }}
+ tag_name:
+ description: 'Tag name'
+ value: ${{ jobs.github_release.outputs.tag_name }}
+
+jobs:
+ github_release:
+ uses: Multiverse/Multiverse-Core/.github/workflows/generic.github_release.yml@main
+ secrets: inherit
+ with:
+ plugin_name: multiverse-portals
+ release_mode: ${{ inputs.release_mode }}
+ version_bump: ${{ inputs.version_bump }}
+ promote_from: ${{ inputs.promote_from }}
diff --git a/.github/workflows/call.platform_uploads.yml b/.github/workflows/call.platform_uploads.yml
new file mode 100644
index 0000000..9fb31f8
--- /dev/null
+++ b/.github/workflows/call.platform_uploads.yml
@@ -0,0 +1,63 @@
+name: 'Call: Platform Uploads'
+
+on:
+ workflow_call:
+ inputs:
+ target_tag:
+ description: 'Version to upload'
+ required: true
+ type: string
+ upload_modrinth:
+ description: 'Upload to modrinth.com'
+ required: true
+ type: string
+ upload_dbo:
+ description: 'Upload to dev.bukkit.org'
+ required: true
+ type: string
+ upload_hangar:
+ description: 'Upload to hangar.papermc.io'
+ required: true
+ type: string
+ secrets:
+ MODRINTH_TOKEN:
+ required: true
+ DBO_UPLOAD_API_TOKEN:
+ required: true
+ HANGAR_UPLOAD_TOKEN:
+ required: true
+
+jobs:
+ platform_uploads:
+ uses: Multiverse/Multiverse-Core/.github/workflows/generic.platform_uploads.yml@main
+ secrets: inherit
+ with:
+ plugin_name: multiverse-portals
+
+ modrinth_project_id: 8VMk6P0I
+ modrinth_dependencies: >
+ [
+ {"project_id": "3wmN97b8", "dependency_type": "required"}
+ ]
+
+ dbo_project_id: 30781
+ dbo_project_relations: >
+ [
+ {"slug": "multiverse-core", "type": "requiredDependency"},
+ {"slug": "worldedit", "type": "optionalDependency"}
+ ]
+
+ hangar_slug: Multiverse-Portals
+ hangar_plugin_dependencies: >
+ { "PAPER": [
+ {
+ "name": "Multiverse-Core",
+ "required": true,
+ "platforms": ["PAPER"]
+ }
+ ]}
+
+ target_tag: ${{ inputs.target_tag }}
+ upload_modrinth: ${{ inputs.upload_modrinth }}
+ upload_dbo: ${{ inputs.upload_dbo }}
+ upload_hangar: ${{ inputs.upload_hangar }}
diff --git a/.github/workflows/dispatch.platform_uploads.yml b/.github/workflows/dispatch.platform_uploads.yml
new file mode 100644
index 0000000..2eb99cb
--- /dev/null
+++ b/.github/workflows/dispatch.platform_uploads.yml
@@ -0,0 +1,31 @@
+name: 'Dispatch: Platform Uploads'
+
+on:
+ workflow_dispatch:
+ inputs:
+ target_tag:
+ description: 'Version to upload'
+ required: true
+ type: string
+ upload_modrinth:
+ description: 'Upload to modrinth.com'
+ required: true
+ type: boolean
+ upload_dbo:
+ description: 'Upload to dev.bukkit.org'
+ required: true
+ type: boolean
+ upload_hangar:
+ description: 'Upload to hangar.papermc.io'
+ required: true
+ type: boolean
+
+jobs:
+ dispatch_platform_uploads:
+ uses: ./.github/workflows/call.platform_uploads.yml
+ secrets: inherit
+ with:
+ target_tag: ${{ github.event.inputs.target_tag }}
+ upload_modrinth: ${{ github.event.inputs.upload_modrinth }}
+ upload_dbo: ${{ github.event.inputs.upload_dbo }}
+ upload_hangar: ${{ github.event.inputs.upload_hangar }}
diff --git a/.github/workflows/dispatch.promote_release.yml b/.github/workflows/dispatch.promote_release.yml
new file mode 100644
index 0000000..0a59ca4
--- /dev/null
+++ b/.github/workflows/dispatch.promote_release.yml
@@ -0,0 +1,38 @@
+name: 'Dispatch: Promote Release'
+
+on:
+ workflow_dispatch:
+ inputs:
+ target_tag:
+ description: 'Version to promote'
+ required: true
+
+jobs:
+ check_version:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Verify input version is prerelease
+ run: |
+ if [[ "${{ github.event.inputs.target_tag }}" != *"pre"* ]]; then
+ echo "Version must be a prerelease"
+ exit 1
+ fi
+
+ github_release:
+ needs: check_version
+ uses: ./.github/workflows/call.github_release.yml
+ secrets: inherit
+ with:
+ release_mode: promote
+ promote_from: ${{ github.event.inputs.target_tag }}
+
+ platform_uploads:
+ needs: github_release
+ if: needs.github_release.outputs.release_created == 'true'
+ uses: ./.github/workflows/call.platform_uploads.yml
+ secrets: inherit
+ with:
+ target_tag: ${{ needs.github_release.outputs.tag_name }}
+ upload_modrinth: 'true'
+ upload_dbo: 'true'
+ upload_hangar: 'true'
diff --git a/.github/workflows/main.prerelease.yml b/.github/workflows/main.prerelease.yml
new file mode 100644
index 0000000..a3b474b
--- /dev/null
+++ b/.github/workflows/main.prerelease.yml
@@ -0,0 +1,24 @@
+name: 'Main: Prerelease'
+
+on:
+ push:
+ branches: [main]
+
+jobs:
+ github_release_on_push:
+ uses: ./.github/workflows/call.github_release.yml
+ secrets: inherit
+ with:
+ release_mode: prerelease
+ version_bump: prlabel
+
+ platform_uploads_on_push:
+ needs: github_release_on_push
+ if: needs.github_release_on_push.outputs.release_created == 'true'
+ uses: ./.github/workflows/call.platform_uploads.yml
+ secrets: inherit
+ with:
+ target_tag: ${{ needs.github_release_on_push.outputs.tag_name }}
+ upload_modrinth: 'true'
+ upload_dbo: 'false'
+ upload_hangar: 'false'
diff --git a/.github/workflows/pr.require_label.yml b/.github/workflows/pr.require_label.yml
new file mode 100644
index 0000000..b731584
--- /dev/null
+++ b/.github/workflows/pr.require_label.yml
@@ -0,0 +1,18 @@
+name: 'PR: Require Label'
+
+on:
+ pull_request:
+ types: [opened, labeled, unlabeled, synchronize]
+ branches: [main]
+
+jobs:
+ require_label:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: mheap/github-action-required-labels@v2
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ mode: exactly
+ count: 1
+ labels: "release:major, release:minor, release:patch, no release"
diff --git a/.github/workflows/pr.test.yml b/.github/workflows/pr.test.yml
new file mode 100644
index 0000000..431a5ee
--- /dev/null
+++ b/.github/workflows/pr.test.yml
@@ -0,0 +1,11 @@
+name: 'PR: Test'
+
+on:
+ pull_request:
+ types: [opened, synchronize]
+
+jobs:
+ test:
+ uses: Multiverse/Multiverse-Core/.github/workflows/generic.test.yml@main
+ with:
+ plugin_name: multiverse-portals
diff --git a/.gitignore b/.gitignore
index 4a3f598..8a593e0 100644
--- a/.gitignore
+++ b/.gitignore
@@ -43,3 +43,6 @@ debug.log
# Doxygen
/docs/html
debug.txt
+
+# Gradle
+.gradle
diff --git a/LICENSE.md b/LICENSE.md
new file mode 100644
index 0000000..a5dc3a8
--- /dev/null
+++ b/LICENSE.md
@@ -0,0 +1,6 @@
+Copyright (c) 2011, The Multiverse Team All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+
+Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
diff --git a/README.md b/README.md
index 88c6e6b..57e3298 100644
--- a/README.md
+++ b/README.md
@@ -1,8 +1,49 @@
-# Copyright Notice
+
+
+
-Copyright (c) 2011, The Multiverse Team All rights reserved.
+# Multiverse Portals
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+[![Modrinth](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/modrinth_vector.svg)](https://modrinth.com/plugin/Multiverse-Portals)
+[![hangar](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/available/hangar_vector.svg)](https://hangar.papermc.io/Multiverse/Multiverse-Portals)
+[![bukkit](https://cdn.jsdelivr.net/npm/@intergrav/devins-badges@3/assets/cozy/supported/bukkit_vector.svg)](https://dev.bukkit.org/projects/Multiverse-Portals)
-Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. Neither the name of the The Multiverse Team nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+![GitHub release (with filter)](https://img.shields.io/github/v/release/multiverse/multiverse-portals)
+[![Discord](https://img.shields.io/discord/325459248047980545?label=discord&logo=discord)](https://discord.gg/NZtfKky)
+[![Support us on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Ddumptruckman%26type%3Dpatrons&style=flat)](https://patreon.com/dumptruckman)
+
+## About
+
+[Multiverse Portals](https://dev.bukkit.org/projects/Multiverse-Portals) is an add-on Plugin for [Multiverse core](https://dev.bukkit.org/projects/multiverse-core) that allows you to create Portals that can teleport players to Multiverse destinations (worlds, anchors or even exact positions), With [Multiverse Command Destination](https://www.spigotmc.org/resources/multiverse-commanddestination.90232/) you can even make portals run commands
+
+Now it's time to create your very own server with Multiverse Portals, do check out our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki/Home-(Inventories)) and [Usage Guide](https://github.com/Multiverse/Multiverse-Core/wiki/Basics-(Inventories)) to get started. Feel free to hop onto our [Discord](https://discord.gg/NZtfKky) if you have any questions or just want to have a chat with us!
+
+## Our other amazing sub-modules:
+
+With just [Multiverse Core](https://github.com/multiverse/multiverse) and any of the below plugins, you can access all of these other related features in the Multiverse ecosystem.
+
+* [Multiverse-NetherPortals](https://github.com/Multiverse/Multiverse-NetherPortals) -> Have separate nether and end worlds for each of your overworlds!
+* [Multiverse-Inventories](https://github.com/Multiverse/Multiverse-Inventories) -> Have separated players stats and inventories per world or per group of worlds.
+* [Multiverse-SignPortals](https://github.com/Multiverse/Multiverse-SignPortals) -> Signs as teleporters!
+
+## Building
+Simply build the source with Gradle:
+```
+./gradlew build
+```
+
+## Contributing
+
+**Want to help improve Multiverse Portals?** There are several ways you can support and contribute to the project.
+* Take a look at our "Bug: Unconfirmed" issues, where you can find issues that need extra testing and investigation.
+* Want others to love Multiverse too? You can join the [Multiverse Discord community](https://discord.gg/NZtfKky) and help others with issues and setup!
+* A Multiverse guru? You can update our [Wiki](https://github.com/Multiverse/Multiverse-Core/wiki) with your latest tips, tricks and guides! The wiki open for all to edit and improve.
+* Love coding? You could look at ["State: Open to PR"](https://github.com/Multiverse/Multiverse-Portals/labels/State%3A%20Open%20to%20PR) and ["Resolution: Accepted"](https://github.com/Multiverse/Multiverse-Portals/labels/Resolution%3A%20Accepted) issues. We're always happy to receive bug fixes and feature additions as [pull requests](https://www.freecodecamp.org/news/how-to-make-your-first-pull-request-on-github-3/).
+* If you'd like to make a financial contribution to the project, do consider joining our [Patreon](https://www.patreon.com/dumptruckman) or make a one-time donation [here](https://paypal.me/dumptruckman)!
+
+Additionally, we would like to give a big thanks to everyone that has supported Multiverse over the years, as well as those in the years to come. Thank you!
+
+## License
+
+Multiverse-Portals is licensed under BSD-3-Clause License. Please see [LICENSE.md](LICENSE.md) for more info.
diff --git a/build.gradle b/build.gradle
new file mode 100644
index 0000000..8c03fc5
--- /dev/null
+++ b/build.gradle
@@ -0,0 +1,132 @@
+plugins {
+ id 'java-library'
+ id 'maven-publish'
+ id 'checkstyle'
+ id 'com.github.johnrengelman.shadow' version '7.1.2'
+}
+
+version = System.getenv('GITHUB_VERSION') ?: 'local'
+group = 'com.onarandombox.multiverseportals'
+description = 'Multiverse-Portals'
+
+java.sourceCompatibility = JavaVersion.VERSION_11
+
+repositories {
+ mavenLocal()
+ mavenCentral()
+
+ maven {
+ name = 'spigotmc'
+ url = uri('https://hub.spigotmc.org/nexus/content/repositories/snapshots/')
+ }
+
+ maven {
+ name = 'onarandombox'
+ url = uri('https://repo.onarandombox.com/content/groups/public')
+ }
+
+ maven {
+ name = 'enginehub'
+ url = uri('https://maven.enginehub.org/repo/')
+ }
+}
+
+dependencies {
+ // Spigot
+ implementation 'org.bukkit:bukkit:1.13.2-R0.1-SNAPSHOT'
+
+ // Core
+ implementation 'com.onarandombox.multiversecore:Multiverse-Core:4.2.2'
+
+ //WorldEdit
+ implementation('com.sk89q.worldedit:worldedit-bukkit:7.2.9') {
+ exclude group: 'org.bukkit', module: 'bukkit'
+ }
+
+ // Utils
+ api('com.dumptruckman.minecraft:Logging:1.1.1') {
+ exclude group: 'org.bukkit', module: 'bukkit'
+ }
+}
+
+
+java {
+ withSourcesJar()
+ withJavadocJar()
+}
+
+tasks.withType(JavaCompile).configureEach {
+ options.encoding = 'UTF-8'
+}
+
+tasks.withType(Javadoc).configureEach {
+ options.encoding = 'UTF-8'
+}
+
+
+configurations {
+ [apiElements, runtimeElements].each {
+ it.outgoing.artifacts.removeIf { it.buildDependencies.getDependencies(null).contains(jar) }
+ it.outgoing.artifact(shadowJar)
+ }
+}
+
+publishing {
+ publications {
+ maven(MavenPublication) {
+ from components.java
+ }
+ }
+ repositories {
+ maven {
+ name = "GitHubPackages"
+ url = "https://maven.pkg.github.com/Multiverse/Multiverse-Portals"
+ credentials {
+ username = System.getenv("GITHUB_ACTOR")
+ password = System.getenv("GITHUB_TOKEN")
+ }
+ }
+ }
+}
+
+
+processResources {
+ def props = [version: "${project.version}"]
+ inputs.properties props
+ filteringCharset 'UTF-8'
+ filesMatching('plugin.yml') {
+ expand props
+ }
+
+ // This task should never be skipped. The tests depend on this having been run but we want the new version number
+ // that is created after tests are run and before we run again to publish.
+ outputs.upToDateWhen { false }
+}
+
+
+checkstyle {
+ toolVersion = '6.1.1'
+ configFile file('config/mv_checks.xml')
+ ignoreFailures = true
+}
+
+
+javadoc {
+ source = sourceSets.main.allJava
+ classpath = configurations.compileClasspath
+}
+
+
+project.configurations.api.canBeResolved = true
+
+shadowJar {
+ relocate 'com.dumptruckman.minecraft.util.Logging', 'com.onarandombox.multiverseportals.util.MVPLogging'
+ relocate 'com.dumptruckman.minecraft.util.DebugLog', 'com.onarandombox.multiverseportals.util.DebugFileLogger'
+
+ configurations = [project.configurations.api]
+
+ archiveFileName = "$baseName-$version.$extension"
+}
+
+build.dependsOn shadowJar
+jar.enabled = false
diff --git a/config/mv_checks.xml b/config/mv_checks.xml
new file mode 100644
index 0000000..0c660d8
--- /dev/null
+++ b/config/mv_checks.xml
@@ -0,0 +1,141 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
new file mode 100644
index 0000000..943f0cb
Binary files /dev/null and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
new file mode 100644
index 0000000..f398c33
--- /dev/null
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -0,0 +1,6 @@
+distributionBase=GRADLE_USER_HOME
+distributionPath=wrapper/dists
+distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip
+networkTimeout=10000
+zipStoreBase=GRADLE_USER_HOME
+zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
new file mode 100755
index 0000000..65dcd68
--- /dev/null
+++ b/gradlew
@@ -0,0 +1,244 @@
+#!/bin/sh
+
+#
+# Copyright © 2015-2021 the original authors.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# https://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+##############################################################################
+#
+# 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
+
+# Resolve links: $0 may be a link
+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.
+DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
+
+# Use the maximum available, or set MAX_FD != -1 to use that value.
+MAX_FD=maximum
+
+warn () {
+ echo "$*"
+} >&2
+
+die () {
+ echo
+ echo "$*"
+ echo
+ exit 1
+} >&2
+
+# OS specific support (must be 'true' or 'false').
+cygwin=false
+msys=false
+darwin=false
+nonstop=false
+case "$( uname )" in #(
+ CYGWIN* ) cygwin=true ;; #(
+ Darwin* ) darwin=true ;; #(
+ MSYS* | MINGW* ) msys=true ;; #(
+ NONSTOP* ) nonstop=true ;;
+esac
+
+CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
+
+
+# Determine the Java command to use to start the JVM.
+if [ -n "$JAVA_HOME" ] ; then
+ if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
+ # IBM's JDK on AIX uses strange locations for the executables
+ JAVACMD=$JAVA_HOME/jre/sh/java
+ else
+ JAVACMD=$JAVA_HOME/bin/java
+ fi
+ if [ ! -x "$JAVACMD" ] ; then
+ die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+ fi
+else
+ 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.
+
+Please set the JAVA_HOME variable in your environment to match the
+location of your Java installation."
+fi
+
+# Increase the maximum file descriptors if we can.
+if ! "$cygwin" && ! "$darwin" && ! "$nonstop" ; then
+ case $MAX_FD in #(
+ max*)
+ # In POSIX sh, ulimit -H is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ MAX_FD=$( ulimit -H -n ) ||
+ warn "Could not query maximum file descriptor limit"
+ esac
+ case $MAX_FD in #(
+ '' | soft) :;; #(
+ *)
+ # In POSIX sh, ulimit -n is undefined. That's why the result is checked to see if it worked.
+ # shellcheck disable=SC3045
+ ulimit -n "$MAX_FD" ||
+ warn "Could not set maximum file descriptor limit to $MAX_FD"
+ esac
+fi
+
+# Collect all arguments for the java command, stacking in reverse order:
+# * args from the command line
+# * the main class name
+# * -classpath
+# * -D...appname settings
+# * --module-path (only if needed)
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.
+
+# For Cygwin or MSYS, switch paths to Windows format before running java
+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" "$@"
diff --git a/gradlew.bat b/gradlew.bat
new file mode 100644
index 0000000..93e3f59
--- /dev/null
+++ b/gradlew.bat
@@ -0,0 +1,92 @@
+@rem
+@rem Copyright 2015 the original author or authors.
+@rem
+@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 obtain a copy of the License at
+@rem
+@rem https://www.apache.org/licenses/LICENSE-2.0
+@rem
+@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 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+@rem See the License for the specific language governing permissions and
+@rem limitations under the License.
+@rem
+
+@if "%DEBUG%"=="" @echo off
+@rem ##########################################################################
+@rem
+@rem Gradle startup script for Windows
+@rem
+@rem ##########################################################################
+
+@rem Set local scope for the variables with windows NT shell
+if "%OS%"=="Windows_NT" setlocal
+
+set DIRNAME=%~dp0
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
+set APP_BASE_NAME=%~n0
+set APP_HOME=%DIRNAME%
+
+@rem Resolve any "." and ".." in APP_HOME to make it shorter.
+for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
+
+@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 Find java.exe
+if defined JAVA_HOME goto findJavaFromJavaHome
+
+set JAVA_EXE=java.exe
+%JAVA_EXE% -version >NUL 2>&1
+if %ERRORLEVEL% equ 0 goto execute
+
+echo.
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:findJavaFromJavaHome
+set JAVA_HOME=%JAVA_HOME:"=%
+set JAVA_EXE=%JAVA_HOME%/bin/java.exe
+
+if exist "%JAVA_EXE%" goto execute
+
+echo.
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
+echo.
+echo Please set the JAVA_HOME variable in your environment to match the
+echo location of your Java installation.
+
+goto fail
+
+:execute
+@rem Setup the command line
+
+set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
+
+
+@rem Execute Gradle
+"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
+
+:end
+@rem End local scope for the variables with windows NT shell
+if %ERRORLEVEL% equ 0 goto mainEnd
+
+:fail
+rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
+rem the _cmd.exe /c_ return code!
+set EXIT_CODE=%ERRORLEVEL%
+if %EXIT_CODE% equ 0 set EXIT_CODE=1
+if not ""=="%GRADLE_EXIT_CONSOLE%" exit %EXIT_CODE%
+exit /b %EXIT_CODE%
+
+:mainEnd
+if "%OS%"=="Windows_NT" endlocal
+
+:omega
diff --git a/pom.xml b/pom.xml
deleted file mode 100644
index ebb4d1c..0000000
--- a/pom.xml
+++ /dev/null
@@ -1,213 +0,0 @@
-
- 4.0.0
- com.onarandombox.multiverseportals
- Multiverse-Portals
- 5.0.0-SNAPSHOT
- Multiverse-Portals
- Multiverse Portals module
-
- UTF-8
- UNKNOWN
-
-
-
-
- spigot-repo
- https://hub.spigotmc.org/nexus/content/repositories/snapshots/
-
-
- OnARandomBox
- https://repo.onarandombox.com/content/groups/public
-
-
- spigot
- https://hub.spigotmc.org/nexus/content/groups/public/
-
-
- world-edit
- https://maven.sk89q.com/repo/
-
-
- rlf-mvn-repo
- https://raw.github.com/rlf/mvn-repo/master/
-
-
-
-
-
-
- jenkins
-
-
- env.BUILD_NUMBER
-
-
-
- ${env.BUILD_NUMBER}
-
-
-
-
-
- clean package
-
-
-
- org.apache.maven.plugins
- maven-compiler-plugin
- 3.7.0
-
-
- 1.8
-
-
-
- com.google.code.maven-replacer-plugin
- maven-replacer-plugin
- 1.4.1
-
-
- prepare-package
-
- replace
-
-
-
-
- target/classes/plugin.yml
-
-
- maven-version-number
- ${project.version}-b${project.build.number}
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-jar-plugin
- 3.0.2
-
-
-
-
-
-
-
-
- org.apache.maven.plugins
- maven-source-plugin
- 3.0.1
-
-
- attach-sources
- package
-
- jar-no-fork
-
-
-
-
-
- maven-javadoc-plugin
- 2.10.4
-
-
- javadoc-jar
- verify
-
- jar
-
-
-
-
-
- org.apache.maven.plugins
- maven-shade-plugin
- 2.4.3
-
-
- package
-
- shade
-
-
-
-
- com.dumptruckman.minecraft:Logging
-
-
-
-
- com.dumptruckman.minecraft.util.Logging
- com.onarandombox.MultiversePortals.utils.MVPLogging
-
-
- com.dumptruckman.minecraft.util.DebugLog
- com.onarandombox.MultiversePortals.utils.DebugFileLogger
-
-
-
-
-
-
-
-
-
-
- org.bukkit
- bukkit
- 1.13.2-R0.1-SNAPSHOT
- provided
-
-
-
- com.onarandombox.multiversecore
- Multiverse-Core
- 4.2.2
- jar
- provided
-
-
-
-
-
- com.sk89q.worldedit
- worldedit-bukkit
- 7.2.8
- jar
- provided
-
-
- org.bukkit
- bukkit
-
-
-
-
-
-
-
- com.dumptruckman.minecraft
- Logging
- 1.1.1
- jar
- compile
-
-
-
-
-
-
- OnARandomBox
- http://repo.onarandombox.com/content/repositories/multiverse
-
-
- OnARandomBox
- http://repo.onarandombox.com/content/repositories/multiverse-snapshots/
-
-
-
diff --git a/settings.gradle b/settings.gradle
new file mode 100644
index 0000000..8f63f53
--- /dev/null
+++ b/settings.gradle
@@ -0,0 +1,5 @@
+/*
+ * This file was generated by the Gradle 'init' task.
+ */
+
+rootProject.name = 'multiverse-portals'
diff --git a/src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java b/src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java
index c71e3a0..4e6b2d2 100644
--- a/src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java
+++ b/src/main/java/com/onarandombox/MultiversePortals/MultiversePortals.java
@@ -89,6 +89,7 @@ public class MultiversePortals extends JavaPlugin implements MVPlugin {
private long portalCooldown = 0;
private final static int requiresProtocol = 24;
public static boolean UseOnMove = true;
+ public static boolean bucketFilling = true;
public static boolean EnforcePortalAccess = true;
public static boolean WandEnabled = true;
public static boolean ClearOnRemove = false;
@@ -275,12 +276,14 @@ public void loadConfig() {
this.MVPConfig = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml"));
MultiversePortals.UseOnMove = this.MVPConfig.getBoolean("useonmove", true);
+ MultiversePortals.bucketFilling = this.MVPConfig.getBoolean("bucketfilling", true);
MultiversePortals.EnforcePortalAccess = this.MVPConfig.getBoolean("enforceportalaccess", true);
this.portalCooldown = this.MVPConfig.getInt("portalcooldown", 1000);
MultiversePortals.ClearOnRemove = this.MVPConfig.getBoolean("clearonremove", false);
MultiversePortals.TeleportVehicles = this.MVPConfig.getBoolean("teleportvehicles", true);
MultiversePortals.NetherAnimation = this.MVPConfig.getBoolean("netheranimation", true);
MultiversePortals.FrameMaterials = migrateFrameMaterials(this.MVPConfig);
+
// Migrate useportalaccess -> enforceportalaccess
if (this.MVPConfig.get("useportalaccess") != null) {
this.MVPConfig.set("enforceportalaccess", this.MVPConfig.getBoolean("useportalaccess", true));
@@ -519,6 +522,7 @@ public String getVersionInfo() {
+ "[Multiverse-Portals] Dumping Portal Values: (version " + this.getMainConfig().getDouble("version", -1) + ')' + '\n'
+ "[Multiverse-Portals] wand: " + this.getMainConfig().get("wand", "NOT SET") + '\n'
+ "[Multiverse-Portals] useonmove: " + this.getMainConfig().get("useonmove", "NOT SET") + '\n'
+ + "[Multiverse-Portals] bucketfilling: " + this.getMainConfig().get("bucketfilling", "NOT SET") + '\n'
+ "[Multiverse-Portals] portalsdefaulttonether: " + this.getMainConfig().get("portalsdefaulttonether", "NOT SET") + '\n'
+ "[Multiverse-Portals] enforceportalaccess: " + this.getMainConfig().get("enforceportalaccess", "NOT SET") + '\n'
+ "[Multiverse-Portals] portalcooldown: " + this.getMainConfig().get("portalcooldown", "NOT SET") + '\n'
diff --git a/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerListener.java b/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerListener.java
index 00824e4..5b336ba 100644
--- a/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerListener.java
+++ b/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerListener.java
@@ -101,6 +101,11 @@ public void playerBucketEmpty(PlayerBucketEmptyEvent event) {
return;
}
+ if (!MultiversePortals.bucketFilling) {
+ Logging.fine("The bucket filling functionality has been disabled in config, doing nothing");
+ return;
+ }
+
Location translatedLocation = this.getTranslatedLocation(event.getBlockClicked(), event.getBlockFace());
Logging.finer("Fill: ");
Logging.finer("Block Clicked: " + event.getBlockClicked() + ":" + event.getBlockClicked().getType());
diff --git a/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerMoveListener.java b/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerMoveListener.java
index 82c1930..8818714 100644
--- a/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerMoveListener.java
+++ b/src/main/java/com/onarandombox/MultiversePortals/listeners/MVPPlayerMoveListener.java
@@ -57,8 +57,8 @@ public void blockFromTo(BlockFromToEvent event) {
event.setCancelled(true);
return;
}
- // If something is trying to flow out, stop that too.
- if (plugin.getPortalManager().isPortal(event.getBlock().getLocation())) {
+ // If something is trying to flow out, stop that too, unless bucketFilling has been disabled
+ if (plugin.getPortalManager().isPortal(event.getBlock().getLocation()) && MultiversePortals.bucketFilling) {
event.setCancelled(true);
}
}
diff --git a/src/main/resources/defaults/config.yml b/src/main/resources/defaults/config.yml
index 8a7c34e..fd7bd4c 100644
--- a/src/main/resources/defaults/config.yml
+++ b/src/main/resources/defaults/config.yml
@@ -7,6 +7,7 @@
wand: 271
useonmove: true
+bucketfilling: true
portalsdefaulttonether: false
enforceportalaccess: true
portalcooldown: 1000
diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml
index 2f769fa..e9af59a 100644
--- a/src/main/resources/plugin.yml
+++ b/src/main/resources/plugin.yml
@@ -1,7 +1,7 @@
name: Multiverse-Portals
main: com.onarandombox.MultiversePortals.MultiversePortals
authors: ['Rigby', 'fernferret']
-version: maven-version-number
+version: ${version}
api-version: 1.13
depend: ['Multiverse-Core']
softdepend: ['WorldEdit']