Skip to content

Commit

Permalink
Fixed ExcellentCrates converter.
Browse files Browse the repository at this point in the history
  • Loading branch information
0ft3n committed May 7, 2022
1 parent ec8aac6 commit 022f2b1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import com.willfp.ecocrates.crate.Crates
import com.willfp.ecocrates.crate.placed.PlacedCrates
import org.bukkit.Location
import su.nightexpress.excellentcrates.ExcellentCrates
import su.nightexpress.excellentcrates.ExcellentCratesAPI
import su.nightexpress.excellentcrates.api.OpenCostType
import su.nightexpress.excellentcrates.api.crate.ICrate
import su.nightexpress.excellentcrates.api.crate.ICrateReward
Expand All @@ -19,7 +20,7 @@ class ExcellentCratesConverter(private val plugin: EcoCratesPlugin) : Converter
override val id = "ExcellentCrates"

override fun convert() {
val newCrates = ExcellentCrates.getInstance().crateManager.crates.map { convertCrate(it) }
val newCrates = ExcellentCratesAPI.getCrateManager().crates.map { convertCrate(it) }

val crates = plugin.cratesYml.getSubsections("crates").toMutableList()

Expand All @@ -30,7 +31,7 @@ class ExcellentCratesConverter(private val plugin: EcoCratesPlugin) : Converter
plugin.rewardsYml.save()
plugin.reload()

ExcellentCrates.getInstance().crateManager.crates.forEach {
ExcellentCratesAPI.getCrateManager().crates.forEach {
val jank = mutableListOf<Location>()
jank.addAll(it.blockLocations)
jank.forEach { it1 -> it.removeBlockLocation(it1) }
Expand All @@ -53,7 +54,7 @@ class ExcellentCratesConverter(private val plugin: EcoCratesPlugin) : Converter
}

if (crate.keyIds.isNotEmpty()) {
val key = ExcellentCrates.getInstance().keyManager.getKeyById(crate.keyIds.first())!!
val key = ExcellentCratesAPI.getKeyManager().getKeyById(crate.keyIds.first())!!
result.set("key.item", key.item.toLookupString())
result.set("key.lore", key.item.itemMeta?.lore)
} else {
Expand Down
Binary file removed lib/ExcellentCrates-4.0.3.6.jar
Binary file not shown.
Binary file added lib/ExcellentCrates-4.0.4.1.jar
Binary file not shown.
Binary file modified lib/NexEngine.jar
Binary file not shown.

0 comments on commit 022f2b1

Please sign in to comment.