Codestyle
This commit is contained in:
@@ -76,7 +76,7 @@ allprojects {
|
||||
compileOnly("org.jetbrains:annotations:23.0.0")
|
||||
|
||||
// Test
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.1")
|
||||
testImplementation("org.junit.jupiter:junit-jupiter-api:5.8.2")
|
||||
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:5.8.2")
|
||||
|
||||
// Adventure
|
||||
|
||||
@@ -235,7 +235,7 @@ public interface Config extends Cloneable {
|
||||
*/
|
||||
@NotNull
|
||||
default String getString(@NotNull String path) {
|
||||
return getString(path, false);
|
||||
return getString(path, false, StringUtils.FormatOption.WITHOUT_PLACEHOLDERS);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -48,7 +48,7 @@ fun SlotBuilder.onMiddleClick(action: (InventoryClickEvent, Slot, Menu) -> Unit)
|
||||
@Deprecated("Use SlotUpdater instead")
|
||||
@Suppress("DEPRECATION")
|
||||
fun SlotBuilder.setModifier(action: (Player, Menu, ItemStack) -> Unit): SlotBuilder =
|
||||
this.setModifier { a, b, c -> action(a, b, c) }
|
||||
this.setUpdater { a, b, c -> c.apply { action(a, b, c) } }
|
||||
|
||||
/**
|
||||
* @see SlotBuilder.setUpdater
|
||||
|
||||
@@ -35,7 +35,7 @@ fun String.formatEco(
|
||||
fun List<String>.formatEco(
|
||||
player: Player? = null,
|
||||
formatPlaceholders: Boolean = false
|
||||
) = StringUtils.formatList(
|
||||
): List<String> = StringUtils.formatList(
|
||||
this,
|
||||
player,
|
||||
if (formatPlaceholders) StringUtils.FormatOption.WITH_PLACEHOLDERS else StringUtils.FormatOption.WITHOUT_PLACEHOLDERS
|
||||
|
||||
@@ -10,7 +10,6 @@ import org.bukkit.Material
|
||||
import org.bukkit.entity.EntityType
|
||||
import org.bukkit.entity.ExperienceOrb
|
||||
import org.bukkit.entity.Player
|
||||
import org.bukkit.event.player.PlayerExpChangeEvent
|
||||
import org.bukkit.inventory.ItemStack
|
||||
import org.bukkit.util.Vector
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.willfp.eco.internal.entities
|
||||
|
||||
import com.willfp.eco.core.entities.args.EntityArgParseResult
|
||||
import com.willfp.eco.core.entities.args.EntityArgParser
|
||||
import org.bukkit.entity.Animals
|
||||
|
||||
class EntityArgParserSilent : EntityArgParser {
|
||||
override fun parseArguments(args: Array<out String>): EntityArgParseResult? {
|
||||
|
||||
@@ -8,7 +8,7 @@ import org.bukkit.inventory.MerchantRecipe
|
||||
import java.lang.reflect.Field
|
||||
|
||||
class VillagerTrade : VillagerTradeProxy {
|
||||
private var handle: Field
|
||||
private val handle: Field = CraftMerchantRecipe::class.java.getDeclaredField("handle")
|
||||
|
||||
override fun displayTrade(
|
||||
recipe: MerchantRecipe,
|
||||
@@ -35,7 +35,6 @@ class VillagerTrade : VillagerTradeProxy {
|
||||
}
|
||||
|
||||
init {
|
||||
handle = CraftMerchantRecipe::class.java.getDeclaredField("handle")
|
||||
handle.isAccessible = true
|
||||
}
|
||||
}
|
||||
@@ -176,6 +176,7 @@ class NMSFastItemStack(itemStack: org.bukkit.inventory.ItemStack) : EcoFastItemS
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
@Suppress("KotlinDeprecation")
|
||||
return handle.tag?.hashCode() ?: (0b00010101 * 31 + Item.getId(handle.item))
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user