Updated backend paper version

This commit is contained in:
Auxilor
2023-03-15 18:20:46 +00:00
parent 4f4ee82e6b
commit 5c3bb678b3
11 changed files with 23 additions and 16 deletions

View File

@@ -53,7 +53,11 @@ public final class Recipes {
* @return The match, or null if not found.
*/
@Nullable
public static CraftingRecipe getMatch(@NotNull final ItemStack[] matrix) {
public static CraftingRecipe getMatch(@Nullable final ItemStack[] matrix) {
if (matrix == null) {
return null;
}
return RECIPES_FROM_MATRIX.get(matrix).orElse(null);
}

View File

@@ -20,7 +20,7 @@ public interface CraftingRecipe {
* @param matrix The matrix to check.
* @return If the recipe matches.
*/
boolean test(@NotNull ItemStack[] matrix);
boolean test(@Nullable ItemStack[] matrix);
/**
* Register the recipe.

View File

@@ -69,7 +69,11 @@ public final class ShapedCraftingRecipe implements CraftingRecipe {
}
@Override
public boolean test(@NotNull final ItemStack[] matrix) {
public boolean test(@Nullable final ItemStack[] matrix) {
if (matrix == null) {
return false;
}
List<ItemStack> dynamicMatrix = Arrays.asList(matrix);
boolean matches = true;
for (int i = 0; i < 9; i++) {

View File

@@ -80,7 +80,11 @@ public final class ShapelessCraftingRecipe implements CraftingRecipe {
}
@Override
public boolean test(@NotNull final ItemStack[] matrix) {
public boolean test(@Nullable final ItemStack[] matrix) {
if (matrix == null) {
return false;
}
RecipeTest test = newTest();
for (ItemStack stack : matrix) {

View File

@@ -8,7 +8,7 @@ import java.util.logging.Logger
class EcoLogger(private val plugin: EcoPlugin) : Logger(plugin.name, null as String?) {
override fun info(msg: String) {
Bukkit.getConsoleSender().sendMessage("[${plugin.name}] ${StringUtils.format(msg)}")
Bukkit.getConsoleSender().sendMessage("[${plugin.name}] ${StringUtils.format(msg, StringUtils.FormatOption.WITHOUT_PLACEHOLDERS)}")
}
init {

View File

@@ -22,7 +22,7 @@ dependencies {
// Included in spigot jar
compileOnly("com.google.code.gson:gson:2.8.8")
compileOnly("io.papermc.paper:paper-api:1.17.1-R0.1-SNAPSHOT")
compileOnly("io.papermc.paper:paper-api:1.19.3-R0.1-SNAPSHOT")
// Plugin dependencies
compileOnly("com.comphenix.protocol:ProtocolLib:5.0.0-SNAPSHOT")

View File

@@ -47,6 +47,7 @@ enum class ConflictType(
}
private fun Plugin.getConflict(): Conflict? {
@Suppress("DEPRECATION")
if (this.description.libraries.any { it.contains("kotlin-stdlib") }) {
return Conflict(this, ConflictType.LIB_LOADER)
}

View File

@@ -270,6 +270,7 @@ abstract class EcoSpigotPlugin : EcoPlugin() {
IntegrationLoader("CombatLogX") {
val pluginManager = Bukkit.getPluginManager()
val combatLogXPlugin = pluginManager.getPlugin("CombatLogX") ?: return@IntegrationLoader
@Suppress("DEPRECATION")
val pluginVersion = combatLogXPlugin.description.version
if (pluginVersion.startsWith("10")) {
AntigriefManager.register(AntigriefCombatLogXV10())

View File

@@ -35,6 +35,7 @@ class Metrics(private val plugin: EcoPlugin) {
}
private fun appendServiceData(builder: JsonObjectBuilder) {
@Suppress("DEPRECATION")
builder.appendField("pluginVersion", plugin.description.version)
}
@@ -238,15 +239,6 @@ class Metrics(private val plugin: EcoPlugin) {
// Inform the server owners about bStats
config
.options()
.header(
"""
bStats (https://bStats.org) collects some basic information for plugin authors, like how
many people use their plugin and their total player count. It's recommended to keep bStats
enabled, but if you're not comfortable with this, you can turn this setting off. There is no
performance penalty associated with having metrics enabled, and data sent to bStats is fully
anonymous.
""".trimIndent()
)
.copyDefaults(true)
config.save(configFile)
}

View File

@@ -118,7 +118,7 @@ class StackedRecipeListener(
// Just to be safe, modify the instance (safe check) Using ?. causes a warning.
@Suppress("SENSELESS_COMPARISON") // I hate compiler warnings
if (inventory.matrix[i] != null) {
inventory.matrix[i].amount = amount
inventory.matrix[i]?.amount = amount
}
}
}

View File

@@ -2,6 +2,7 @@ name: eco
version: ${projectVersion}
main: com.willfp.eco.internal.spigot.EcoImpl
api-version: 1.19
load: STARTUP
dependencies:
- name: ProtocolLib