diff --git a/build.gradle b/build.gradle
index 2e940621c..eca3fcf16 100644
--- a/build.gradle
+++ b/build.gradle
@@ -18,7 +18,35 @@
import java.text.SimpleDateFormat
import java.util.Date
-apply plugin: 'java'
+
+
+buildscript {
+
+ repositories {
+ mavenCentral()
+ gradlePluginPortal()
+
+ }
+
+ dependencies {
+ classpath 'com.github.johnrengelman:shadow:8.1.1'
+ }
+
+}
+
+plugins {
+
+ id 'java'
+ id 'base'
+
+// alias(libs.plugins.shadow)
+ id 'com.github.johnrengelman.shadow' version '8.1.1'
+}
+
+
+base {
+ archivesName = 'Prison'
+}
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
@@ -27,6 +55,8 @@ ext.targetArchiveClassifier = 'Java1.8'
//ext.targetArchiveClassifier = 'Java16'
+
+
// Lists all versions of java that are available to the toolchain
// $ ./gradlew -q javaToolchains
@@ -85,29 +115,17 @@ Example: The spigot build artifact is:
==========================================================================
"""
-buildscript {
-
- repositories {
- mavenCentral()
-
- maven { url "https://plugins.gradle.org/m2/" }
- }
- dependencies {
- classpath 'com.github.jengelman.gradle.plugins:shadow:6.1.0'
- }
-
-}
subprojects {
apply plugin: 'java'
+ apply plugin: 'com.github.johnrengelman.shadow'
// apply plugin: 'maven'
// apply plugin: 'maven-publish'
- apply plugin: 'com.github.johnrengelman.shadow'
- archivesBaseName = 'Prison'
+// archivesBaseName = 'Prison'
group = 'tech.mcprison.prison'
@@ -121,18 +139,10 @@ subprojects {
mavenCentral()
// maven { url "https://maven.sk89q.com/repo/" }
- maven {
- url "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3"
- content {
- includeGroup 'org.apache.commons'
- }
- }
maven {
url "https://mvnrepository.com/artifact"
-
}
-
}
@@ -141,18 +151,14 @@ subprojects {
}
dependencies {
- implementation 'org.apache.commons:commons-lang3:3.12.0'
-
- // https://mvnrepository.com/artifact/com.google.guava/guava
- implementation 'com.google.guava:guava:31.1-jre'
-
- //implementation 'com.google.guava:guava:19.0'
-
- // https://mvnrepository.com/artifact/com.google.code.gson/gson
- implementation 'com.google.code.gson:gson:2.10.1'
- //include(dependency('com.google.code.gson:gson:2.8.6'))
-
- testImplementation 'junit:junit:4.12'
+
+ implementation( libs.commons.lang3 )
+
+ implementation( libs.gson )
+ implementation( libs.guava )
+
+ testImplementation( libs.junit )
+
}
}
diff --git a/docs/changelog_v3.3.x.md b/docs/changelog_v3.3.x.md
index 8f050a6c3..9aec9d4f7 100644
--- a/docs/changelog_v3.3.x.md
+++ b/docs/changelog_v3.3.x.md
@@ -14,10 +14,83 @@
These change logs represent the work that has been going on within prison.
-# 3.3.0-alpha.17a 2024-04-29
+# 3.3.0-alpha.18 2024-05-20
+
+**Prison v3.3.0-alpha.18 2024-05-20**
+
+This version has been tested and confirmed to be working with Spigot v1.20.6 and Paper v1.20.6.
+
+
+
+* **Player Ranks GUI: Fixed an issue with the code not using the correct defaults for NoRankAccess when no value is provided in the configs.**
+
+
+* **Obsolete blocks: Marked an enum as @Deprecated to suppress a compile warning.** This has not real impact on anything.
+
+
+* **Gradle updates:**
+Upgraded XSeries from v9.10.0 to v10.0.0
+Upgraded nbtApi from v2.12.2 to v2.12.4
+Upgraded luckperms-v5 from v5.0 to v5.4
+
+
+* **Economy: Added a feature to check if a player has an economy account.**
+Currently this is not being used outside of the economy integrations, but it can be used to help suppress initial startup messages where players do not have an account, which will help prevent flooding a lot of messages to the console for some servers.
+
+
+* **Player Cache: There was a report of a concurrent modification exception.**
+This is very rare and generally should not happen.
+The keySet is part of the original TreeMap collection, so the fix here is to take all keys and put them in a new collection so they are then disconnected from the original TreeSet.
+This will prevent a concurrent modification exception if there is an action to add or remove users from the user cache, since the user cache remains active and cannot be locked with a synchronization for any amount of time, other than then smallest possible.
+The standard solution with dealing with this TreeSet collection would be to synchronize the whole activity of saving the dirty elements of the player cache. Unfortunately, that will cause blocking transactions when player events try to access the player cache. Therefore it's a balance game of trying to protect the player cache with the minimal amount of synchronizations, but allow the least amount of I/O blocking for all other processes that are trying to use it.
+Hopefully this is sufficient to allow it all to work without conflict, and to be able to provide enough protection.
+
+
+* **Gradle: Removed a lot of the older commented out settings.**
+See prior commits to better understand how things were setup before, or for references.
+
+
+* **Gradle: A few more adjustments to add a few more items to the libs.versions.toml.**
+
+
+
+* **Placeholders: The placeholder api call from PlaceholderAPI is passing a null OfflinePlayer object.**
+Not sure why this has never been an issue before, but added support for null OfflnePlayers.
+
+
+
+* **Spiget: Updated the way prison handles spiget by now submitting a task with a 5 second delay.**
+The messages are more helpful now.
+This also moves it out of the SpigotPrison class.
+
+
+* **Upgraded John Rengelman's shadow, a gradle plugin, from v6.1.0 to v8.1.1**
+
+
+
+* **Upgrade gradle from v7.6.4 to v8.7**
+ Upgraded from: v7.6.4 -> v8.0 -> v8.0.2 -> v8.1 -> v8.1.1
+ -> v8.2 -> v8.3 -> v8.4 -> v8.5 -> v8.6 -> v8.7
+ v8.3 required a configuration change due to `org.gradle.api.plugins.BasePluginConvention` type has been deprecated and will be removed in gradle v9.x. This is impacting the use of the `build.gradle`'s `archivesBaseNamme`. This is being replaced by the new `base{}` configuration block.
+ v8.3 also required other config changes.
+
+
+
+* **Upgrade spiget from v1.4.2 to v1.4.6**
+ Was using a jar with v1.4.2 due to their repo going down frequently.
+ Switched back to pulling through maven and got rid of jar.
+
+
+* **Upgrade gradle from v7.3.3 to v7.6.4**
+ Upgraded from: v7.3.3 -> v7.4 -> v7.4.1 -> v7.4.2
+ -> v7.5 -> v7.5.1 -> v7.6 -> v7.6.1 -> v7.6.2 -> v7.6.3 -> v7.6.4
+ Preparing for Gradle v8.x
+ Around v7.5.1 required a change to auto provisioning
+
+
**v3.3.0-alpha.17a 2024-04-29**
@@ -29,9 +102,7 @@ These change logs represent the work that has been going on within prison.
* **Initial setup of the GUI tools messages that are at the bottom of a page.**
Setup the handling of the messages and added the messages to all of the language files.
-Support for prior, current, and next page. Also close.
-
-
+Support for prior, current, and next page. Also c
* **Update the plugin.yml and removed the permissions configs since they were generating errors (lack of a schema) and the perms and handled through the prison command handler.**
@@ -1962,7 +2033,7 @@ The major issue here was that mines were being reset in the middle of a reset ac
* **Made many changes to the default configurations of the autoFeatures.**
This is to try to make it easier to use prison by using more of the settings that are most useful.
-Added more comments to make it easier to understand these settings too.
+Added more comments to make it easier to understand these settings too.f
* **Release v3.3.0-alpha.8d 2022-02-20**
@@ -2442,3 +2513,19 @@ v3.2.6, v3.3.0-alpha.1, v3.3.0-alpha.2, v3.2.7, v3.3.0-alpha.3
Start on the alpha.1 release.
+
+
+-------
+------- Upgrading Gradle:
+-------
+
+ Use the following for a list of version for upgrading to:
+ https://gradle.org/releases/
+
+ * gradlew wrapper --gradle-version=7.4
:: Sets the new wrapper version
+ * gradlew --version
:: Will actually install the new version
+ * gradlew build
:: Will build project with the new version to ensure all is good. If build is good, then you can try to upgrade to the next version.
+
+
+
+
diff --git a/docs/prison_changelog_v3.3.0-alpha.14.md b/docs/prison_changelog_v3.3.0-alpha.14.md
index 202b8f027..3020a36a6 100644
--- a/docs/prison_changelog_v3.3.0-alpha.14.md
+++ b/docs/prison_changelog_v3.3.0-alpha.14.md
@@ -4,7 +4,7 @@
## Build logs
- **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
- - [v3.2.0 through v3.3.0-alpha.16](prison_changelogs.md)
+ - [v3.2.0 through v3.3.0-alpha.18](prison_changelogs.md)
These build logs represent the work that has been going on within prison.
diff --git a/docs/prison_changelog_v3.3.0-alpha.15.md b/docs/prison_changelog_v3.3.0-alpha.15.md
index 44cf900a5..05004085e 100644
--- a/docs/prison_changelog_v3.3.0-alpha.15.md
+++ b/docs/prison_changelog_v3.3.0-alpha.15.md
@@ -4,7 +4,7 @@
## Build logs
- **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
- - [v3.2.0 through v3.3.0-alpha.16](prison_changelogs.md)
+ - [v3.2.0 through v3.3.0-alpha.18](prison_changelogs.md)
These build logs represent the work that has been going on within prison.
diff --git a/docs/prison_changelog_v3.3.0-alpha.16.md b/docs/prison_changelog_v3.3.0-alpha.16.md
index 69d13a70e..48debc744 100644
--- a/docs/prison_changelog_v3.3.0-alpha.16.md
+++ b/docs/prison_changelog_v3.3.0-alpha.16.md
@@ -4,7 +4,7 @@
## Build logs
- **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
- - [v3.2.0 through v3.3.0-alpha.16](prison_changelogs.md)
+ - [v3.2.0 through v3.3.0-alpha.18](prison_changelogs.md)
These build logs represent the work that has been going on within prison.
diff --git a/docs/prison_changelog_v3.3.0-alpha.18.md b/docs/prison_changelog_v3.3.0-alpha.18.md
new file mode 100644
index 000000000..61b2d86f2
--- /dev/null
+++ b/docs/prison_changelog_v3.3.0-alpha.18.md
@@ -0,0 +1,264 @@
+[Prison Documents - Table of Contents](prison_docs_000_toc.md)
+
+## Prison Build Logs for v3.3.x
+
+## Build logs
+ - **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
+ - [v3.2.0 through v3.3.0-alpha.18](prison_changelogs.md)
+
+
+These build logs represent the work that has been going on within prison.
+
+
+
+
+# 3.3.0-alpha.18 2024-05-20
+
+
+**Prison-3.3.0-alpha.18.jar**
+
+This version of prison works with Spigot v1.20.6 and Paper v1.20.6.
+
+The whole prison build environment was rewrote and updated to provide for a cleaner and more modern way to use dependencies within Gradle.
+
+In combination with updating most of the libraries and other dependencies, this resolved many issues that were initially preventing prison from working with Spigot v1.20.5 and v1.20.6.
+
+
+* Gradle updates: Upgraded from v7.3.3 to v8.7. Had to upgrade 22 times to reach v8.7. With gradle, if there is a future breaking change in the configs, it warns you in the before the next release. So incremental upgrading helps ensure the configs are fixed and functional before moving on to the next release.
+
+* Upgraded Spiget from v1.4.2 to 1.4.6. This checks prison's version for updates.
+Had to also rewrite the code using Spiget because the older build tools were having issues handling anonymous classes when building the final jar file with shadow.
+
+* Upgraded shadow from v6.10 to v8.1.1 2
+Shadow v8.x could only be used with gradle v8.x
+
+* Placeholders: There was an odd issue with placeholders when a discord plugin was using papi. For some reason, that plugin was sending the placeholders with null players. Now checks for nulls. Since it was a non-standard way of using papi, there may be other issues?
+
+* PlayerCache: Slight modification in getting the keySet so it will not be tied to the original PlayerCache's TreeMap. This will eliminate the possibilities of a concurrent modification exception if new players are brought online or unloaded.
+
+* Economies: Added a feature for external functions to be able to check if the player has an account. It's not being used yet, but it can be used to bypass code (and messages) if a player does not have an account.
+
+
+
+
+# 3.3.0-alpha.18 2024-05-20
+
+
+
+**Prison v3.3.0-alpha.18 2024-05-20**
+
+This version has been tested and confirmed to be working with Spigot v1.20.6 and Paper v1.20.6.
+
+
+
+ **Player Ranks GUI: Fixed an issue with the code not using the correct defaults for NoRankAccess when no value is provided in the configs.**
+
+
+
+ **Obsolete blocks: Marked an enum as @Deprecated to suppress a compile warning.** This has not real impact on anything.
+
+
+
+ **Gradle updates:**
+
+pgraded XSeries from v9.10.0 to v10.0.0
+
+pgraded nbtApi from v2.12.2 to v2.12.4
+
+pgraded luckperms-v5 from v5.0 to v5.4
+
+
+
+ **Economy: Added a feature to check if a player has an economy account.**
+
+urrently this is not being used outside of the economy integrations, but it can be used to help suppress initial startup messages where players do not have an account, which will help prevent flooding a lot of messages to the console for some servers.
+
+
+
+ **Player Cache: There was a report of a concurrent modification exception.**
+
+his is very rare and generally should not happen.
+
+he keySet is part of the original TreeMap collection, so the fix here is to take all keys and put them in a new collection so they are then disconnected from the original TreeSet.
+
+his will prevent a concurrent modification exception if there is an action to add or remove users from the user cache, since the user cache remains active and cannot be locked with a synchronization for any amount of time, other than then smallest possible.
+
+he standard solution with dealing with this TreeSet collection would be to synchronize the whole activity of saving the dirty elements of the player cache. Unfortunately, that will cause blocking transactions when player events try to access the player cache. Therefore it's a balance game of trying to protect the player cache with the minimal amount of synchronizations, but allow the least amount of I/O blocking for all other processes that are trying to use it.
+
+opefully this is sufficient to allow it all to work without conflict, and to be able to provide enough protection.
+
+
+
+ **Gradle: Removed a lot of the older commented out settings.**
+
+ee prior commits to better understand how things were setup before, or for references.
+
+
+
+ **Gradle: A few more adjustments to add a few more items to the libs.versions.toml.**
+
+
+
+
+ **Placeholders: The placeholder api call from PlaceholderAPI is passing a null OfflinePlayer object.**
+
+ot sure why this has never been an issue before, but added support for null OfflnePlayers.
+
+
+
+
+ **Spiget: Updated the way prison handles spiget by now submitting a task with a 5 second delay.**
+
+he messages are more helpful now.
+
+his also moves it out of the SpigotPrison class.
+
+
+
+ **Upgraded John Rengelman's shadow, a gradle plugin, from v6.1.0 to v8.1.1**
+
+
+
+
+
+ **Upgrade gradle from v7.6.4 to v8.7**
+
+ Upgraded from: v7.6.4 -> v8.0 -> v8.0.2 -> v8.1 -> v8.1.1
+
+ -> v8.2 -> v8.3 -> v8.4 -> v8.5 -> v8.6 -> v8.7
+
+ v8.3 required a configuration change due to `org.gradle.api.plugins.BasePluginConvention` type has been deprecated and will be removed in gradle v9.x. This is impacting the use of the `build.gradle`'s `archivesBaseNamme`. This is being replaced by the new `base{}` configuration block.
+
+ v8.3 also required other config changes.
+
+
+
+
+
+ **Upgrade spiget from v1.4.2 to v1.4.6**
+
+ Was using a jar with v1.4.2 due to their repo going down frequently.
+
+ Switched back to pulling through maven and got rid of jar.
+
+
+
+
+ **Upgrade gradle from v7.3.3 to v7.6.4**
+
+ Upgraded from: v7.3.3 -> v7.4 -> v7.4.1 -> v7.4.2
+
+ -> v7.5 -> v7.5.1 -> v7.6 -> v7.6.1 -> v7.6.2 -> v7.6.3 -> v7.6.4
+
+ Preparing for Gradle v8.x
+
+ Around v7.5.1 required a change to auto provisioning
+
+
+
+
+*v3.3.0-alpha.17a 2024-04-29**
+
+
+
+ **GUI settings: Update them to remove unused stuff.**
+
+
+
+ **GUI Tools messages: refined the messages and hooked them up.**
+
+
+
+ **Initial setup of the GUI tools messages that are at the bottom of a page.**
+
+etup the handling of the messages and added the messages to all of the language files.
+
+upport for prior, current, and next page. Also c
+
+ **Update the plugin.yml and removed the permissions configs since they were generating errors (lack of a schema) and the perms and handled through the prison command handler.**
+
+
+
+
+ **CustomItems: Fixed an issue when CustomItems is a plugin on the server, but the plugin fails to load.**
+
+herefore the problem was fixed to allow a failed CustomItems loading to bypass being setup and loaded for prison.
+
+CustomItems.isEnabled()` must exist and return a value of true before the integration is enabled.
+
+
+
+ **XSeries XMaterials: Update to XSeries v9.10.0 from v9.9.0.**
+
+ad issues with case sensitivity when using `valueOf()`, which was changed to `matchXMaterial().orElse(null)` which resolves a few issues.
+
+Materials v9.10.0 sets up support for spigot 1.20.5. There may be more changes as spigot stabilizes.
+
+he issue with using `valueOf("green_wool")` would not find any matches since the enum case must match the string value exactly. So `valueOf("GREEN_WOOL")` would have worked. This was fixed to help eliminate possible issues with configuring the server.
+
+
+
+ **Auto features: normal drop processing: Added a new feature to check inventory for being full, and if it is, then display the messages.**
+
+
+
+
+ **Auto features: Inventory full chat notification: bug fix. This fixes using the wrong player object.**
+
+t now use prison's player object so the color codes are properly translated.
+
+
+
+ **Placeholders: bug fix: When using a search from the console which included a player name, it was generating an invalid cast to a SpigotPlayer object when it wasn't related to that class due to the player being offline.**
+
+
+
+ **GUI: ranks and mines: setup and enable a new default access block type that can be used if that rank or mine has not been specifically specified.**
+
+
+
+ **GUI: tool bar's prior page and next page: Suppress the page buttons if there is only one page worth of gui content. **
+
+
+
+ **GUI: Player ranks: Fixed a bug where clicking on a rank in the player's gui was trying to run an empty command, which was generating an invalid command error.**
+
+gnores the command running if the command is either null or blank.
+
+
+
+
+ **Update to plugin.yml since some soft dependencies were missing.**
+
+
+
+ **Economies: fixed the display of too many economy related messages, including eliminating logging of messages for offline players.**
+
+he vault economy check for offline players, will now only show one informational message if a player is not setup in the economy.
+
+
+
+ **GUI Player ranks: The setting for Options.Ranks.MaterialType.NoRankAccess was not hooked up properly so it was not really working.**
+
+he config creation was wrong. Also fixed the code that was generating the gui.
+
+
+
+ **RankPlayer and topn ranking: This may not have an impact overall, but for both the default and prestiges ladders, they are defaulting to a value of -1 when performing a comparison between players.**
+
+
+
+ **Update privatebin-java-api to a newer release that now does a better job with a failure to use the correct protocol.**
+
+t identifies what TLS version is being used, and if TLSv1.3 is missing, then it will indicate that the java version needs to be updated.
+
+s a fallback, if the privatebin cannot be used, it is now using the older paste.helpch.at service. But if it does, the resulting documents are not purged and not encrypted.
+
+
+
+ **Economy: EdPrison's economy. Added support for use of EdPrison's economy and custom currencies.**
+
+his will allow prison to use EdPrison's economy does not also use another established economy that is accessible through vault, or multi-currency.
+
+
+
diff --git a/docs/prison_changelogs.md b/docs/prison_changelogs.md
index 5b67fdb73..189d308f2 100644
--- a/docs/prison_changelogs.md
+++ b/docs/prison_changelogs.md
@@ -22,6 +22,7 @@ These build logs represent the work that has been going on within prison.
- Future updates will be under the v3.3.x release
+ - [v3.3.3-alpha.18 - 2024-05-20](prison_changelog_v3.3.0-alpha.18.md)
- [v3.3.3-alpha.17 - 2024-04-20](prison_changelog_v3.3.0-alpha.17.md)
- [v3.3.3-alpha.16 - 2023-11-18](prison_changelog_v3.3.0-alpha.16.md)
- [v3.3.3-alpha.15 - 2023-07-07](prison_changelog_v3.3.0-alpha.15.md)
diff --git a/docs/prison_chnagelog_v3.3.0-alpha.17.md b/docs/prison_chnagelog_v3.3.0-alpha.17.md
index 08b51b908..346f63ef9 100644
--- a/docs/prison_chnagelog_v3.3.0-alpha.17.md
+++ b/docs/prison_chnagelog_v3.3.0-alpha.17.md
@@ -4,7 +4,7 @@
## Build logs
- **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
- - [v3.2.0 through v3.3.0-alpha.17](prison_changelogs.md)
+ - [v3.2.0 through v3.3.0-alpha.18](prison_changelogs.md)
These build logs represent the work that has been going on within prison.
diff --git a/docs/prison_docs_000_toc.md b/docs/prison_docs_000_toc.md
index 66e1cd54a..d1ab73d46 100644
--- a/docs/prison_docs_000_toc.md
+++ b/docs/prison_docs_000_toc.md
@@ -2,7 +2,7 @@
-*Documented updated: 2023-11-18*
+*Documented updated: 2024-05-20*
## Project Related
@@ -20,7 +20,7 @@
## Build logs
- **[v3.3.0-alpha - Current](changelog_v3.3.x.md)**
- - [v3.2.0 through v3.2.11](prison_changelogs.md)
+ - [v3.2.0 through v3.2.18](prison_changelogs.md)
@@ -28,16 +28,21 @@
-# Prison Supports Spigot 1.8 through Spigot 1.20.x+
-# Prison Supports Java 1.8 though Java 20+
-# Prison is created for the Spigot Platform, and works on other platforms based upon Spigot
+# Prison Supports Spigot 1.8 through Spigot 1.20.6 and +
+# Prison Supports Java 1.8 though Java 21+
+# Prison is created for the Spigot Platform, and works on other platforms based upon Spigot, tested with Paper 1.20.6 too.
-Prison supports Spigot 1.20.x, along with Java 1.8 through Java 20. At this time there hasn't been any reports of incompatibilities. Since prison is using a library to support the correct blocks for the version of the server that you are running, we are limited to when updates are released for that library. Luckily they have had a couple of releases and we have applied them to the latest alpha releases. So if you are wanting to maximize the new Spigot 1.20 experience, please upgrade to the latest alpha release as found on our discord server in the #alpha channel.
+Prison supports Spigot 1.20.x, along with Java 1.8 through Java 21.
+
+Prison is using a library to support the correct blocks for the version of the server that you are running, so we are limited to when updates are released for that library. Generally though, they are quick to get updates posted.
+
### Newer features and updates in Prison:
+NOTE: This list has not been updated in a while...
+
* Prison's AutoFeatures was redesigned to support more Event Listener Priorities. This means prison is more flexible and will work with more plugins, using them the way you want to. Some of the new priorities are `ACCESS` so you can use Prison's Mine and Teleport Access by Rank without having to use Prison's block handlers. This bypasses the need to configure WorldGuard regions for access to the mines that are linked to Prison Ranks.
* Now supports RevEnchants, both with Prison handling the block break events, and with RevEnchants handling the events.
diff --git a/gradle.properties b/gradle.properties
index 9a99620df..040b338b6 100644
--- a/gradle.properties
+++ b/gradle.properties
@@ -3,7 +3,7 @@
## # This is actually the "correct" place to define the version for the project.
## # Used within build.gradle with ${project.version}.
## # Can be overridden on the command line: gradle -Pversion=3.2.1-alpha.3
-version=3.3.0-alpha.17a
+version=3.3.0-alpha.18
diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml
new file mode 100644
index 000000000..62104e59f
--- /dev/null
+++ b/gradle/libs.versions.toml
@@ -0,0 +1,95 @@
+# This file was generated by the Gradle 'init' task.
+#
+# https://docs.gradle.org/current/userguide/platforms.html#sub::toml-dependencies-format
+#
+
+# For Gradle v2.0 Java 8: Shadow v?
+# For Gradle v5.0 Java 11: Shadow v5.0
+# For Gradle v7.3 Java 17: Shadow v7.1.2 Groovy: def v3.0.9
+# For Gradle v8.5: Java 21: Shadow v8.x Groovy: def v3.0.17
+
+
+# https://mvnrepository.com/artifact/com.google.code.gson/gson
+# https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
+# https://mvnrepository.com/artifact/com.google.guava/guava
+#
+# Note: papi has two possible URLs: The second one is the offical but the repo does not work well.
+# com.github.placeholderapi:placeholderapi
+# me.clip:placeholderapi
+#
+#
+
+
+[versions]
+shadow = "8.1.1"
+
+bstats = "3.0.2"
+commons-lang3 = "3.12.0"
+groovy = "3.0.9"
+gson = "2.10.1"
+spiget = "1.4.6-SNAPSHOT"
+xseries = "10.0.0"
+junit = "4.12"
+guava = "31.1-jre"
+spigotApi = "1.13.2-R0.1-SNAPSHOT"
+
+nbtApi = "2.12.4"
+papi = "2.11.5"
+vault = "1.7.1"
+
+luckperms-v4 = "4.4"
+luckperms-v5 = "5.4"
+
+itemsAdder = "3.5.0b"
+
+
+
+
+[libraries]
+bstats-base = { module = "org.bstats:bstats-base", version.ref = "bstats" }
+bstats-bucket = { module = "org.bstats:bstats-bukkit", version.ref = "bstats" }
+
+commons-lang3 = { module = "org.apache.commons:commons-lang3", version.ref = "commons-lang3" }
+
+gson = { module = "com.google.code.gson:gson", version.ref = "gson" }
+guava = { module = "com.google.guava:guava", version.ref = "guava" }
+
+junit = { module = "junit:junit", version.ref = "junit" }
+
+nbtApi = { module = "de.tr7zw:item-nbt-api", version.ref = "nbtApi" }
+
+papi = { module = "com.github.placeholderapi:placeholderapi", version.ref = "papi" }
+#papi = { module = "me.clip:placeholderapi", version.ref = "papi" }
+
+luckperms-v4 = { module = "me.lucko.luckperms:luckperms-api", version.ref = "luckperms-v4" }
+luckperms-v5 = { module = "net.luckperms:api", version.ref = "luckperms-v5" }
+
+itemsAdder = { module = "com.github.LoneDev6:API-ItemsAdder", version.ref = "itemsAdder" }
+
+spiget = { module = "org.inventivetalent.spiget-update:bukkit", version.ref = "spiget" }
+
+spigotApi = { module = "org.spigotmc:spigot-api", version.ref = "spigotApi" }
+
+
+vault = { module = "com.github.MilkBowl:VaultAPI", version.ref = "vault" }
+xseries = { module = "com.github.cryptomorin:XSeries", version.ref = "xseries" }
+
+
+
+# direct version:
+# gson = { module = "com.google.code.gson:gson", version = "2.9.1" }
+
+
+
+
+
+
+[plugins]
+shadow = { id = "com.github.johnrengelman.shadow", version.ref = "shadow" }
+
+
+
+
+[bundles]
+bstats = ["bstats-base", "bstats-bucket"]
+
diff --git a/gradle/wrapper/gradle-wrapper.jar b/gradle/wrapper/gradle-wrapper.jar
index 7454180f2..e6441136f 100644
Binary files a/gradle/wrapper/gradle-wrapper.jar and b/gradle/wrapper/gradle-wrapper.jar differ
diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties
index 669386b87..e7646dead 100644
--- a/gradle/wrapper/gradle-wrapper.properties
+++ b/gradle/wrapper/gradle-wrapper.properties
@@ -1,5 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-all.zip
+networkTimeout=10000
+validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
diff --git a/gradlew b/gradlew
index c53aefaa5..1aa94a426 100644
--- a/gradlew
+++ b/gradlew
@@ -1,7 +1,7 @@
#!/bin/sh
#
-# Copyright © 2015-2021 the original authors.
+# 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.
@@ -32,10 +32,10 @@
# 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».
+# * 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:
#
@@ -55,7 +55,7 @@
# Darwin, MinGW, and NonStop.
#
# (3) This script is generated from the Groovy template
-# https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt
+# 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/.
@@ -80,13 +80,11 @@ do
esac
done
-APP_HOME=$( cd "${APP_HOME:-./}" && pwd -P ) || exit
-
-APP_NAME="Gradle"
+# This is normally unused
+# shellcheck disable=SC2034
APP_BASE_NAME=${0##*/}
-
-# 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"'
+# Discard cd standard output in case $CDPATH is set (https://github.com/gradle/gradle/issues/25036)
+APP_HOME=$( cd "${APP_HOME:-./}" > /dev/null && pwd -P ) || exit
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD=maximum
@@ -133,22 +131,29 @@ 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.
+ if ! command -v java >/dev/null 2>&1
+ then
+ 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
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=SC2039,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=SC2039,SC3045
ulimit -n "$MAX_FD" ||
warn "Could not set maximum file descriptor limit to $MAX_FD"
esac
@@ -193,11 +198,15 @@ if "$cygwin" || "$msys" ; then
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.
+
+# 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"'
+
+# Collect all arguments for the java command:
+# * DEFAULT_JVM_OPTS, JAVA_OPTS, JAVA_OPTS, and optsEnvironmentVar are not allowed to contain shell fragments,
+# and any embedded shellness will be escaped.
+# * For example: A user cannot expect ${Hostname} to be expanded, as it is an environment variable and will be
+# treated as '${Hostname}' itself on the command line.
set -- \
"-Dorg.gradle.appname=$APP_BASE_NAME" \
@@ -205,6 +214,12 @@ set -- \
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.
diff --git a/gradlew.bat b/gradlew.bat
index 107acd32c..25da30dbd 100644
--- a/gradlew.bat
+++ b/gradlew.bat
@@ -14,7 +14,7 @@
@rem limitations under the License.
@rem
-@if "%DEBUG%" == "" @echo off
+@if "%DEBUG%"=="" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@@ -25,7 +25,8 @@
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
-if "%DIRNAME%" == "" set DIRNAME=.
+if "%DIRNAME%"=="" set DIRNAME=.
+@rem This is normally unused
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@@ -40,13 +41,13 @@ if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
-if "%ERRORLEVEL%" == "0" goto execute
+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.
+echo. 1>&2
+echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -56,11 +57,11 @@ 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.
+echo. 1>&2
+echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
+echo. 1>&2
+echo Please set the JAVA_HOME variable in your environment to match the 1>&2
+echo location of your Java installation. 1>&2
goto fail
@@ -75,13 +76,15 @@ set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
:end
@rem End local scope for the variables with windows NT shell
-if "%ERRORLEVEL%"=="0" goto mainEnd
+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!
-if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
-exit /b 1
+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
diff --git a/gradlew8.bat b/gradlew8.bat
index 37eea68fa..95f576820 100644
--- a/gradlew8.bat
+++ b/gradlew8.bat
@@ -1 +1 @@
-./gradlew build -Dorg.gradle.java.home="C:\Program Files\Java\jdk-1.8_411" --stacktrace %*
\ No newline at end of file
+./gradlew -Dorg.gradle.java.home="C:\Program Files\Java\jdk-1.8_411" %*
\ No newline at end of file
diff --git a/prison-core/build.gradle b/prison-core/build.gradle
index d7aee16cf..8deb786e6 100644
--- a/prison-core/build.gradle
+++ b/prison-core/build.gradle
@@ -16,31 +16,22 @@
* along with this program. If not, see .
*/
-apply plugin: 'eclipse'
-apply plugin: 'idea'
-apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
-repositories {
- mavenCentral()
-
- //maven { url = "https://jitpack.io" }
-}
-
dependencies {
- implementation 'org.apache.commons:commons-lang3:3.12.0'
+ implementation( libs.commons.lang3 )
- // https://github.com/InstantlyMoist/privatebin-java-api
- //implementation 'com.github.InstantlyMoist:privatebin-java-api:1.0.2'
+ implementation( libs.gson )
- //implementation 'org.json:json:20230227'
+ implementation 'org.json:json:20230227'
implementation fileTree(dir: 'lib',
- include: ['PrivateBin-java-1.1-SNAPSHOT.jar',
- 'json-20230227.jar'])
+ include: ['PrivateBin-java-1.1-SNAPSHOT.jar'
+ , 'json-20230227.jar'
+ ])
}
@@ -54,21 +45,24 @@ processResources {
shadowJar {
dependencies {
- include(dependency('org.apache.commons:commons-lang3:3.12.0'))
+ include(dependency('org.apache.commons:commons-lang3:'))
// https://mvnrepository.com/artifact/com.google.code.gson/gson
- include(dependency('com.google.code.gson:gson:2.10.1'))
- //include(dependency('com.google.code.gson:gson:2.8.6'))
+ include(dependency('com.google.code.gson:gson:'))
- include(dependency('org.json:json:20230227'))
- include(dependency('com.github.InstantlyMoist:privatebin-java-api:*'))
+ //include(dependency('org.json:json:20230227'))
+
+ include(dependency('com.github.InstantlyMoist:privatebin-java-api:'))
}
- relocate 'org.json', 'tech.mcprison.prison.orgjson'
- relocate 'com.github.InstantlyMoist', 'tech.mcprison.prison.privatebin8'
+ // For privatebin wrapper: Paste:
+ relocate 'nl.kyllian', 'tech.mcprison.prison.libs.privatebin'
+
+ // Used with privatebin:
+ relocate 'org.json', 'tech.mcprison.prison.libs.orgjson'
- classifier 'API'
+ //classifier 'API'
archiveVersion = null
}
diff --git a/prison-core/src/main/java/tech/mcprison/prison/cache/PlayerCacheSaveAllPlayersTask.java b/prison-core/src/main/java/tech/mcprison/prison/cache/PlayerCacheSaveAllPlayersTask.java
index 6f6c0c32e..917540f79 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/cache/PlayerCacheSaveAllPlayersTask.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/cache/PlayerCacheSaveAllPlayersTask.java
@@ -2,7 +2,9 @@
import java.util.ArrayList;
import java.util.List;
+import java.util.Map;
import java.util.Set;
+import java.util.TreeSet;
import tech.mcprison.prison.Prison;
import tech.mcprison.prison.output.Output;
@@ -62,15 +64,18 @@ public void run()
PlayerCache.PLAYER_CACHE_TIME_TO_LIVE_VALUE_SEC
);
- Set keys = pCache.getPlayers().keySet();
+ Map syncMap = pCache.getPlayers();
+
+ Set keys = new TreeSet<>( syncMap.keySet() );
for ( String key : keys )
{
PlayerCachePlayerData playerData = null;
- synchronized ( pCache.getPlayers() ) {
-
- playerData = pCache.getPlayers().get( key );
+ synchronized ( syncMap ) {
+ if ( syncMap.containsKey( key ) ) {
+ playerData = syncMap.get( key );
+ }
}
if ( playerData != null ) {
@@ -115,7 +120,7 @@ public void run()
}
}
- synchronized ( pCache.getPlayers() ) {
+ synchronized ( syncMap ) {
for ( PlayerCachePlayerData playerData : purge ) {
try {
diff --git a/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyCurrencyIntegration.java b/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyCurrencyIntegration.java
index 34baea931..daa6f58af 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyCurrencyIntegration.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyCurrencyIntegration.java
@@ -27,6 +27,8 @@ public boolean hasCurrency( String currency ) {
public abstract boolean supportedCurrency( String currency );
+ public abstract boolean hasAccount( Player player );
+
public abstract double getBalance( Player player, String currency );
public abstract boolean setBalance( Player player, double amount, String currency );
diff --git a/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyIntegration.java b/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyIntegration.java
index 1cd42d4fb..dc9042f95 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyIntegration.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/integration/EconomyIntegration.java
@@ -16,6 +16,8 @@ public EconomyIntegration( String keyName, String providerName ) {
}
+ public abstract boolean hasAccount( Player player );
+
/**
* Returns the player's current balance.
*
diff --git a/prison-core/src/main/java/tech/mcprison/prison/util/ObsoleteBlockType.java b/prison-core/src/main/java/tech/mcprison/prison/util/ObsoleteBlockType.java
index ea5e72875..cbf4e6c34 100644
--- a/prison-core/src/main/java/tech/mcprison/prison/util/ObsoleteBlockType.java
+++ b/prison-core/src/main/java/tech/mcprison/prison/util/ObsoleteBlockType.java
@@ -51,6 +51,7 @@
* @since API 1.0
* @deprecated since v3.2.6
*/
+@Deprecated
public enum ObsoleteBlockType {
/**
diff --git a/prison-mines/build.gradle b/prison-mines/build.gradle
index 57678c339..5f24da4ac 100644
--- a/prison-mines/build.gradle
+++ b/prison-mines/build.gradle
@@ -1,16 +1,10 @@
group 'tech.mcprison'
-apply plugin: 'java'
+//apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
-//sourceCompatibility = 1.8
-
-repositories {
- mavenCentral()
-}
-
dependencies {
implementation project(':prison-core')
testImplementation group: 'junit', name: 'junit', version: '4.12'
diff --git a/prison-misc/build.gradle b/prison-misc/build.gradle
index 5d17da6d5..f7695a752 100644
--- a/prison-misc/build.gradle
+++ b/prison-misc/build.gradle
@@ -18,20 +18,10 @@
group 'tech.mcprison'
-apply plugin: 'java'
-
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
-//sourceCompatibility = 1.8
-
-
-// https://www.spigotmc.org/wiki/spigot-gradle/
-
-
repositories {
- mavenCentral()
-
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
@@ -43,6 +33,8 @@ repositories {
includeGroup 'org.spigotmc'
}
}
+
+
/*
As Spigot-API depends on the BungeeCord ChatComponent-API,
we need to add the Sonatype OSS repository, as Gradle,
@@ -82,10 +74,5 @@ dependencies {
compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
-
testImplementation group: 'junit', name: 'junit', version: '4.12'
-
}
-
-
-
diff --git a/prison-ranks/build.gradle b/prison-ranks/build.gradle
index 57678c339..cc15db280 100644
--- a/prison-ranks/build.gradle
+++ b/prison-ranks/build.gradle
@@ -1,16 +1,8 @@
group 'tech.mcprison'
-apply plugin: 'java'
-
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
-//sourceCompatibility = 1.8
-
-repositories {
- mavenCentral()
-}
-
dependencies {
implementation project(':prison-core')
testImplementation group: 'junit', name: 'junit', version: '4.12'
diff --git a/prison-sellall/build.gradle b/prison-sellall/build.gradle
index 3b895b999..4b47bc2a0 100644
--- a/prison-sellall/build.gradle
+++ b/prison-sellall/build.gradle
@@ -18,28 +18,10 @@
group 'tech.mcprison'
-apply plugin: 'eclipse'
-apply plugin: 'idea'
-apply plugin: 'java'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
-repositories {
- mavenCentral()
-
- maven { url = "https://repo.codemc.org/repository/maven-public/" }
-
-// maven {
-// url = 'https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries'
-// content {
-// includeGroup 'com.github.cryptomorin'
-// }
-// }
-
-}
-
-
dependencies {
implementation project(':prison-core')
@@ -47,14 +29,11 @@ dependencies {
implementation project(':prison-ranks')
-
// https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries
// implementation 'com.github.cryptomorin:XSeries:9.10.0'
-
testImplementation group: 'junit', name: 'junit', version: '4.12'
-
}
shadowJar {
@@ -62,7 +41,6 @@ shadowJar {
// include(dependency('org.apache.commons:commons-lang3:3.12.0'))
// include(dependency('com.google.code.gson:gson:2.8.6'))
}
- classifier 'API'
archiveVersion = null
}
diff --git a/prison-spigot-alt/build.gradle b/prison-spigot-alt/build.gradle
new file mode 100644
index 000000000..255458369
--- /dev/null
+++ b/prison-spigot-alt/build.gradle
@@ -0,0 +1,314 @@
+/*
+ * Prison is a Minecraft plugin for the prison game mode.
+ * Copyright (C) 2017 The Prison Team
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+group 'tech.mcprison'
+
+apply plugin: 'java'
+
+compileJava.options.encoding = 'UTF-8'
+compileTestJava.options.encoding = "UTF-8"
+
+
+// NOTE: The sourceCompatibility will be removed in gradle v9.x.
+// Not going to worry about this, since this sub-proect is not being used.
+// More info:
+// https://docs.gradle.org/8.3/userguide/upgrading_version_8.html#java_convention_deprecation
+//sourceCompatibility = 17
+
+repositories {
+ mavenCentral()
+
+ // net.luckperm.api:
+ maven { url = "https://hub.spigotmc.org/nexus/content/groups/public" }
+
+ // The following houses many repos, so don't limit to just luckperms:
+ // net.milkbowl, be.maximvdw, org.bstats:bstats-bukkit
+ maven { url = "https://repo.lucko.me/" }
+
+ maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
+ maven { url = "https://nexus.hc.to/content/repositories/pub_releases" }
+
+ maven { url = "https://repo.codemc.org/repository/maven-public/" }
+ //maven { url = "https://repo.inventivetalent.org/content/groups/public/" }
+
+
+// NOTE: mvdw support has been removed from prison since PAPI works with it:
+// maven {
+// url = "https://repo.mvdw-software.be/content/groups/public/"
+// content {
+// includeGroup 'be.maximvdw'
+// }
+// }
+ maven {
+ url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
+ content {
+ includeGroup 'me.clip'
+ }
+ }
+ maven { url = "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3/" }
+
+
+ maven {
+ url = 'https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries'
+ content {
+ includeGroup 'com.github.cryptomorin'
+ }
+ }
+
+
+ maven {
+ name = "CodeMC"
+ url = uri("https://repo.codemc.io/repository/maven-public/")
+// url = 'https://repo.codemc.io/service/rest/repository/browse/maven-public/de/tr7zw/item-nbt-api-plugin'
+// url = 'https://mvnrepository.com/artifact/de.tr7zw/item-nbt-api-plugin'
+ content {
+ includeGroup 'de.tr7zw'
+ }
+ }
+
+
+ maven { url 'https://jitpack.io' }
+
+
+ // maven { url = 'https://repo.pcgamingfreaks.at/repository/maven-everything' }
+ // maven { url = 'https://maven.enginehub.org/repo/' }
+ // maven { url = "https://nexus.badbones69.com/repository/maven-releases/" }
+
+}
+
+
+
+dependencies {
+ implementation project(':prison-core')
+ implementation project(':prison-mines')
+ implementation project(':prison-ranks')
+ implementation project(':prison-sellall')
+ implementation project(':prison-spigot')
+
+ // implementation project(':prison-worldguard6')
+
+
+ // https://mvnrepository.com/artifact/org.bstats/bstats-base
+ // https://mvnrepository.com/artifact/org.bstats/bstats-bukkit
+// implementation 'org.bstats:bstats-base:3.0.2'
+// implementation 'org.bstats:bstats-bukkit:3.0.2'
+// implementation 'org.bstats:bstats-base:2.2.1'
+// implementation 'org.bstats:bstats-bukkit:2.2.1'
+
+
+ // Repo keeps going down:
+ //implementation 'org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'
+ // Using jar instead: lib/Spiget_v1.4.2.prison-build.jar
+
+
+ // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
+// implementation 'org.apache.commons:commons-lang3:3.12.0'
+
+
+
+/*
+ // https://mvnrepository.com/artifact/com.sk89q.worldedit/worldedit-core
+ implementation 'com.sk89q.worldedit:worldedit-core:7.2.15'
+
+ // https://mvnrepository.com/artifact/com.sk89q.worldedit/worldedit-bukkit
+ compileOnly 'com.sk89q.worldedit:worldedit-bukkit:7.2.15'
+
+
+ // https://mvnrepository.com/artifact/com.sk89q.worldguard/worldguard-core
+ compileOnly 'com.sk89q.worldguard:worldguard-core:7.0.8'
+
+ // https://mvnrepository.com/artifact/com.sk89q.worldguard/worldguard-bukkit
+ compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.8'
+
+ // https://mvnrepository.com/artifact/com.sk89q.worldguard.worldguard-libs/core
+ implementation 'com.sk89q.worldguard.worldguard-libs:core:7.0.8'
+*/
+
+
+
+
+// compileOnly 'me.clip:placeholderapi:2.11.5'
+ //compileOnly 'me.clip:placeholderapi:2.11.2'
+ //compileOnly 'me.clip:placeholderapi:2.10.9'
+
+ // Repo may be hosted: https://hub.spigotmc.org/nexus/content/groups/public/
+ // But do not see v5.0
+// compileOnly 'net.luckperms:api:5.0'
+
+ // https://mvnrepository.com/artifact/me.lucko.luckperms/luckperms-api
+// compileOnly 'me.lucko.luckperms:luckperms-api:4.4'
+
+
+
+ // https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries
+// implementation 'com.github.cryptomorin:XSeries:9.10.0'
+
+
+
+// This includes 535KB when all we need is 1 class!
+// implementation 'me.badbones69:crazyenchantments-plugin:1.8-Dev-Build-v8'
+
+
+ // 1.9.4-R0.1-SNAPSHOT has been the version used for a long time:
+// compileOnly 'org.spigotmc:spigot-api:1.9.4-R0.1-SNAPSHOT'
+ // 1.12.2-R0.1-SNAPSHOT works well:
+// compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
+ // 1.13.2 fails since deprecated functions have been removed.
+// compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
+
+
+
+// NOTE: The repo is no longer resolving to the correct resources:
+// compileOnly 'at.pcgamingfreaks:Minepacks-API:2.3.22'
+// compileOnly 'at.pcgamingfreaks:Minepacks-API:2.3.21.3'
+
+
+ // https://mvnrepository.com/artifact/com.github.MilkBowl/VaultAPI
+// compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
+
+// compileOnly('be.maximvdw:MVdWPlaceholderAPI:2.5.2-SNAPSHOT'){
+// exclude group: 'org.spigotmc'
+// }
+
+ // compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.1'
+
+
+ // NOTE: mavenrepository.com is not the offical repo.
+ // NOTE: This item-nbt MUST use the API and not the plugin version!
+ // Good: https://repo.codemc.io/service/rest/repository/browse/maven-public/de/tr7zw/item-nbt-api/
+ // Bad?: https://repo.codemc.io/service/rest/repository/browse/maven-public/de/tr7zw/item-nbt-api-plugin/2.11.3/
+ // NOTE: This maven repo was failing to be accessable during online builds. So added to the /lib.
+ // https://github.com/tr7zw/Item-NBT-API/wiki/Using-Gradle
+ // https://www.spigotmc.org/resources/nbt-api.7939/
+ // https://mvnrepository.com/artifact/de.tr7zw/item-nbt-api-plugin
+// implementation 'de.tr7zw:item-nbt-api:2.12.2'
+// implementation 'de.tr7zw:item-nbt-api:2.12.0'
+
+
+ // https://github.com/LoneDev6/API-ItemsAdder#-packages
+ // https://github.com/LoneDev6/API-ItemsAdder/tags
+// compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.5.0b'
+// compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.2.5'
+
+
+
+ compileOnly fileTree(dir: 'lib', include: ['*.jar'],
+ exclude: ['Spiget_v1.4.2.prison-build.jar',
+ // 'CrazyEnchantments-plugin-api.v1.8-Dev-Build-v8.jar',
+ 'Zenchantments__API_v1.15.2.build4.jar'])
+ implementation fileTree(dir: 'lib',
+ include: ['Spiget_v1.4.2.prison-build.jar',
+ // 'CrazyEnchantments-plugin-api.v1.8-Dev-Build-v8.jar',
+ 'Zenchantments__API_v1.15.2.build4.jar'])
+
+
+// compile fileTree(dir: 'lib', include: ['SPIGET__BUKKIT-1.4.2-SNAPSHOT.jar'])
+
+// compileOnly fileTree(dir: 'lib', include: ['*.jar'], exclude: ['TokenEnchantAPI-15.5.0.jar'])
+// compile fileTree(dir: 'lib', include: ['TokenEnchantAPI-18.5.0.jar'])
+
+
+
+ testImplementation group: 'junit', name: 'junit', version: '4.12'
+
+}
+
+/*
+clean {
+ delete "${rootProject.name}.jar"
+}
+*/
+
+processResources {
+ from(sourceSets.main.resources.srcDirs) {
+ expand 'version': project.version
+ include 'plugin.yml'
+ }
+
+ from(sourceSets.main.resources.srcDirs) {
+ exclude 'plugin.yml'
+ }
+
+ // Need to have includ duplicates for the version to be updated in the plugin.yml file.
+ // Also the final build is actually smaller with include.
+ duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
+// duplicatesStrategy = DuplicatesStrategy.EXCLUDE // do not allow duplicates
+}
+
+shadowJar {
+ dependsOn(project(':prison-spigot').shadowJar)
+
+ dependencies {
+ // include(dependency('org.apache.commons:commons-lang3:'))
+
+ // https://mvnrepository.com/artifact/com.google.code.gson/gson
+// include(dependency('com.google.code.gson:gson:'))
+
+
+ // include(dependency('org.bstats:bstats-base:'))
+ // include(dependency('org.bstats:bstats-bukkit:'))
+
+
+// include(dependency('me.clip:placeholderapi:'))
+
+ // https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries
+// include(dependency('com.github.cryptomorin:XSeries:'))
+
+
+ // https://mvnrepository.com/artifact/de.tr7zw/item-nbt-api-plugin
+// include(dependency('de.tr7zw:item-nbt-api:'))
+
+
+ //include(dependency('org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'))
+ //include(dependency('me.badbones69:crazyenchantments-plugin:1.8-Dev-Build-v8'))
+
+// include(project(':prison-core'))
+// include(project(':prison-mines'))
+// include(project(':prison-ranks'))
+// include(project(':prison-sellall'))
+// include(project(':prison-spigot'))
+ }
+
+
+
+
+
+ relocate 'tech.mcprison.prison', 'tech.mcprison.prison.alt'
+
+ relocate 'org.bstats', 'tech.mcprison.prison.alt.bstats'
+
+ relocate 'org.inventivetalent.update.spiget', 'tech.mcprison.prison.alt.spiget'
+ relocate 'com.cryptomorin', 'tech.mcprison.prison.alt.cryptomorin'
+
+ relocate 'de.tr7zw.changeme.nbtapi', 'tech.mcprison.prison.alt.nbtapi'
+ relocate 'de.tr7zw.nbtapi', 'tech.mcprison.prison.alt.nbtapi'
+
+ //relocate 'me.badbones69.crazyenchantments.api.events.BlastUseEvent', 'tech.mcprison.prison.alt.crazyenchantments.api'
+
+
+ archiveAppendix = 'alt'
+ archiveClassifier = ''
+// archiveClassifier = project.property('targetArchiveClassifier')
+// archiveClassifier = 'java1.8'
+
+
+// minimize()
+}
+
+
+build.dependsOn(shadowJar)
diff --git a/prison-spigot-alt/src/main/resources/plugin.yml b/prison-spigot-alt/src/main/resources/plugin.yml
new file mode 100644
index 000000000..a24af7f6b
--- /dev/null
+++ b/prison-spigot-alt/src/main/resources/plugin.yml
@@ -0,0 +1,58 @@
+---
+name: PrisonAlt
+prefix: PrisonAlt
+description: This is an alt build of Prison.
+website: https://prison.jar-mc.com
+version: ${version}
+# Older versions than 1.13 will ignore this, but this will allow 1.13 and up to use newer block types?
+api-version: 1.13
+api: v1.13
+main: tech.mcprison.prison.alt.spigot.SpigotPrison
+author: RoyalBlueRanger
+authors:
+ - RoyalBlueRanger
+ - AnonymousGCA (GABRYCA)
+ - Madog24
+ - SirFaizdat (creator)
+ - Perksey
+ - Norbik1004
+ - ValdemarF
+ - Camouflage100
+ - GladiatorMC
+softdepend:
+ - Prison
+ - Essentials
+ - EssentialsX
+ - Vault
+ - ProtocolLib
+ - LuckPerms
+ - WorldEdit
+ - WorldGuard
+ - Multiverse-Core
+ - Multiworld
+ - MVdWPlaceholderAPI
+ - PlaceholderAPI
+ - Multiverse
+ - FastAsyncWorldEdit
+ - PermissionsEx
+ - GroupManagerX
+ - GemsEconomy
+ - TokenEnchant
+ - CMI
+ - CMILib
+ - CMIEInjector
+ - CMIPaperLib
+ - Economy_CMI
+ - mcMMO
+ - PlotSquared
+ - AnimatedScoreboard
+ - ViaRewind
+ - Citizens
+ - OldCombatMMechanics
+ - ShopGUIPlus
+ - EliteMobs
+ - CombatLogX
+ - ExaltedEconomy
+ - CoinsEngineEconomy
+ - SaneEconomy
+ - EdPrison
diff --git a/prison-spigot/build.gradle b/prison-spigot/build.gradle
index baa978ed1..2a6f8150e 100644
--- a/prison-spigot/build.gradle
+++ b/prison-spigot/build.gradle
@@ -16,9 +16,18 @@
* along with this program. If not, see .
*/
-group 'tech.mcprison'
-apply plugin: 'java'
+plugins {
+ id 'java'
+ id 'base'
+}
+
+
+base {
+ archivesName = 'Prison'
+}
+
+group 'tech.mcprison'
compileJava.options.encoding = 'UTF-8'
compileTestJava.options.encoding = "UTF-8"
@@ -26,45 +35,9 @@ compileTestJava.options.encoding = "UTF-8"
//sourceCompatibility = 1.8
repositories {
- mavenCentral()
-
- // net.luckperm.api:
+
maven { url = "https://hub.spigotmc.org/nexus/content/groups/public" }
- // The following houses many repos, so don't limit to just luckperms:
- // net.milkbowl, be.maximvdw, org.bstats:bstats-bukkit
- maven { url = "https://repo.lucko.me/" }
-
- maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
- maven { url = "https://nexus.hc.to/content/repositories/pub_releases" }
-
- maven { url = "https://repo.codemc.org/repository/maven-public/" }
- //maven { url = "https://repo.inventivetalent.org/content/groups/public/" }
-
-
-// NOTE: mvdw support has been removed from prison since PAPI works with it:
-// maven {
-// url = "https://repo.mvdw-software.be/content/groups/public/"
-// content {
-// includeGroup 'be.maximvdw'
-// }
-// }
- maven {
- url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
- content {
- includeGroup 'me.clip'
- }
- }
- maven { url = "https://mvnrepository.com/artifact/org.apache.commons/commons-lang3/" }
-
-
- maven {
- url = 'https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries'
- content {
- includeGroup 'com.github.cryptomorin'
- }
- }
-
maven {
name = "CodeMC"
@@ -93,25 +66,35 @@ dependencies {
implementation project(':prison-mines')
implementation project(':prison-ranks')
implementation project(':prison-sellall')
+
+
+ implementation( libs.commons.lang3 )
- // implementation project(':prison-worldguard6')
+ implementation( libs.gson )
+ implementation( libs.spiget )
- // https://mvnrepository.com/artifact/org.bstats/bstats-base
- // https://mvnrepository.com/artifact/org.bstats/bstats-bukkit
- implementation 'org.bstats:bstats-base:3.0.2'
- implementation 'org.bstats:bstats-bukkit:3.0.2'
-// implementation 'org.bstats:bstats-base:2.2.1'
-// implementation 'org.bstats:bstats-bukkit:2.2.1'
+ implementation( libs.bundles.bstats )
- // Repo keeps going down:
- //implementation 'org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'
- // Using jar instead: lib/Spiget_v1.4.2.prison-build.jar
-
+ compileOnly( libs.spigotApi )
+
+ compileOnly( libs.luckperms.v4 )
+ compileOnly( libs.luckperms.v5 )
- // https://mvnrepository.com/artifact/org.apache.commons/commons-lang3
- implementation 'org.apache.commons:commons-lang3:3.12.0'
+ compileOnly( libs.papi )
+
+ compileOnly( libs.vault )
+ implementation( libs.xseries )
+
+ implementation( libs.nbtApi )
+
+ // https://github.com/LoneDev6/API-ItemsAdder#-packages
+ // https://github.com/LoneDev6/API-ItemsAdder/tags
+ compileOnly( libs.itemsAdder )
+
+ // implementation project(':prison-worldguard6')
+
@@ -134,23 +117,18 @@ dependencies {
*/
-
-
- compileOnly 'me.clip:placeholderapi:2.11.5'
- //compileOnly 'me.clip:placeholderapi:2.11.2'
- //compileOnly 'me.clip:placeholderapi:2.10.9'
// Repo may be hosted: https://hub.spigotmc.org/nexus/content/groups/public/
// But do not see v5.0
- compileOnly 'net.luckperms:api:5.0'
+// compileOnly 'net.luckperms:api:5.0'
// https://mvnrepository.com/artifact/me.lucko.luckperms/luckperms-api
- compileOnly 'me.lucko.luckperms:luckperms-api:4.4'
+// compileOnly 'me.lucko.luckperms:luckperms-api:4.4'
// https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries
- implementation 'com.github.cryptomorin:XSeries:9.10.0'
+// implementation 'com.github.cryptomorin:XSeries:9.10.0'
// implementation 'com.github.cryptomorin:XSeries:9.8.0'
//implementation 'com.github.cryptomorin:XSeries:9.4.0'
//implementation 'com.github.cryptomorin:XSeries:9.2.0'
@@ -161,13 +139,6 @@ dependencies {
// implementation 'me.badbones69:crazyenchantments-plugin:1.8-Dev-Build-v8'
- // 1.9.4-R0.1-SNAPSHOT has been the version used for a long time:
-// compileOnly 'org.spigotmc:spigot-api:1.9.4-R0.1-SNAPSHOT'
- // 1.12.2-R0.1-SNAPSHOT works well:
-// compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
- // 1.13.2 fails since deprecated functions have been removed.
- compileOnly 'org.spigotmc:spigot-api:1.13.2-R0.1-SNAPSHOT'
-
// NOTE: The repo is no longer resolving to the correct resources:
@@ -175,16 +146,6 @@ dependencies {
// compileOnly 'at.pcgamingfreaks:Minepacks-API:2.3.21.3'
- // https://mvnrepository.com/artifact/com.github.MilkBowl/VaultAPI
- compileOnly 'com.github.MilkBowl:VaultAPI:1.7.1'
- //compileOnly 'net.milkbowl.vault:VaultAPI:1.7.0'
-
-// compileOnly('be.maximvdw:MVdWPlaceholderAPI:2.5.2-SNAPSHOT'){
-// exclude group: 'org.spigotmc'
-// }
-
- // compileOnly 'com.sk89q.worldguard:worldguard-bukkit:7.0.1'
-
// NOTE: mavenrepository.com is not the offical repo.
// NOTE: This item-nbt MUST use the API and not the plugin version!
@@ -194,36 +155,24 @@ dependencies {
// https://github.com/tr7zw/Item-NBT-API/wiki/Using-Gradle
// https://www.spigotmc.org/resources/nbt-api.7939/
// https://mvnrepository.com/artifact/de.tr7zw/item-nbt-api-plugin
- implementation 'de.tr7zw:item-nbt-api:2.12.2'
-// implementation 'de.tr7zw:item-nbt-api:2.12.0'
-// implementation 'de.tr7zw:item-nbt-api-plugin:2.11.2'
-// implementation 'de.tr7zw:item-nbt-api-plugin:2.10.0'
-// implementation 'de.tr7zw:item-nbt-api-plugin:2.9.2'
-
+// implementation 'de.tr7zw:item-nbt-api:2.12.2'
- // https://github.com/LoneDev6/API-ItemsAdder#-packages
- // https://github.com/LoneDev6/API-ItemsAdder/tags
- compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.5.0b'
-// compileOnly 'com.github.LoneDev6:API-ItemsAdder:3.2.5'
compileOnly fileTree(dir: 'lib', include: ['*.jar'],
- exclude: ['Spiget_v1.4.2.prison-build.jar',
+ exclude: [
+ //'spiget-update_bukkit-1.4.6-20220613.151608-1',
+ // 'Spiget_v1.4.2.prison-build.jar',
// 'CrazyEnchantments-plugin-api.v1.8-Dev-Build-v8.jar',
'Zenchantments__API_v1.15.2.build4.jar'])
implementation fileTree(dir: 'lib',
- include: ['Spiget_v1.4.2.prison-build.jar',
+ include: [
+ //'spiget-update_bukkit-1.4.6-20220613.151608-1',
// 'CrazyEnchantments-plugin-api.v1.8-Dev-Build-v8.jar',
'Zenchantments__API_v1.15.2.build4.jar'])
-// compile fileTree(dir: 'lib', include: ['SPIGET__BUKKIT-1.4.2-SNAPSHOT.jar'])
-
-// compileOnly fileTree(dir: 'lib', include: ['*.jar'], exclude: ['TokenEnchantAPI-15.5.0.jar'])
-// compile fileTree(dir: 'lib', include: ['TokenEnchantAPI-18.5.0.jar'])
-
-
testImplementation group: 'junit', name: 'junit', version: '4.12'
@@ -248,24 +197,26 @@ processResources {
// Need to have includ duplicates for the version to be updated in the plugin.yml file.
// Also the final build is actually smaller with include.
duplicatesStrategy = DuplicatesStrategy.INCLUDE // allow duplicates
-// duplicatesStrategy = DuplicatesStrategy.EXCLUDE // do not allow duplicates
+ //duplicatesStrategy = DuplicatesStrategy.EXCLUDE // do not allow duplicates
}
shadowJar {
dependencies {
+ include(project(':prison-core'))
+ include(project(':prison-mines'))
+ include(project(':prison-ranks'))
+ include(project(':prison-sellall'))
+
+
include(dependency('org.apache.commons:commons-lang3:3.12.0'))
// https://mvnrepository.com/artifact/com.google.code.gson/gson
- include(dependency('com.google.code.gson:gson:2.10.1'))
- //include(dependency('com.google.code.gson:gson:2.8.6'))
+ include(dependency('com.google.code.gson:gson:'))
- include(dependency('org.bstats:bstats-base:3.0.2'))
- include(dependency('org.bstats:bstats-bukkit:3.0.2'))
-// include(dependency('org.bstats:bstats-base:2.2.1'))
-// include(dependency('org.bstats:bstats-bukkit:2.2.1'))
+ include(dependency('org.bstats:bstats-base:'))
+ include(dependency('org.bstats:bstats-bukkit:'))
- include(dependency('me.clip:placeholderapi:2.11.2'))
- //include(dependency('me.clip:placeholderapi:2.10.9'))
+ //include(dependency('me.clip:placeholderapi:'))
// https://mvnrepository.com/artifact/com.github.cryptomorin/XSeries
include(dependency('com.github.cryptomorin:XSeries:'))
@@ -273,26 +224,35 @@ shadowJar {
// https://mvnrepository.com/artifact/de.tr7zw/item-nbt-api-plugin
include(dependency('de.tr7zw:item-nbt-api:'))
- //include(dependency('de.tr7zw:item-nbt-api-plugin:2.10.0'))
- //include(dependency('org.inventivetalent.spiget-update:bukkit:1.4.2-SNAPSHOT'))
+ include(dependency('org.inventivetalent.spiget-update:bukkit:'))
+ //include(dependency('org.inventivetalent.spiget-update:core:'))
+
//include(dependency('me.badbones69:crazyenchantments-plugin:1.8-Dev-Build-v8'))
- include(project(':prison-core'))
- include(project(':prison-mines'))
- include(project(':prison-ranks'))
- include(project(':prison-sellall'))
}
- relocate 'org.bstats', 'tech.mcprison.prison.bstats'
+ // Relocate all libs to the tech.mcprison.prison.libs package:
+ relocate 'org.bstats', 'tech.mcprison.prison.libs.bstats'
+
+ relocate 'com.google.gson', 'tech.mcprison.prison.libs.gson'
+
+ relocate 'org.inventivetalent.update.spiget', 'tech.mcprison.prison.libs.spiget'
+
+ relocate 'com.cryptomorin', 'tech.mcprison.prison.libs.cryptomorin'
+
+ relocate 'de.tr7zw.changeme.nbtapi', 'tech.mcprison.prison.libs.nbtapi'
+
- relocate 'org.inventivetalent.update.spiget', 'tech.mcprison.prison.spiget'
- relocate 'com.cryptomorin', 'tech.mcprison.prison.cryptomorin'
+ // For privatebin wrapper: Paste:
+ relocate 'nl.kyllian', 'tech.mcprison.prison.libs.privatebin'
+
+ // Used with privatebin:
+ relocate 'org.json', 'tech.mcprison.prison.libs.orgjson'
+
- relocate 'de.tr7zw.changeme.nbtapi', 'tech.mcprison.prison.nbtapi'
-// relocate 'de.tr7zw.nbtapi', 'tech.mcprison.prison.nbtapi'
- //relocate 'me.badbones69.crazyenchantments.api.events.BlastUseEvent', 'tech.mcprison.prison.crazyenchantments.api'
+ //relocate 'me.badbones69.crazyenchantments.api.events.BlastUseEvent', 'tech.mcprison.prison.libs.crazyenchantments.api'
archiveAppendix = ''
diff --git a/prison-spigot/lib/Spiget_v1.4.2.prison-build.jar b/prison-spigot/lib/disabled/Spiget_v1.4.2.prison-build.jar
similarity index 100%
rename from prison-spigot/lib/Spiget_v1.4.2.prison-build.jar
rename to prison-spigot/lib/disabled/Spiget_v1.4.2.prison-build.jar
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotPrison.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotPrison.java
index 718717da2..d9710006d 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotPrison.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/SpigotPrison.java
@@ -33,14 +33,11 @@
import org.bukkit.event.Listener;
import org.bukkit.plugin.Plugin;
import org.bukkit.plugin.java.JavaPlugin;
-import org.inventivetalent.update.spiget.SpigetUpdate;
-import org.inventivetalent.update.spiget.UpdateCallback;
import tech.mcprison.prison.Prison;
import tech.mcprison.prison.PrisonAPI;
import tech.mcprison.prison.PrisonCommand;
import tech.mcprison.prison.PrisonCommand.RegisteredPluginsData;
-import tech.mcprison.prison.alerts.Alerts;
import tech.mcprison.prison.autofeatures.AutoFeaturesWrapper;
import tech.mcprison.prison.backups.PrisonBackups;
import tech.mcprison.prison.integration.Integration;
@@ -95,7 +92,7 @@
import tech.mcprison.prison.spigot.placeholder.PlaceHolderAPIIntegration;
import tech.mcprison.prison.spigot.sellall.SellAllUtil;
import tech.mcprison.prison.spigot.slime.SlimeBlockFunEventListener;
-import tech.mcprison.prison.spigot.spiget.BluesSpigetSemVerComparator;
+import tech.mcprison.prison.spigot.spiget.PrisonSpigetUpdateCheckTask;
import tech.mcprison.prison.spigot.tasks.PrisonInitialStartupTask;
import tech.mcprison.prison.spigot.tasks.SpigotPrisonDelayedStartupTask;
import tech.mcprison.prison.spigot.utils.PrisonUtilsMineBombs;
@@ -889,35 +886,44 @@ public static String stripColor(String format){
/**
* Checks to see if there is a newer version of prison that has been released.
* It checks based upon what is deployed to spigotmc.org.
+ *
+ * This submits a task that will check for updates about 5 seconds
+ * after prison starts up.
*/
private void initUpdater() {
if (!getConfig().getBoolean("check-updates")) {
return; // Don't check if they don't want it
}
-// String currentVersion = getDescription().getVersion();
-
- SpigetUpdate updater = new SpigetUpdate(this, Prison.SPIGOTMC_ORG_PROJECT_ID);
-// SpigetUpdate updater = new SpigetUpdate(this, 1223);
+ PrisonSpigetUpdateCheckTask updateCheck = new PrisonSpigetUpdateCheckTask();
+ updateCheck.submit();
- BluesSpigetSemVerComparator aRealSemVerComparator = new BluesSpigetSemVerComparator();
- updater.setVersionComparator( aRealSemVerComparator );
-// updater.setVersionComparator(VersionComparator.EQUAL);
-
- updater.checkForUpdate(new UpdateCallback() {
- @Override
- public void updateAvailable(String newVersion, String downloadUrl,
- boolean hasDirectDownload) {
- Alerts.getInstance().sendAlert(
- "&3%s is now available. &7Go to the &lSpigot&r&7 page to download the latest release with new features and fixes :)",
- newVersion);
- }
-
- @Override
- public void upToDate() {
- // Plugin is up-to-date
- }
- });
+//// String currentVersion = getDescription().getVersion();
+//
+// SpigetUpdate updater = new SpigetUpdate(this, Prison.SPIGOTMC_ORG_PROJECT_ID);
+//// SpigetUpdate updater = new SpigetUpdate(this, 1223);
+//
+//
+// BluesSpigetSemVerComparator aRealSemVerComparator = new BluesSpigetSemVerComparator();
+// updater.setVersionComparator( aRealSemVerComparator );
+//// updater.setVersionComparator(VersionComparator.EQUAL);
+//
+// updater.checkForUpdate( new PrisonSpigetUpdateCallback() );
+//
+//// updater.checkForUpdate(new UpdateCallback() {
+//// @Override
+//// public void updateAvailable(String newVersion, String downloadUrl,
+//// boolean hasDirectDownload) {
+//// Alerts.getInstance().sendAlert(
+//// "&3%s is now available. &7Go to the &lSpigot&r&7 page to download the latest release with new features and fixes :)",
+//// newVersion);
+//// }
+////
+//// @Override
+//// public void upToDate() {
+//// // Plugin is up-to-date
+//// }
+//// });
}
private void initDataDir() {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomy.java
index 0538d6682..95de2fc10 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomy.java
@@ -61,17 +61,34 @@ public double getBalance(Player player) {
return amount;
}
+ @Override
+ public boolean hasAccount( Player player ) {
+ return true;
+ }
+
@Override
public double getBalance(Player player, String currencyName) {
double amount = 0;
if ( wrapper != null ) {
synchronized ( wrapper ) {
- amount = wrapper.getBalance(player, currencyName);
+ amount = wrapper.getBalance(player, currencyName, false);
}
}
return amount;
}
+
+// @Override
+// public double getBalance(Player player, String currencyName, boolean quite) {
+// double amount = 0;
+// if ( wrapper != null ) {
+//
+// synchronized ( wrapper ) {
+// amount = wrapper.getBalance(player, currencyName, quite);
+// }
+// }
+// return amount;
+// }
@Override
public boolean setBalance(Player player, double amount) {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomyWrapper.java
index e1d248e57..c3e7fca1c 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/CoinsEngineEconomyWrapper.java
@@ -39,15 +39,15 @@ public boolean supportedCurrency( String currencyName ) {
public Currency getCurrency( String currencyNamme ) {
return CoinsEngineAPI.getCurrency( currencyNamme );
}
-
+
public double getBalance(Player player) {
Output.get().logWarn( "CoinsEngineEconomy getBalance() - Fail: MUST include a currencyName.");
- return getBalance(player, null);
+ return getBalance(player, null, false);
}
- public double getBalance(Player player, String currencyName) {
+ public double getBalance(Player player, String currencyName, boolean quite ) {
double results = 0;
if (economy != null && player instanceof SpigotPlayer ) {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomy.java
index 5e19a8f53..aaad214de 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomy.java
@@ -69,7 +69,11 @@ public boolean supportedCurrency( String currencyName ) {
return supported;
}
-
+
+ @Override
+ public boolean hasAccount( Player player ) {
+ return true;
+ }
@Override
public double getBalance(Player player) {
@@ -84,11 +88,23 @@ public double getBalance(Player player, String currencyName) {
if ( wrapper != null ) {
synchronized ( wrapper ) {
- amount = wrapper.getBalance(player, currencyName);
+ amount = wrapper.getBalance(player, currencyName, false);
}
}
return amount;
}
+
+// @Override
+// public double getBalance(Player player, String currencyName, boolean quite) {
+// double amount = 0;
+// if ( wrapper != null ) {
+//
+// synchronized ( wrapper ) {
+// amount = wrapper.getBalance(player, currencyName, quite);
+// }
+// }
+// return amount;
+// }
@Override
public boolean setBalance(Player player, double amount) {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomyWrapper.java
index 3b6fef589..33181f97b 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EdPrisonEconomyWrapper.java
@@ -62,7 +62,7 @@ public boolean supportedCurrency( String currencyName ) {
// return getBalance(player, null);
// }
- public double getBalance(Player player, String currencyName) {
+ public double getBalance(Player player, String currencyName, boolean quite) {
double results = 0;
if ( isEnabled() && currencyName != null ) {
results = economy.getEco(player.getUUID(), currencyName);
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssEconomyWrapper.java
index f3392f4f4..595461b22 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssEconomyWrapper.java
@@ -36,10 +36,15 @@
* @author Faizaan A. Datoo
*/
class EssEconomyWrapper {
+
+
+ public boolean hasAccount( Player player ) {
+ return Economy.playerExists( player.getName() );
+ }
double getBalance(Player player) {
try {
- if ( Economy.playerExists( player.getName() ) ) {
+ if ( hasAccount( player ) ) {
return Economy.getMoneyExact(player.getName()).doubleValue();
}
@@ -54,7 +59,7 @@ class EssEconomyWrapper {
void setBalance(Player player, double amount) {
try {
- if ( Economy.playerExists( player.getName() ) ) {
+ if ( hasAccount( player ) ) {
Economy.setMoney(player.getName(), new BigDecimal(amount));
}
else {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssentialsEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssentialsEconomy.java
index 520e4d63c..2109b5841 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssentialsEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/EssentialsEconomy.java
@@ -99,6 +99,12 @@ public void integrate() {
addDebugInfo( "9" );
}
+
+ @Override
+ public boolean hasAccount( Player player ) {
+ return wrapper.hasAccount( player );
+ }
+
@Override
public double getBalance(Player player) {
return wrapper.getBalance(player);
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomy.java
index 24543f422..f53cc40d9 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomy.java
@@ -49,6 +49,12 @@ public boolean supportedCurrency( String currencyName ) {
return supported;
}
+
+ @Override
+ public boolean hasAccount( Player player ) {
+ return wrapper.hasAccount( player );
+ }
+
@Override
public double getBalance(Player player) {
double amount = 0;
@@ -67,12 +73,24 @@ public double getBalance(Player player, String currencyName) {
if ( wrapper != null ) {
synchronized ( wrapper ) {
- amount = wrapper.getBalance(player, currencyName);
+ amount = wrapper.getBalance(player, currencyName, false);
}
}
return amount;
}
+// @Override
+// public double getBalance(Player player, String currencyName, boolean quite) {
+// double amount = 0;
+// if ( wrapper != null ) {
+//
+// synchronized ( wrapper ) {
+// amount = wrapper.getBalance(player, currencyName, quite);
+// }
+// }
+// return amount;
+// }
+
@Override
public boolean setBalance(Player player, double amount) {
boolean results = false;
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomyWrapper.java
index 260a45016..085044645 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/GemsEconomyWrapper.java
@@ -88,11 +88,16 @@ private Object getCurrencyRefection( String currencyName ) {
// return currency;
// }
+
+ public boolean hasAccount( Player player ) {
+ return true;
+ }
+
public double getBalance(Player player) {
- return getBalance(player, null);
+ return getBalance(player, null, false);
}
- public double getBalance(Player player, String currencyName) {
+ public double getBalance(Player player, String currencyName, boolean quite) {
double results = 0;
if (economy != null) {
if ( currencyName == null ) {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomy.java
index dc50b3c77..5a78538bb 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomy.java
@@ -36,6 +36,12 @@ public void integrate() {
}
}
+
+ @Override
+ public boolean hasAccount( Player player ) {
+ return econWrapper.hasAccount( player );
+ }
+
@Override
public double getBalance(Player player) {
return econWrapper.getBalance(player);
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomyWrapper.java
index b93c5b6e1..5db58dc76 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/SaneEconomyWrapper.java
@@ -23,17 +23,25 @@ public SaneEconomyWrapper(String providerName) {
}
}
+
+ public boolean hasAccount( Player player ) {
+
+ EconomablePlayer p = toEconomablePlayer(player);
+
+ return p != null && economyManager.accountExists( p );
+ }
+
public double getBalance(Player player) {
double result = 0;
try {
- EconomablePlayer p = toEconomablePlayer(player);
- if ( p == null || !economyManager.accountExists( p ) ) {
+ if ( !hasAccount( player ) ) {
player.sendMessage( "Economy Error: You don't have an account.");
}
else {
+ EconomablePlayer p = toEconomablePlayer(player);
result = economyManager.getBalance( p );
}
}
@@ -47,14 +55,14 @@ public double getBalance(Player player) {
public void setBalance(Player player, double amount) {
try {
- EconomablePlayer p = toEconomablePlayer(player);
- if ( p == null || !economyManager.accountExists( p ) ) {
+ if ( !hasAccount( player ) ) {
player.sendMessage( "Economy Error: You don't have an account.");
}
else {
- economyManager.setBalance(toEconomablePlayer(player), amount);
+ EconomablePlayer p = toEconomablePlayer(player);
+ economyManager.setBalance( p, amount);
}
}
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomy.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomy.java
index 9217bbfdb..42bfef372 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomy.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomy.java
@@ -52,6 +52,13 @@ public void integrate() {
addDebugInfo( "6" );
}
+
+ @Override
+ public boolean hasAccount( Player player ) {
+ boolean sendWarning = false;
+ return econWrapper.hasAccount( player, sendWarning );
+ }
+
@Override
public double getBalance(Player player) {
if (hasIntegrated()) {
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomyWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomyWrapper.java
index c63eb72d6..540a96036 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomyWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/economies/VaultEconomyWrapper.java
@@ -69,7 +69,7 @@ public VaultEconomyWrapper(String providerName ) {
* @param player
* @return
*/
- public boolean hasAccount( Player player ) {
+ public boolean hasAccount( Player player, boolean sendWarning ) {
boolean hasAccount = false;
OfflinePlayer oPlayer = getOfflinePlayer( player );
@@ -79,7 +79,7 @@ public boolean hasAccount( Player player ) {
}
catch (Exception e) {
- if ( !hasNoAccount.contains(player) ) {
+ if ( sendWarning && !hasNoAccount.contains(player) ) {
Output.get().logInfo(
String.format(
"Vault economy: Player %s does not have an econ account. "
@@ -150,7 +150,7 @@ private OfflinePlayer getOfflinePlayer(Player player) {
public double getBalance(Player player) {
double results = 0;
- boolean hasAccount = hasAccount(player);
+ boolean hasAccount = hasAccount(player, true);
if ( economy != null && !hasAccount ) {
player.sendMessage( "Economy Error: You don't have an account.");
@@ -200,7 +200,7 @@ public double getBalance(Player player) {
public boolean setBalance(Player player, double amount) {
boolean results = false;
- boolean hasAccount = hasAccount(player);
+ boolean hasAccount = hasAccount(player, true);
if ( economy != null && !hasAccount ) {
player.sendMessage( "Economy Error: You don't have an account.");
@@ -242,7 +242,7 @@ public boolean setBalance(Player player, double amount) {
public boolean addBalance(Player player, double amount) {
boolean results = false;
- boolean hasAccount = hasAccount(player);
+ boolean hasAccount = hasAccount(player, true);
if ( amount < 0 ) {
results = removeBalance( player, amount );
@@ -300,7 +300,7 @@ public boolean removeBalance(Player player, double amount) {
amount *= -1;
}
- boolean hasAccount = hasAccount(player);
+ boolean hasAccount = hasAccount(player, true);
if ( economy != null && !hasAccount ) {
player.sendMessage( "Economy Error: You don't have an account.");
@@ -352,7 +352,7 @@ public boolean removeBalance(Player player, double amount) {
public boolean canAfford(Player player, double amount) {
boolean results = false;
- boolean hasAccount = hasAccount(player);
+ boolean hasAccount = hasAccount(player, true);
if ( economy != null && !hasAccount ) {
player.sendMessage( "Economy Error: You don't have an account.");
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/rank/SpigotPlayerRanksGUI.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/rank/SpigotPlayerRanksGUI.java
index a0624bb19..c2d46b010 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/rank/SpigotPlayerRanksGUI.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/gui/rank/SpigotPlayerRanksGUI.java
@@ -166,8 +166,11 @@ public void open() {
// Not sure how you want to represent this:
String materialHasStr = guiConfig.getString("Options.Ranks.MaterialType.HasRankAccess", "TRIPWIRE_HOOK");
XMaterial materialHas = XMaterial.matchXMaterial( materialHasStr ).orElse(null);
- XMaterial materialHasNot = XMaterial.matchXMaterial(
- guiConfig.getString("Options.Ranks.MaterialType.NoRankAccess")).orElse(null);
+
+ String materialHasNotStr = guiConfig.getString("Options.Ranks.MaterialType.NoRankAccess", "REDSTONE_BLOCK");
+ XMaterial materialHasNot = XMaterial.matchXMaterial(
+ materialHasNotStr != null ? materialHasNotStr : "REDSTONE_BLOCK"
+ ).orElse(null);
List configCustomLore = guiConfig.getStringList("EditableLore.Ranks");
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationUppercaseWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationUppercaseWrapper.java
index 1672ced92..da133e074 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationUppercaseWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationUppercaseWrapper.java
@@ -82,7 +82,7 @@ public String onRequest(OfflinePlayer player, String identifier) {
// identifier = PlaceholderManager.PRISON_PLACEHOLDER_PREFIX_EXTENDED + identifier;
// }
- UUID playerUuid = player.getUniqueId();
+ UUID playerUuid = player == null ? null : player.getUniqueId();
String results = Prison.get().getPlatform().getPlaceholders()
.placeholderTranslate( playerUuid, player.getName(), identifier );
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationWrapper.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationWrapper.java
index ff3b13354..8c3d1a6b4 100644
--- a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationWrapper.java
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/placeholder/PlaceHolderAPIIntegrationWrapper.java
@@ -81,7 +81,7 @@ public String onRequest(OfflinePlayer player, String identifier) {
// identifier = PlaceholderManager.PRISON_PLACEHOLDER_PREFIX_EXTENDED + identifier;
// }
- UUID playerUuid = player.getUniqueId();
+ UUID playerUuid = player == null ? null : player.getUniqueId();
String results = Prison.get().getPlatform().getPlaceholders()
.placeholderTranslate( playerUuid, player.getName(), identifier );
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCallback.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCallback.java
new file mode 100644
index 000000000..65e92f740
--- /dev/null
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCallback.java
@@ -0,0 +1,50 @@
+package tech.mcprison.prison.spigot.spiget;
+
+import tech.mcprison.prison.Prison;
+import tech.mcprison.prison.alerts.Alerts;
+import tech.mcprison.prison.output.Output;
+
+public class PrisonSpigetUpdateCallback
+ implements org.inventivetalent.update.spiget.UpdateCallback {
+
+ @Override
+ public void upToDate() {
+
+ String currentVersion = Prison.get().getPlatform().getPluginVersion();
+
+ String msg = String.format(
+ "&dPrison is up to date! " +
+ "&bCurrent version: &6%s. " +
+ "&7Visit our discord server to get help and find " +
+ "pre-release versions. ",
+ currentVersion
+ );
+
+ Output.get().logInfo( msg );
+
+
+ }
+
+ @Override
+ public void updateAvailable(String newVersion, String downloadUrl,
+ boolean hasDirectDownload ) {
+
+ String currentVersion = Prison.get().getPlatform().getPluginVersion();
+
+ String msg = String.format(
+ "&dA new version of Prison is now available! " +
+ "&bCurrent version: &6%s &bNew Version: &6%s&b. " +
+ "&7Go to &lSpigotmc.org&r&7 to download the " +
+ "latest release with new features and fixes. :)",
+ currentVersion,
+ newVersion,
+ downloadUrl
+ );
+
+ Output.get().logInfo( msg );
+
+ Alerts.getInstance().sendAlert( msg );
+
+ }
+
+}
diff --git a/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCheckTask.java b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCheckTask.java
new file mode 100644
index 000000000..d53812af4
--- /dev/null
+++ b/prison-spigot/src/main/java/tech/mcprison/prison/spigot/spiget/PrisonSpigetUpdateCheckTask.java
@@ -0,0 +1,74 @@
+package tech.mcprison.prison.spigot.spiget;
+
+import org.inventivetalent.update.spiget.SpigetUpdate;
+
+import tech.mcprison.prison.Prison;
+import tech.mcprison.prison.spigot.SpigotPrison;
+import tech.mcprison.prison.tasks.PrisonRunnable;
+import tech.mcprison.prison.tasks.PrisonTaskSubmitter;
+
+public class PrisonSpigetUpdateCheckTask
+ implements PrisonRunnable {
+
+ private long delayTicks = 5 * 20; // 5 seconds
+
+ private int taskId = 0;
+
+
+ public PrisonSpigetUpdateCheckTask() {
+ super();
+ }
+
+ public void submit() {
+
+ taskId = PrisonTaskSubmitter.runTaskLater(this, delayTicks );
+ }
+
+ @Override
+ public void run() {
+
+ SpigotPrison plugin = SpigotPrison.getInstance();
+
+ SpigetUpdate updater = new SpigetUpdate( plugin, Prison.SPIGOTMC_ORG_PROJECT_ID);
+// SpigetUpdate updater = new SpigetUpdate(this, 1223);
+
+
+ BluesSpigetSemVerComparator aRealSemVerComparator = new BluesSpigetSemVerComparator();
+ updater.setVersionComparator( aRealSemVerComparator );
+// updater.setVersionComparator(VersionComparator.EQUAL);
+
+ updater.checkForUpdate( new PrisonSpigetUpdateCallback() );
+
+
+// updater.checkForUpdate(new UpdateCallback() {
+// @Override
+// public void updateAvailable(String newVersion, String downloadUrl,
+// boolean hasDirectDownload) {
+// Alerts.getInstance().sendAlert(
+// "&3%s is now available. &7Go to the &lSpigot&r&7 page to download the latest release with new features and fixes :)",
+// newVersion);
+// }
+//
+// @Override
+// public void upToDate() {
+// // Plugin is up-to-date
+// }
+// });
+
+ }
+
+ public long getDelayTicks() {
+ return delayTicks;
+ }
+ public void setDelayTicks(long delayTicks) {
+ this.delayTicks = delayTicks;
+ }
+
+ public int getTaskId() {
+ return taskId;
+ }
+ public void setTaskId(int taskId) {
+ this.taskId = taskId;
+ }
+
+}
diff --git a/settings.gradle b/settings.gradle
index 7b7f2ca03..2a3209af7 100644
--- a/settings.gradle
+++ b/settings.gradle
@@ -17,7 +17,70 @@
*/
+
+/*
+ * NOTE: Gradle v8.x will no longer auto provision tool chains. The provisioning
+ * tools must be explicitly specificed. This can be accomplished with
+ * the use of plugins to help control the toolchainManagement.
+ * https://docs.gradle.org/current/userguide/toolchains.html#sub:download_repositories
+ */
+plugins {
+ id 'org.gradle.toolchains.foojay-resolver-convention' version '0.8.0'
+}
+
+
+// https://docs.gradle.org/current/userguide/platforms.html
+// https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:centralized-repository-declaration
+dependencyResolutionManagement {
+ repositories {
+ mavenCentral()
+
+ // spigot-api:
+ maven {
+ url = "https://hub.spigotmc.org/nexus/content/groups/public"
+ content {
+ includeGroup 'org.spigotmc'
+ includeGroup 'org.bukkit'
+ }
+ }
+
+
+ // The following houses many repos, so don't limit to just luckperms:
+ // net.milkbowl, be.maximvdw, org.bstats:bstats-bukkit
+ maven { url = "https://repo.lucko.me/" }
+
+ // ?? libraries: used in prison-spigot-alt so not needed here:
+ //maven { url = "https://oss.sonatype.org/content/repositories/snapshots/" }
+ //maven { url = "https://nexus.hc.to/content/repositories/pub_releases" }
+
+ // item-nbt-api:
+ maven { url = "https://repo.codemc.org/repository/maven-public/" }
+
+ maven { url = "https://repo.inventivetalent.org/content/groups/public/" }
+
+
+ maven { url 'https://jitpack.io' }
+
+
+
+// maven {
+// url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
+// content {
+// includeGroup 'me.clip'
+// }
+// }
+
+ }
+
+ versionCatalogs {
+ libs {
+
+ }
+ }
+}
+
rootProject.name = 'prison'
+
include 'prison-core'
include 'prison-spigot'
/* include 'prison-sponge' */
@@ -32,3 +95,9 @@ include 'prison-worldguard7'
/*
include 'prison-worldguard8'
*/
+include 'prison-spigot-alt'
+
+
+
+
+