mirror of
https://github.com/kiranhart/Auction-House.git
synced 2024-12-01 06:53:23 +01:00
🎨 remove force &f color in getItemName method for items that don't have a custom/coloured name
Took 57 seconds
This commit is contained in:
parent
df128270a7
commit
fff6a3f9be
@ -27,11 +27,10 @@ import ca.tweetzy.auctionhouse.settings.Settings;
|
|||||||
import ca.tweetzy.core.compatibility.ServerVersion;
|
import ca.tweetzy.core.compatibility.ServerVersion;
|
||||||
import ca.tweetzy.core.compatibility.XMaterial;
|
import ca.tweetzy.core.compatibility.XMaterial;
|
||||||
import ca.tweetzy.core.hooks.EconomyManager;
|
import ca.tweetzy.core.hooks.EconomyManager;
|
||||||
import ca.tweetzy.core.utils.TextUtils;
|
|
||||||
import ca.tweetzy.core.utils.items.ItemUtils;
|
import ca.tweetzy.core.utils.items.ItemUtils;
|
||||||
|
import ca.tweetzy.flight.nbtapi.NBT;
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.JsonParser;
|
import com.google.gson.JsonParser;
|
||||||
import ca.tweetzy.flight.nbtapi.NBT;
|
|
||||||
import org.apache.commons.lang.StringUtils;
|
import org.apache.commons.lang.StringUtils;
|
||||||
import org.apache.commons.lang.WordUtils;
|
import org.apache.commons.lang.WordUtils;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
@ -266,7 +265,7 @@ public class AuctionAPI {
|
|||||||
*/
|
*/
|
||||||
public String getItemName(ItemStack stack) {
|
public String getItemName(ItemStack stack) {
|
||||||
Objects.requireNonNull(stack, "Item stack cannot be null when getting name");
|
Objects.requireNonNull(stack, "Item stack cannot be null when getting name");
|
||||||
final String name = stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName() : TextUtils.formatText("&f" + WordUtils.capitalize(stack.getType().name().toLowerCase().replace("_", " ")));
|
final String name = stack.getItemMeta().hasDisplayName() ? stack.getItemMeta().getDisplayName() : WordUtils.capitalize(stack.getType().name().toLowerCase().replace("_", " "));
|
||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user