Compare commits

..

1 Commits

Author SHA1 Message Date
dependabot[bot]
5f38b59340 Bump com.github.Gypopo:EconomyShopGUI-API from 1.4.6 to 1.7.0
Bumps com.github.Gypopo:EconomyShopGUI-API from 1.4.6 to 1.7.0.

---
updated-dependencies:
- dependency-name: com.github.Gypopo:EconomyShopGUI-API
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-12-26 12:45:38 +00:00
21 changed files with 18 additions and 47 deletions

View File

@@ -120,12 +120,8 @@ public final class ConfiguredPrice implements Price {
*/ */
public String getDisplay(@NotNull final Player player, public String getDisplay(@NotNull final Player player,
final double multiplier) { final double multiplier) {
double value = this.getPrice().getValue(player, multiplier);
return StringUtils.format( return StringUtils.format(
formatString formatString.replace("%value%", NumberUtils.format(this.getPrice().getValue(player, multiplier))),
.replace("%value%", NumberUtils.format(value))
.replace("%value_commas%", NumberUtils.formatWithCommas(value)),
player, player,
StringUtils.FormatOption.WITH_PLACEHOLDERS StringUtils.FormatOption.WITH_PLACEHOLDERS
); );

View File

@@ -203,20 +203,6 @@ public final class NumberUtils {
return formatted.endsWith("00") ? String.valueOf((int) toFormat) : formatted; return formatted.endsWith("00") ? String.valueOf((int) toFormat) : formatted;
} }
/**
* Format double to string with commas.
*
* @param toFormat The number to format.
* @return Formatted.
*/
@NotNull
public static String formatWithCommas(final double toFormat) {
DecimalFormat df = new DecimalFormat("#,##0.00");
String formatted = df.format(toFormat);
return formatted.endsWith(".00") ? formatted.substring(0, formatted.length() - 3) : formatted;
}
/** /**
* Evaluate an expression. * Evaluate an expression.
* *

View File

@@ -8,10 +8,6 @@ import com.willfp.eco.core.placeholder.context.PlaceholderContext
fun Number.toNumeral(): String = fun Number.toNumeral(): String =
NumberUtils.toNumeral(this.toInt()) NumberUtils.toNumeral(this.toInt())
/** @see NumberUtils.formatWithCommas */
fun Number.formatWithCommas(): String =
NumberUtils.formatWithCommas(this.toDouble())
/** @see NumberUtils.fromNumeral */ /** @see NumberUtils.fromNumeral */
fun String.parseNumeral(): Int = fun String.parseNumeral(): Int =
NumberUtils.fromNumeral(this) NumberUtils.fromNumeral(this)

View File

@@ -6,7 +6,7 @@ dependencies {
implementation("org.reflections:reflections:0.9.12") implementation("org.reflections:reflections:0.9.12")
implementation("org.objenesis:objenesis:3.2") implementation("org.objenesis:objenesis:3.2")
compileOnly("io.papermc.paper:paper-api:1.20.2-R0.1-SNAPSHOT") compileOnly("org.spigotmc:spigot-api:1.20.2-R0.1-SNAPSHOT")
compileOnly("me.clip:placeholderapi:2.11.4") compileOnly("me.clip:placeholderapi:2.11.4")
compileOnly("net.kyori:adventure-text-minimessage:4.10.0") compileOnly("net.kyori:adventure-text-minimessage:4.10.0")
compileOnly("net.kyori:adventure-platform-bukkit:4.1.0") compileOnly("net.kyori:adventure-platform-bukkit:4.1.0")

View File

@@ -3,6 +3,7 @@ package com.willfp.eco.internal.command
import com.willfp.eco.core.EcoPlugin import com.willfp.eco.core.EcoPlugin
import com.willfp.eco.core.command.CommandBase import com.willfp.eco.core.command.CommandBase
import com.willfp.eco.core.command.NotificationException import com.willfp.eco.core.command.NotificationException
import com.willfp.eco.core.config.base.LangYml
import org.bukkit.Bukkit import org.bukkit.Bukkit
import org.bukkit.command.Command import org.bukkit.command.Command
import org.bukkit.command.CommandExecutor import org.bukkit.command.CommandExecutor

View File

@@ -2,6 +2,7 @@ package com.willfp.eco.internal.config
import com.willfp.eco.core.config.ConfigType import com.willfp.eco.core.config.ConfigType
import com.willfp.eco.core.placeholder.InjectablePlaceholder import com.willfp.eco.core.placeholder.InjectablePlaceholder
import java.util.concurrent.ConcurrentHashMap
class EcoConfigSection( class EcoConfigSection(
type: ConfigType, type: ConfigType,

View File

@@ -15,6 +15,7 @@ import java.nio.channels.AsynchronousFileChannel
import java.nio.file.Files import java.nio.file.Files
import java.nio.file.StandardOpenOption import java.nio.file.StandardOpenOption
@Suppress("UNCHECKED_CAST")
open class EcoLoadableConfig( open class EcoLoadableConfig(
type: ConfigType, type: ConfigType,
configName: String, configName: String,

View File

@@ -1,6 +1,5 @@
package com.willfp.eco.internal.drops package com.willfp.eco.internal.drops
import com.willfp.eco.core.Prerequisite
import com.willfp.eco.core.drops.DropQueue import com.willfp.eco.core.drops.DropQueue
import com.willfp.eco.core.events.DropQueuePushEvent import com.willfp.eco.core.events.DropQueuePushEvent
import com.willfp.eco.core.integrations.antigrief.AntigriefManager import com.willfp.eco.core.integrations.antigrief.AntigriefManager
@@ -73,17 +72,10 @@ open class EcoDropQueue(val player: Player) : DropQueue() {
world.dropItem(location, drop!!).velocity = Vector() world.dropItem(location, drop!!).velocity = Vector()
} }
if (xp > 0) { if (xp > 0) {
if (Prerequisite.HAS_PAPER.isMet) { val orb =
player.giveExp(xp, true) world.spawnEntity(player.location.add(0.0, 0.2, 0.0), EntityType.EXPERIENCE_ORB) as ExperienceOrb
} else { orb.velocity = Vector(0, 0, 0)
val orb = orb.experience = xp
world.spawnEntity(
player.location.add(0.0, 0.2, 0.0),
EntityType.EXPERIENCE_ORB
) as ExperienceOrb
orb.velocity = Vector(0, 0, 0)
orb.experience = xp
}
} }
} else { } else {
for (drop in items) { for (drop in items) {

View File

@@ -19,7 +19,6 @@ object EntityArgParserName : EntityArgParser {
val formatted = StringUtils.format(name) val formatted = StringUtils.format(name)
@Suppress("DEPRECATION")
return EntityArgParseResult( return EntityArgParseResult(
{ it.customName == formatted }, { it.customName == formatted },
{ {

View File

@@ -42,7 +42,6 @@ class EcoExtensionLoader(
} }
} }
@Suppress("DEPRECATION")
@Throws(MalformedExtensionException::class) @Throws(MalformedExtensionException::class)
private fun loadExtension(extensionJar: File) { private fun loadExtension(extensionJar: File) {
val url = extensionJar.toURI().toURL() val url = extensionJar.toURI().toURL()

View File

@@ -7,6 +7,6 @@ import org.bukkit.NamespacedKey
class EcoNamespacedKeyFactory(private val plugin: EcoPlugin) : NamespacedKeyFactory { class EcoNamespacedKeyFactory(private val plugin: EcoPlugin) : NamespacedKeyFactory {
override fun create(key: String): NamespacedKey { override fun create(key: String): NamespacedKey {
return NamespacedKeyUtils.create(plugin.id, key) return NamespacedKeyUtils.create(plugin.name, key)
} }
} }

View File

@@ -25,6 +25,7 @@ class FastInternalNamespacedKeyFactory : InternalNamespacedKeyFactory {
class SafeInternalNamespacedKeyFactory : InternalNamespacedKeyFactory { class SafeInternalNamespacedKeyFactory : InternalNamespacedKeyFactory {
override fun create(namespace: String, key: String): NamespacedKey { override fun create(namespace: String, key: String): NamespacedKey {
@Suppress("DEPRECATION")
return NamespacedKey(namespace, key) return NamespacedKey(namespace, key)
} }
} }

View File

@@ -43,7 +43,6 @@ class EcoMenu(
getPossiblyReactiveSlot(row, column, player) getPossiblyReactiveSlot(row, column, player)
override fun open(player: Player): Inventory { override fun open(player: Player): Inventory {
@Suppress("DEPRECATION")
val inventory = if (columns == 9) { val inventory = if (columns == 9) {
Bukkit.createInventory(null, rows * columns, title) Bukkit.createInventory(null, rows * columns, title)
} else { } else {

View File

@@ -1,6 +1,7 @@
package com.willfp.eco.internal.gui.menu package com.willfp.eco.internal.gui.menu
import com.willfp.eco.core.gui.menu.events.CaptiveItemChangeEvent import com.willfp.eco.core.gui.menu.events.CaptiveItemChangeEvent
import com.willfp.eco.core.items.isEmpty
import com.willfp.eco.core.recipe.parts.EmptyTestableItem import com.willfp.eco.core.recipe.parts.EmptyTestableItem
import com.willfp.eco.util.MenuUtils import com.willfp.eco.util.MenuUtils
import com.willfp.eco.util.openMenu import com.willfp.eco.util.openMenu

View File

@@ -6,7 +6,6 @@ import com.willfp.eco.core.placeholder.context.placeholderContext
import me.clip.placeholderapi.expansion.PlaceholderExpansion import me.clip.placeholderapi.expansion.PlaceholderExpansion
import org.bukkit.entity.Player import org.bukkit.entity.Player
@Suppress("DEPRECATION")
class PAPIExpansion(private val plugin: EcoPlugin) : PlaceholderExpansion() { class PAPIExpansion(private val plugin: EcoPlugin) : PlaceholderExpansion() {
init { init {
register() register()

View File

@@ -28,6 +28,7 @@ object ArgParserHead : LookupArgParser {
playerName ?: return null playerName ?: return null
@Suppress("DEPRECATION")
val player = Bukkit.getOfflinePlayer(playerName) val player = Bukkit.getOfflinePlayer(playerName)
meta.owningPlayer = player meta.owningPlayer = player

View File

@@ -22,13 +22,12 @@ object ArgParserName : LookupArgParser {
val formatted = StringUtils.format(name) val formatted = StringUtils.format(name)
// I don't know why it says it's redundant, the compiler yells at me // I don't know why it says it's redundant, the compiler yells at me
@Suppress("UsePropertyAccessSyntax", "RedundantSuppression", "DEPRECATION") @Suppress("UsePropertyAccessSyntax", "RedundantSuppression")
meta.setDisplayName(formatted) meta.setDisplayName(formatted)
return Predicate { return Predicate {
val testMeta = it.itemMeta ?: return@Predicate false val testMeta = it.itemMeta ?: return@Predicate false
@Suppress("DEPRECATION")
testMeta.displayName == formatted testMeta.displayName == formatted
} }
} }
@@ -38,7 +37,6 @@ object ArgParserName : LookupArgParser {
return null return null
} }
@Suppress("DEPRECATION")
return "name:\"${meta.displayName}\"" return "name:\"${meta.displayName}\""
} }
} }

View File

@@ -1,11 +1,13 @@
package com.willfp.eco.internal.items package com.willfp.eco.internal.items
import com.willfp.eco.core.items.args.LookupArgParser import com.willfp.eco.core.items.args.LookupArgParser
import org.bukkit.Color
import org.bukkit.NamespacedKey import org.bukkit.NamespacedKey
import org.bukkit.Registry import org.bukkit.Registry
import org.bukkit.inventory.ItemStack import org.bukkit.inventory.ItemStack
import org.bukkit.inventory.meta.ArmorMeta import org.bukkit.inventory.meta.ArmorMeta
import org.bukkit.inventory.meta.ItemMeta import org.bukkit.inventory.meta.ItemMeta
import org.bukkit.inventory.meta.LeatherArmorMeta
import org.bukkit.inventory.meta.trim.ArmorTrim import org.bukkit.inventory.meta.trim.ArmorTrim
import org.bukkit.inventory.meta.trim.TrimMaterial import org.bukkit.inventory.meta.trim.TrimMaterial
import org.bukkit.inventory.meta.trim.TrimPattern import org.bukkit.inventory.meta.trim.TrimPattern

View File

@@ -49,7 +49,7 @@ dependencies {
compileOnly("com.github.MilkBowl:VaultAPI:1.7") compileOnly("com.github.MilkBowl:VaultAPI:1.7")
compileOnly("com.github.WhipDevelopment:CrashClaim:f9cd7d92eb") compileOnly("com.github.WhipDevelopment:CrashClaim:f9cd7d92eb")
compileOnly("com.github.decentsoftware-eu:decentholograms:2.8.5") compileOnly("com.github.decentsoftware-eu:decentholograms:2.8.5")
compileOnly("com.github.Gypopo:EconomyShopGUI-API:1.4.6") compileOnly("com.github.Gypopo:EconomyShopGUI-API:1.7.0")
compileOnly("com.github.N0RSKA:ScytherAPI:55a") compileOnly("com.github.N0RSKA:ScytherAPI:55a")
compileOnly("org.black_ixx:playerpoints:3.2.5") compileOnly("org.black_ixx:playerpoints:3.2.5")
compileOnly("com.github.Ssomar-Developement:SCore:3.4.7") compileOnly("com.github.Ssomar-Developement:SCore:3.4.7")

View File

@@ -2,7 +2,6 @@ multiple-in-craft: '&l&c! &fThis recipe requires &a%amount%&f of this item.'
# Specify default display names for prices made through ConfiguredPrice#create # Specify default display names for prices made through ConfiguredPrice#create
# These will override any custom configured price display names. # These will override any custom configured price display names.
# You can use %value% and %value_commas% as placeholders.
price-display: price-display:
- type: example_type - type: example_type
display: "&e%value% Price" display: "&e%value% Price"

View File

@@ -1,2 +1,2 @@
version = 6.68.2 version = 6.68.0
kotlin.incremental.useClasspathSnapshot=false kotlin.incremental.useClasspathSnapshot=false