mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-08-28 08:25:56 +02:00
fix test issue
This commit is contained in:
parent
ae28c64647
commit
52a58acd28
5 changed files with 6 additions and 3 deletions
|
|
@ -204,7 +204,8 @@ open class CustomAnvil : JavaPlugin() {
|
|||
|
||||
private fun legacyCheck() {
|
||||
val currentVersion = UpdateUtils.currentMinecraftVersion()
|
||||
if (currentVersion.greaterEqual(Version(1, 21, 0))) {
|
||||
if (currentVersion.greaterEqual(Version(1, 21, 0))
|
||||
&& !DependencyManager.inTesting) {
|
||||
logger.warning("You are running a Minecraft version above or equal to 1.21.0")
|
||||
logger.warning("Please use CustomAnvil v2 instead if you wish to use the plugin with this version.")
|
||||
Bukkit.getPluginManager().disablePlugin(this)
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ object DependencyManager {
|
|||
lateinit var packetManager: PacketManager
|
||||
var externGuiTester: GenericExternGuiTester = GenericExternGuiTester()
|
||||
|
||||
val inTesting = externGuiTester.isInTest()
|
||||
|
||||
var enchantmentSquaredCompatibility: EnchantmentSquaredDependency? = null
|
||||
var ecoEnchantCompatibility: EcoEnchantDependency? = null
|
||||
var excellentEnchantsCompatibility: ExcellentEnchantsDependency? = null
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ object PacketManagerSelector {
|
|||
|
||||
fun selectPacketManager(forceProtocolib: Boolean): PacketManager {
|
||||
// Try to find version
|
||||
if(DependencyManager.externGuiTester.isInTest())
|
||||
if(DependencyManager.inTesting)
|
||||
return NoPacketManager()
|
||||
|
||||
return if (forceProtocolib)
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ object MetricsUtil {
|
|||
private var FAST_STATS_METRICS: BukkitContext? = null
|
||||
|
||||
fun loadMetrics(plugin: CustomAnvil) {
|
||||
if(DependencyManager.externGuiTester.isInTest()) return
|
||||
if(DependencyManager.inTesting) return
|
||||
|
||||
val config = ConfigHolder.DEFAULT_CONFIG.config
|
||||
val metricString = config.getString(ConfigOptions.METRIC_TYPE, MetricType.AUTO.value)!!
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue