Moved some class. Abstracted gui list elements.

This commit is contained in:
alexcrea 2024-04-08 21:39:45 +02:00
parent 57cd58657d
commit 479bd03e83
No known key found for this signature in database
GPG key ID: 43FD265DB0DBF91F
16 changed files with 79 additions and 65 deletions

View file

@ -5,7 +5,7 @@ import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor
import org.bukkit.command.CommandSender
import org.bukkit.entity.HumanEntity
import xyz.alexcrea.cuanvil.gui.config.global.MainConfigGui
import xyz.alexcrea.cuanvil.gui.config.MainConfigGui
import xyz.alexcrea.cuanvil.gui.util.GuiGlobalActions
class EditConfigExecutor : CommandExecutor {

View file

@ -3,13 +3,12 @@ package xyz.alexcrea.cuanvil.group
import io.delilaheve.CustomAnvil
import org.bukkit.Material
import org.bukkit.enchantments.Enchantment
import xyz.alexcrea.cuanvil.interfaces.Named
class EnchantConflictGroup(
private val name: String,
private val cantConflict: AbstractMaterialGroup,
var minBeforeBlock: Int
): Named {
) {
private val enchantments = HashSet<Enchantment>()
@ -63,7 +62,7 @@ class EnchantConflictGroup(
return Material.ENCHANTED_BOOK
}
override fun getName(): String {
override fun toString(): String {
return name
}

View file

@ -139,9 +139,9 @@ class EnchantConflictManager {
var result = ConflictType.NO_CONFLICT
for (conflict in conflictList) {
CustomAnvil.verboseLog("Is against ${conflict.getName()}")
CustomAnvil.verboseLog("Is against $conflict")
val conflicting = conflict.allowed(base, mat)
CustomAnvil.verboseLog("Was against ${conflict.getName()} and conflicting: $conflicting ")
CustomAnvil.verboseLog("Was against $conflict and conflicting: $conflicting ")
if (!conflicting) {
if (conflict.getEnchants().size <= 1) {
result = ConflictType.SMALL_CONFLICT

View file

@ -1,7 +0,0 @@
package xyz.alexcrea.cuanvil.interfaces
interface Named {
fun getName(): String
}

View file

@ -5,7 +5,6 @@ import org.bukkit.configuration.ConfigurationSection
import org.bukkit.inventory.ItemStack
import xyz.alexcrea.cuanvil.config.ConfigHolder
import xyz.alexcrea.cuanvil.gui.util.GuiSharedConstant
import xyz.alexcrea.cuanvil.interfaces.Named
class AnvilCustomRecipe(
private val name: String,
@ -18,7 +17,7 @@ class AnvilCustomRecipe(
var leftItem: ItemStack?,
var rightItem: ItemStack?,
var resultItem: ItemStack?,
): Named {
) {
// Static config name
companion object {
@ -162,7 +161,7 @@ class AnvilCustomRecipe(
return true
}
override fun getName(): String {
override fun toString(): String {
return name
}