Compare commits

..

9 Commits

Author SHA1 Message Date
Auxilor
ab73c2202a Updated to 6.69.1 2024-03-29 16:50:04 +00:00
Auxilor
af640881b0 Fixed IridiumSkyblock 2024-03-29 16:49:57 +00:00
Auxilor
9bd5cb5046 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	gradle.properties
2024-03-29 16:39:42 +00:00
Will FP
2829baf5b0 Preliminary support for new NMS versioning 2024-03-22 19:00:57 +00:00
Will FP
446e7a9534 Fixed ExtendedPersistentDataContainerFactory on 1.20.4 2024-03-10 17:03:51 +00:00
Auxilor
8a8606bea4 Suppressed paper deprecations 2024-01-04 17:09:23 +00:00
Auxilor
3f751e8865 Updated to 6.68.1 2024-01-04 17:08:15 +00:00
Auxilor
6a035426b4 Fixed namespacedkey creation 2024-01-04 17:05:47 +00:00
Auxilor
f9bf97c90c Improved DropQueue telekinesis for paper users 2024-01-04 17:05:36 +00:00
8 changed files with 30 additions and 11 deletions

View File

@@ -1,5 +1,6 @@
package com.willfp.eco.core.proxy; package com.willfp.eco.core.proxy;
import com.willfp.eco.core.version.Version;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import java.util.Arrays; import java.util.Arrays;
@@ -12,7 +13,7 @@ public final class ProxyConstants {
/** /**
* The NMS version that the server is running on. * The NMS version that the server is running on.
*/ */
public static final String NMS_VERSION = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; public static final String NMS_VERSION;
/** /**
* All supported NMS versions. * All supported NMS versions.
@@ -32,4 +33,17 @@ public final class ProxyConstants {
private ProxyConstants() { private ProxyConstants() {
throw new UnsupportedOperationException("This is a utility class and cannot be instantiated"); throw new UnsupportedOperationException("This is a utility class and cannot be instantiated");
} }
static {
String currentMinecraftVersion = Bukkit.getServer().getBukkitVersion().split("-")[0];
String nmsVersion;
if (new Version(currentMinecraftVersion).compareTo(new Version("1.20.5")) < 0) {
nmsVersion = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3];
} else {
nmsVersion = currentMinecraftVersion.replace(".", "_");
}
NMS_VERSION = nmsVersion;
}
} }

View File

@@ -60,6 +60,7 @@ class EcoExtensionLoader(
val pluginVersion = Version(extensionYml.getStringOrNull("plugin-version") ?: "0.0.0") val pluginVersion = Version(extensionYml.getStringOrNull("plugin-version") ?: "0.0.0")
val pluginName = extensionYml.getStringOrNull("plugin") val pluginName = extensionYml.getStringOrNull("plugin")
@Suppress("DEPRECATION")
if (pluginName != null && !pluginName.equals(this.plugin.description.name, ignoreCase = true)) { if (pluginName != null && !pluginName.equals(this.plugin.description.name, ignoreCase = true)) {
throw ExtensionLoadException("${extensionJar.name} is only compatible with $pluginName!") throw ExtensionLoadException("${extensionJar.name} is only compatible with $pluginName!")
} }
@@ -83,6 +84,7 @@ class EcoExtensionLoader(
author = "Unnamed Author" author = "Unnamed Author"
} }
@Suppress("DEPRECATION")
if (Version(this.plugin.description.version) < pluginVersion) { if (Version(this.plugin.description.version) < pluginVersion) {
throw ExtensionLoadException("Plugin version is too low for ${extensionJar.name}!") throw ExtensionLoadException("Plugin version is too low for ${extensionJar.name}!")
} }

View File

@@ -21,14 +21,17 @@ class PAPIExpansion(private val plugin: EcoPlugin) : PlaceholderExpansion() {
} }
override fun getAuthor(): String { override fun getAuthor(): String {
@Suppress("DEPRECATION")
return java.lang.String.join(", ", plugin.description.authors) return java.lang.String.join(", ", plugin.description.authors)
} }
override fun getIdentifier(): String { override fun getIdentifier(): String {
@Suppress("DEPRECATION")
return plugin.description.name.lowercase() return plugin.description.name.lowercase()
} }
override fun getVersion(): String { override fun getVersion(): String {
@Suppress("DEPRECATION")
return plugin.description.version return plugin.description.version
} }

View File

@@ -7,7 +7,7 @@ version = rootProject.version
dependencies { dependencies {
implementation(project(":eco-core:core-nms:nms-common")) implementation(project(":eco-core:core-nms:nms-common"))
paperweight.paperDevBundle("1.20.3-R0.1-SNAPSHOT") paperweight.paperDevBundle("1.20.4-R0.1-SNAPSHOT")
implementation("net.kyori:adventure-text-minimessage:4.11.0") { implementation("net.kyori:adventure-text-minimessage:4.11.0") {
version { version {

View File

@@ -46,17 +46,17 @@ class ExtendedPersistentDataContainerFactory : ExtendedPersistentDataContainerFa
override fun <T : Any, Z : Any> set(key: String, dataType: PersistentDataType<T, Z>, value: Z) { override fun <T : Any, Z : Any> set(key: String, dataType: PersistentDataType<T, Z>, value: Z) {
customDataTags[key] = customDataTags[key] =
registry.wrap(dataType.primitiveType, dataType.toPrimitive(value, handle.adapterContext)) registry.wrap(dataType, dataType.toPrimitive(value, handle.adapterContext))
} }
override fun <T : Any, Z : Any> has(key: String, dataType: PersistentDataType<T, Z>): Boolean { override fun <T : Any, Z : Any> has(key: String, dataType: PersistentDataType<T, Z>): Boolean {
val value = customDataTags[key] ?: return false val value = customDataTags[key] ?: return false
return registry.isInstanceOf(dataType.primitiveType, value) return registry.isInstanceOf(dataType, value)
} }
override fun <T : Any, Z : Any> get(key: String, dataType: PersistentDataType<T, Z>): Z? { override fun <T : Any, Z : Any> get(key: String, dataType: PersistentDataType<T, Z>): Z? {
val value = customDataTags[key] ?: return null val value = customDataTags[key] ?: return null
return dataType.fromPrimitive(registry.extract(dataType.primitiveType, value), handle.adapterContext) return dataType.fromPrimitive(registry.extract<T, Tag>(dataType, value), handle.adapterContext)
} }
override fun <T : Any, Z : Any> getOrDefault( override fun <T : Any, Z : Any> getOrDefault(

View File

@@ -13,7 +13,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player, player: Player,
block: Block block: Block
): Boolean { ): Boolean {
val api = IridiumSkyblockAPI.getInstance() val api = IridiumSkyblockAPI.getInstance() ?: return false
return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK) return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK)
} }
@@ -22,7 +22,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player, player: Player,
location: Location location: Location
): Boolean { ): Boolean {
val api = IridiumSkyblockAPI.getInstance() val api = IridiumSkyblockAPI.getInstance() ?: return false
return api.getIslandPermission(api.getIslandViaLocation(location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK) return api.getIslandPermission(api.getIslandViaLocation(location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_BREAK)
} }
@@ -31,7 +31,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player, player: Player,
block: Block block: Block
): Boolean { ): Boolean {
val api = IridiumSkyblockAPI.getInstance() val api = IridiumSkyblockAPI.getInstance() ?: return false
return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_PLACE) return api.getIslandPermission(api.getIslandViaLocation(block.location).orElse(null) ?: return true, api.getUser(player), PermissionType.BLOCK_PLACE)
} }
@@ -40,7 +40,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player, player: Player,
victim: LivingEntity victim: LivingEntity
): Boolean { ): Boolean {
val api = IridiumSkyblockAPI.getInstance() val api = IridiumSkyblockAPI.getInstance() ?: return false
return when (victim) { return when (victim) {
is Player -> api.getIslandViaLocation(victim.location).orElse(null) != null is Player -> api.getIslandViaLocation(victim.location).orElse(null) != null

View File

@@ -1,2 +1,2 @@
version = 6.69.0 version = 6.69.1
kotlin.incremental.useClasspathSnapshot=false kotlin.incremental.useClasspathSnapshot=false