add more spigot warnings

This commit is contained in:
alexcrea 2026-04-21 15:12:33 +02:00
parent e30f09120d
commit 12bfcb75ce
Signed by: alexcrea
GPG key ID: E346CD16413450E3
3 changed files with 20 additions and 3 deletions

View file

@ -14,6 +14,7 @@ import org.bukkit.inventory.meta.ItemMeta;
import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import xyz.alexcrea.cuanvil.config.ConfigHolder; import xyz.alexcrea.cuanvil.config.ConfigHolder;
import xyz.alexcrea.cuanvil.dependency.MinecraftVersionUtil;
import xyz.alexcrea.cuanvil.dependency.packet.PacketManager; import xyz.alexcrea.cuanvil.dependency.packet.PacketManager;
import xyz.alexcrea.cuanvil.gui.ValueUpdatableGui; import xyz.alexcrea.cuanvil.gui.ValueUpdatableGui;
import xyz.alexcrea.cuanvil.gui.config.MainConfigGui; import xyz.alexcrea.cuanvil.gui.config.MainConfigGui;
@ -282,9 +283,15 @@ public class BasicConfigGui extends ChestGui implements ValueUpdatableGui {
lore.add("§7If the player do not have the required xp level, the action will not be completable."); lore.add("§7If the player do not have the required xp level, the action will not be completable.");
if(!this.packetManager.getCanSetInstantBuild()){ if(!this.packetManager.getCanSetInstantBuild()){
lore.add(""); if(MinecraftVersionUtil.INSTANCE.isTooNewForSpigot()){
lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a newer version of this plugin for this to work."); lore.add("");
lore.add("§cCurrently ProtocoLib is not detected."); lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a paper server.");
lore.add("§cCurrently ProtocoLib is not detected.");
} else {
lore.add("");
lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a newer version of this plugin for this to work.");
lore.add("§cCurrently ProtocoLib is not detected.");
}
} }
String[] loreAsArray = new String[lore.size()]; String[] loreAsArray = new String[lore.size()];

View file

@ -11,6 +11,7 @@ import xyz.alexcrea.cuanvil.command.EditConfigExecutor
import xyz.alexcrea.cuanvil.command.ReloadExecutor import xyz.alexcrea.cuanvil.command.ReloadExecutor
import xyz.alexcrea.cuanvil.config.ConfigHolder import xyz.alexcrea.cuanvil.config.ConfigHolder
import xyz.alexcrea.cuanvil.dependency.DependencyManager import xyz.alexcrea.cuanvil.dependency.DependencyManager
import xyz.alexcrea.cuanvil.dependency.MinecraftVersionUtil
import xyz.alexcrea.cuanvil.dependency.util.PlatformUtil import xyz.alexcrea.cuanvil.dependency.util.PlatformUtil
import xyz.alexcrea.cuanvil.enchant.CAEnchantmentRegistry import xyz.alexcrea.cuanvil.enchant.CAEnchantmentRegistry
import xyz.alexcrea.cuanvil.gui.config.MainConfigGui import xyz.alexcrea.cuanvil.gui.config.MainConfigGui
@ -194,6 +195,10 @@ open class CustomAnvil : JavaPlugin() {
if(!isPaper) { if(!isPaper) {
logger.warning("It seems you are using spigot") logger.warning("It seems you are using spigot")
logger.warning("Please take notice that spigot is less supported than paper and derivatives") logger.warning("Please take notice that spigot is less supported than paper and derivatives")
if(MinecraftVersionUtil.isTooNewForSpigot) {
logger.warning("If replace too expensive is not working this is likely because of spigot")
logger.warning("As native nms is not supported for spigot starting 26.1")
}
} }
val loader = if(isPaper) "paper" else "spigot" val loader = if(isPaper) "paper" else "spigot"

View file

@ -51,4 +51,9 @@ object MinecraftVersionUtil {
} }
} }
val isTooNewForSpigot: Boolean get() {
val versionParts = UpdateUtils.currentMinecraftVersionArray()
return versionParts[0] != 1
}
} }