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;
import com.willfp.eco.core.version.Version;
import org.bukkit.Bukkit;
import java.util.Arrays;
@@ -12,7 +13,7 @@ public final class ProxyConstants {
/**
* 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.
@@ -32,4 +33,17 @@ public final class ProxyConstants {
private ProxyConstants() {
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 pluginName = extensionYml.getStringOrNull("plugin")
@Suppress("DEPRECATION")
if (pluginName != null && !pluginName.equals(this.plugin.description.name, ignoreCase = true)) {
throw ExtensionLoadException("${extensionJar.name} is only compatible with $pluginName!")
}
@@ -83,6 +84,7 @@ class EcoExtensionLoader(
author = "Unnamed Author"
}
@Suppress("DEPRECATION")
if (Version(this.plugin.description.version) < pluginVersion) {
throw ExtensionLoadException("Plugin version is too low for ${extensionJar.name}!")
}

View File

@@ -9,4 +9,4 @@ class EcoNamespacedKeyFactory(private val plugin: EcoPlugin) : NamespacedKeyFact
override fun create(key: String): NamespacedKey {
return NamespacedKeyUtils.create(plugin.id, key)
}
}
}

View File

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

View File

@@ -7,7 +7,7 @@ version = rootProject.version
dependencies {
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") {
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) {
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 {
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? {
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(

View File

@@ -13,7 +13,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
block: Block
): 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)
}
@@ -22,7 +22,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
location: Location
): 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)
}
@@ -31,7 +31,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
block: Block
): 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)
}
@@ -40,7 +40,7 @@ class AntigriefIridiumSkyblock : AntigriefIntegration {
player: Player,
victim: LivingEntity
): Boolean {
val api = IridiumSkyblockAPI.getInstance()
val api = IridiumSkyblockAPI.getInstance() ?: return false
return when (victim) {
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