mirror of
https://github.com/Auxilor/Reforges.git
synced 2025-12-20 15:39:30 +00:00
Updated more string getters
This commit is contained in:
@@ -39,7 +39,7 @@ public class TargetYml extends BaseConfig {
|
|||||||
*/
|
*/
|
||||||
public Set<TestableItem> getTargetItems(@NotNull final String target) {
|
public Set<TestableItem> getTargetItems(@NotNull final String target) {
|
||||||
Set<TestableItem> items = new HashSet<>();
|
Set<TestableItem> items = new HashSet<>();
|
||||||
this.getStrings(target + ".items", false).forEach(s -> items.add(Items.lookup(s.toUpperCase())));
|
this.getStrings(target + ".items").forEach(s -> items.add(Items.lookup(s.toUpperCase())));
|
||||||
return items;
|
return items;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ class ReforgesDisplay(private val plugin: ReforgesPlugin) : DisplayModule(plugin
|
|||||||
if (reforge == null && stone == null && target != null) {
|
if (reforge == null && stone == null && target != null) {
|
||||||
if (plugin.configYml.getBool("reforge.show-reforgable")) {
|
if (plugin.configYml.getBool("reforge.show-reforgable")) {
|
||||||
val addLore: MutableList<String> = ArrayList()
|
val addLore: MutableList<String> = ArrayList()
|
||||||
for (string in plugin.configYml.getStrings("reforge.reforgable-suffix")) {
|
for (string in plugin.configYml.getFormattedStrings("reforge.reforgable-suffix")) {
|
||||||
addLore.add(Display.PREFIX + string)
|
addLore.add(Display.PREFIX + string)
|
||||||
}
|
}
|
||||||
lore.addAll(addLore)
|
lore.addAll(addLore)
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ object ReforgeGUI {
|
|||||||
previous.type = Material.getMaterial(
|
previous.type = Material.getMaterial(
|
||||||
plugin.configYml.getString("gui.invalid-item.material").uppercase()
|
plugin.configYml.getString("gui.invalid-item.material").uppercase()
|
||||||
)!!
|
)!!
|
||||||
meta.setDisplayName(plugin.configYml.getString("gui.invalid-item.name"))
|
meta.setDisplayName(plugin.configYml.getFormattedString("gui.invalid-item.name"))
|
||||||
meta.lore = plugin.configYml.getStrings("gui.invalid-item.lore").map {
|
meta.lore = plugin.configYml.getFormattedStrings("gui.invalid-item.lore").map {
|
||||||
it.replace("%cost%", NumberUtils.format(cost))
|
it.replace("%cost%", NumberUtils.format(cost))
|
||||||
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
||||||
}
|
}
|
||||||
@@ -74,8 +74,8 @@ object ReforgeGUI {
|
|||||||
previous.type = Material.getMaterial(
|
previous.type = Material.getMaterial(
|
||||||
plugin.configYml.getString("gui.allow.material").uppercase()
|
plugin.configYml.getString("gui.allow.material").uppercase()
|
||||||
)!!
|
)!!
|
||||||
meta.setDisplayName(plugin.configYml.getString("gui.allow.name"))
|
meta.setDisplayName(plugin.configYml.getFormattedString("gui.allow.name"))
|
||||||
meta.lore = plugin.configYml.getStrings("gui.allow.lore").map {
|
meta.lore = plugin.configYml.getFormattedStrings("gui.allow.lore").map {
|
||||||
it.replace("%cost%", NumberUtils.format(cost))
|
it.replace("%cost%", NumberUtils.format(cost))
|
||||||
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
||||||
}
|
}
|
||||||
@@ -84,8 +84,8 @@ object ReforgeGUI {
|
|||||||
previous.type = Material.getMaterial(
|
previous.type = Material.getMaterial(
|
||||||
plugin.configYml.getString("gui.allow-stone.material").uppercase()
|
plugin.configYml.getString("gui.allow-stone.material").uppercase()
|
||||||
)!!
|
)!!
|
||||||
meta.setDisplayName(plugin.configYml.getString("gui.allow-stone.name"))
|
meta.setDisplayName(plugin.configYml.getFormattedString("gui.allow-stone.name"))
|
||||||
meta.lore = plugin.configYml.getStrings("gui.allow-stone.lore").map {
|
meta.lore = plugin.configYml.getFormattedStrings("gui.allow-stone.lore").map {
|
||||||
it.replace("%cost%", NumberUtils.format(cost))
|
it.replace("%cost%", NumberUtils.format(cost))
|
||||||
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
||||||
.replace("%stone%", ReforgeUtils.getReforgeStone(menu.getCaptiveItems(player)[1]).name)
|
.replace("%stone%", ReforgeUtils.getReforgeStone(menu.getCaptiveItems(player)[1]).name)
|
||||||
@@ -95,8 +95,8 @@ object ReforgeGUI {
|
|||||||
previous.type = Material.getMaterial(
|
previous.type = Material.getMaterial(
|
||||||
plugin.configYml.getString("gui.no-item.material").uppercase()
|
plugin.configYml.getString("gui.no-item.material").uppercase()
|
||||||
)!!
|
)!!
|
||||||
meta.setDisplayName(plugin.configYml.getString("gui.no-item.name"))
|
meta.setDisplayName(plugin.configYml.getFormattedString("gui.no-item.name"))
|
||||||
meta.lore = plugin.configYml.getStrings("gui.no-item.lore").map {
|
meta.lore = plugin.configYml.getFormattedStrings("gui.no-item.lore").map {
|
||||||
it.replace("%cost%", NumberUtils.format(cost))
|
it.replace("%cost%", NumberUtils.format(cost))
|
||||||
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
.replace("%xpcost%", NumberUtils.format(xpCost.toDouble()))
|
||||||
}
|
}
|
||||||
@@ -122,7 +122,7 @@ object ReforgeGUI {
|
|||||||
Material.getMaterial(plugin.configYml.getString("gui.close.material", false).toUpperCase())!!
|
Material.getMaterial(plugin.configYml.getString("gui.close.material", false).toUpperCase())!!
|
||||||
|
|
||||||
menu = Menu.builder(plugin.configYml.getInt("gui.rows")).apply {
|
menu = Menu.builder(plugin.configYml.getInt("gui.rows")).apply {
|
||||||
setTitle(plugin.langYml.getString("menu.title"))
|
setTitle(plugin.langYml.getFormattedString("menu.title"))
|
||||||
setMask(FillerMask(MaskMaterials(*maskMaterials), *maskPattern))
|
setMask(FillerMask(MaskMaterials(*maskMaterials), *maskPattern))
|
||||||
modfiy { builder ->
|
modfiy { builder ->
|
||||||
val slot = Slot.builder(
|
val slot = Slot.builder(
|
||||||
@@ -173,7 +173,7 @@ object ReforgeGUI {
|
|||||||
plugin.configYml.getInt("gui.close.location.column"),
|
plugin.configYml.getInt("gui.close.location.column"),
|
||||||
Slot.builder(
|
Slot.builder(
|
||||||
ItemStackBuilder(closeMaterial)
|
ItemStackBuilder(closeMaterial)
|
||||||
.setDisplayName(plugin.langYml.getString("menu.close"))
|
.setDisplayName(plugin.langYml.getFormattedString("menu.close"))
|
||||||
.build()
|
.build()
|
||||||
).onLeftClick { event, _, _ ->
|
).onLeftClick { event, _, _ ->
|
||||||
event.whoClicked.closeInventory()
|
event.whoClicked.closeInventory()
|
||||||
|
|||||||
Reference in New Issue
Block a user