mirror of
https://github.com/Auxilor/Reforges.git
synced 2025-12-22 16:39:34 +00:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d68c7b1f43 | ||
|
|
1a14a11aa4 | ||
|
|
ff3af6b412 | ||
|
|
7bd43e6506 |
@@ -6,6 +6,7 @@ import com.willfp.eco.core.display.DisplayPriority
|
|||||||
import com.willfp.eco.core.display.DisplayProperties
|
import com.willfp.eco.core.display.DisplayProperties
|
||||||
import com.willfp.eco.core.fast.FastItemStack
|
import com.willfp.eco.core.fast.FastItemStack
|
||||||
import com.willfp.eco.core.fast.fast
|
import com.willfp.eco.core.fast.fast
|
||||||
|
import com.willfp.eco.core.placeholder.context.placeholderContext
|
||||||
import com.willfp.eco.util.SkullUtils
|
import com.willfp.eco.util.SkullUtils
|
||||||
import com.willfp.eco.util.StringUtils
|
import com.willfp.eco.util.StringUtils
|
||||||
import com.willfp.eco.util.formatEco
|
import com.willfp.eco.util.formatEco
|
||||||
@@ -47,12 +48,15 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
|||||||
|
|
||||||
val reforge = fast.persistentDataContainer.reforge
|
val reforge = fast.persistentDataContainer.reforge
|
||||||
|
|
||||||
|
val context = placeholderContext(
|
||||||
|
player = player,
|
||||||
|
item = itemStack
|
||||||
|
)
|
||||||
|
|
||||||
if (reforge == null && stone == null) {
|
if (reforge == null && stone == null) {
|
||||||
if (plugin.configYml.getBool("reforge.show-reforgable")) {
|
if (plugin.configYml.getBool("reforge.show-reforgable")) {
|
||||||
if (plugin.configYml.getBool("reforge.no-reforgable-in-gui")) {
|
if (props.inGui) {
|
||||||
if (props.inGui) {
|
return
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
val addLore: MutableList<String> = ArrayList()
|
val addLore: MutableList<String> = ArrayList()
|
||||||
@@ -91,10 +95,11 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
|||||||
for (string in plugin.configYml.getFormattedStrings("reforge.reforged-prefix")) {
|
for (string in plugin.configYml.getFormattedStrings("reforge.reforged-prefix")) {
|
||||||
addLore.add(Display.PREFIX + string.replace("%reforge%", reforge.name))
|
addLore.add(Display.PREFIX + string.replace("%reforge%", reforge.name))
|
||||||
}
|
}
|
||||||
addLore.addAll(reforge.description)
|
addLore.addAll(reforge.description.formatEco(context))
|
||||||
addLore.replaceAll { "${Display.PREFIX}$it" }
|
addLore.replaceAll { "${Display.PREFIX}$it" }
|
||||||
lore.addAll(addLore)
|
lore.addAll(addLore)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (plugin.configYml.getBool("reforge.display-in-name")) {
|
if (plugin.configYml.getBool("reforge.display-in-name")) {
|
||||||
val displayName = fastItemStack.displayNameComponent
|
val displayName = fastItemStack.displayNameComponent
|
||||||
|
|
||||||
@@ -115,7 +120,7 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
|||||||
if (player != null) {
|
if (player != null) {
|
||||||
val provided = ItemProvidedHolder(reforge, itemStack)
|
val provided = ItemProvidedHolder(reforge, itemStack)
|
||||||
|
|
||||||
val lines = reforge.conditions.getNotMetLines(player, provided).map { Display.PREFIX + it }
|
val lines = provided.getNotMetLines(player).map { Display.PREFIX + it }
|
||||||
|
|
||||||
if (lines.isNotEmpty()) {
|
if (lines.isNotEmpty()) {
|
||||||
lore.add(Display.PREFIX)
|
lore.add(Display.PREFIX)
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class Reforge(
|
|||||||
|
|
||||||
val namePrefixComponent = StringUtils.toComponent("$name ").decoration(TextDecoration.ITALIC, false)
|
val namePrefixComponent = StringUtils.toComponent("$name ").decoration(TextDecoration.ITALIC, false)
|
||||||
|
|
||||||
val description: List<String> = config.getFormattedStrings("description")
|
val description: List<String> = config.getStrings("description")
|
||||||
|
|
||||||
val targets = config.getStrings("targets").mapNotNull { ReforgeTargets.getByName(it) }.toSet()
|
val targets = config.getStrings("targets").mapNotNull { ReforgeTargets.getByName(it) }.toSet()
|
||||||
|
|
||||||
|
|||||||
@@ -146,12 +146,11 @@ reforge:
|
|||||||
reforgable-suffix:
|
reforgable-suffix:
|
||||||
- ""
|
- ""
|
||||||
- "&8This item can be reforged!"
|
- "&8This item can be reforged!"
|
||||||
no-reforgable-in-gui: true # Not perfect, won't work 100% of the time
|
|
||||||
# due to how GUIs are handled differently in different plugins, but should help.
|
|
||||||
|
|
||||||
display-in-lore: true
|
display-in-lore: true
|
||||||
display-in-name: true
|
display-in-name: true
|
||||||
|
|
||||||
|
# The lore to display if an item is reforged, above the reforge description
|
||||||
reforged-prefix:
|
reforged-prefix:
|
||||||
- ""
|
- ""
|
||||||
- "%reforge%"
|
- "%reforge%"
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#libreforge-updater
|
#libreforge-updater
|
||||||
#Fri Nov 10 13:58:55 GMT 2023
|
#Fri Nov 17 19:01:58 GMT 2023
|
||||||
kotlin.code.style=official
|
kotlin.code.style=official
|
||||||
libreforge-version=4.41.0
|
libreforge-version=4.43.0
|
||||||
version=6.41.0
|
version=6.43.0
|
||||||
|
|||||||
Reference in New Issue
Block a user