Added adventure into eco

This commit is contained in:
Auxilor
2021-10-01 10:56:05 +01:00
parent 2c218d1088
commit 8a68666f86
10 changed files with 89 additions and 8 deletions

View File

@@ -23,6 +23,8 @@ dependencies {
compileOnly 'com.github.brcdev-minecraft:shopgui-api:2.2.0'
compileOnly 'com.github.LoneDev6:API-ItemsAdder:2.4.7'
compileOnly 'me.arcaniax:HeadDatabase-API:1.2.0'
compileOnly 'net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT'
compileOnly 'net.kyori:adventure-platform-bukkit:4.0.0'
// CombatLogX V10 + NewbieHelper Expansion
compileOnly 'com.SirBlobman.combatlogx:CombatLogX-API:10.0.0.0-SNAPSHOT'

View File

@@ -35,6 +35,7 @@ import com.willfp.eco.internal.requirement.EcoRequirementFactory
import com.willfp.eco.internal.scheduling.EcoScheduler
import com.willfp.eco.proxy.FastItemStackFactoryProxy
import com.willfp.eco.spigot.integrations.bstats.MetricHandler
import net.kyori.adventure.platform.bukkit.BukkitAudiences
import org.bukkit.inventory.ItemStack
import java.util.logging.Logger
@@ -42,6 +43,7 @@ import java.util.logging.Logger
class EcoHandler : EcoSpigotPlugin(), Handler {
private val cleaner = EcoCleaner()
private val requirementFactory = EcoRequirementFactory()
private val adventure = BukkitAudiences.create(this);
override fun createScheduler(plugin: EcoPlugin): Scheduler {
return EcoScheduler(plugin)
@@ -126,4 +128,8 @@ class EcoHandler : EcoSpigotPlugin(), Handler {
override fun getRequirementFactory(): RequirementFactory {
return requirementFactory
}
override fun getAdventure(): BukkitAudiences {
return adventure
}
}

View File

@@ -23,9 +23,7 @@ class GUIListener(private val plugin: EcoPlugin) : Listener {
return
}
val menu = MenuHandler.getMenu(event.clickedInventory ?: return) ?: return
val rowColumn = MenuUtils.convertSlotToRowColumn(event.slot)
val row = rowColumn.first!!
val column = rowColumn.second!!
val (row, column) = MenuUtils.convertSlotToRowColumn(event.slot)
val slot = menu.getSlot(row, column)
Validate.isTrue(slot is EcoSlot, "Slot not instance of EcoSlot!")
val ecoSlot = menu.getSlot(row, column) as EcoSlot

View File

@@ -32,4 +32,5 @@ libraries:
- net.kyori:adventure-text-serializer-gson:4.8.1
- net.kyori:adventure-text-serializer-legacy:4.8.1
- net.kyori:adventure-text-minimessage:4.1.0-SNAPSHOT
- org.jetbrains.kotlin:kotlin-stdlib:1.5.21
- org.jetbrains.kotlin:kotlin-stdlib:1.5.21
- net.kyori:adventure-platform-bukkit:4.0.0