mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
add more spigot warnings
This commit is contained in:
parent
e30f09120d
commit
12bfcb75ce
3 changed files with 20 additions and 3 deletions
|
|
@ -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,10 +283,16 @@ 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()){
|
||||||
|
if(MinecraftVersionUtil.INSTANCE.isTooNewForSpigot()){
|
||||||
|
lore.add("");
|
||||||
|
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("");
|
||||||
lore.add("§4/!\\§cCaution§4/!\\ §cYou need ProtocoLib installed and working or a newer version of this plugin for this to work.");
|
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.");
|
lore.add("§cCurrently ProtocoLib is not detected.");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String[] loreAsArray = new String[lore.size()];
|
String[] loreAsArray = new String[lore.size()];
|
||||||
return lore.toArray(loreAsArray);
|
return lore.toArray(loreAsArray);
|
||||||
|
|
|
||||||
|
|
@ -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"
|
||||||
|
|
|
||||||
|
|
@ -51,4 +51,9 @@ object MinecraftVersionUtil {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val isTooNewForSpigot: Boolean get() {
|
||||||
|
val versionParts = UpdateUtils.currentMinecraftVersionArray()
|
||||||
|
return versionParts[0] != 1
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Loading…
Add table
Add a link
Reference in a new issue