mirror of
https://github.com/alexcrea/CustomAnvil.git
synced 2026-06-23 16:16:17 +02:00
Moved some class. Abstracted gui list elements.
This commit is contained in:
parent
57cd58657d
commit
479bd03e83
16 changed files with 79 additions and 65 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
package xyz.alexcrea.cuanvil.interfaces
|
||||
|
||||
interface Named {
|
||||
|
||||
fun getName(): String
|
||||
|
||||
}
|
||||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue