mirror of
https://e.coding.net/circlecloud/QuickShop.git
synced 2024-11-22 01:58:54 +00:00
change tool tip...
Signed-off-by: 502647092 <jtb1@163.com>
This commit is contained in:
parent
e728777aee
commit
3d5aa384b1
@ -17,9 +17,9 @@ import cn.citycraft.PluginHelper.config.FileConfig;
|
|||||||
import mkremins.fanciful.FancyMessage;
|
import mkremins.fanciful.FancyMessage;
|
||||||
|
|
||||||
public class MsgUtil {
|
public class MsgUtil {
|
||||||
private static QuickShop plugin;
|
|
||||||
private static FileConfig messages;
|
private static FileConfig messages;
|
||||||
private static HashMap<String, LinkedList<String>> player_messages = new HashMap<String, LinkedList<String>>();
|
private static HashMap<String, LinkedList<String>> player_messages = new HashMap<String, LinkedList<String>>();
|
||||||
|
private static QuickShop plugin;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Deletes any messages that are older than a week in the database, to save
|
* Deletes any messages that are older than a week in the database, to save
|
||||||
@ -141,7 +141,7 @@ public class MsgUtil {
|
|||||||
final double tax = plugin.getConfig().getDouble("tax");
|
final double tax = plugin.getConfig().getDouble("tax");
|
||||||
final double total = amount * shop.getPrice();
|
final double total = amount * shop.getPrice();
|
||||||
if (tax != 0) {
|
if (tax != 0) {
|
||||||
if (!p.getUniqueId().equals(shop.getOwner())) {
|
if (!p.getName().equals(shop.getOwner())) {
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.sell-tax", "" + Util.format((tax * total))));
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.sell-tax", "" + Util.format((tax * total))));
|
||||||
} else {
|
} else {
|
||||||
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.sell-tax-self"));
|
p.sendMessage(ChatColor.DARK_PURPLE + "| " + MsgUtil.p("menu.sell-tax-self"));
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
package org.maxgamer.QuickShop.Util;
|
package org.maxgamer.QuickShop.Util;
|
||||||
|
|
||||||
import java.text.DecimalFormat;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
@ -26,11 +25,11 @@ import org.maxgamer.QuickShop.Config.ItemConfig;
|
|||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
public class Util {
|
public class Util {
|
||||||
private static HashSet<Material> tools = new HashSet<Material>();
|
|
||||||
private static HashSet<Material> blacklist = new HashSet<Material>();
|
private static HashSet<Material> blacklist = new HashSet<Material>();
|
||||||
private static HashSet<Material> shoppables = new HashSet<Material>();
|
|
||||||
private static HashSet<Material> transparent = new HashSet<Material>();
|
|
||||||
private static QuickShop plugin;
|
private static QuickShop plugin;
|
||||||
|
private static HashSet<Material> shoppables = new HashSet<Material>();
|
||||||
|
private static HashSet<Material> tools = new HashSet<Material>();
|
||||||
|
private static HashSet<Material> transparent = new HashSet<Material>();
|
||||||
|
|
||||||
public static void addTransparentBlock(final Material m) {
|
public static void addTransparentBlock(final Material m) {
|
||||||
if (transparent.add(m) == false) {
|
if (transparent.add(m) == false) {
|
||||||
@ -228,8 +227,7 @@ public class Util {
|
|||||||
public static String getToolPercentage(final ItemStack item) {
|
public static String getToolPercentage(final ItemStack item) {
|
||||||
final double dura = item.getDurability();
|
final double dura = item.getDurability();
|
||||||
final double max = item.getType().getMaxDurability();
|
final double max = item.getType().getMaxDurability();
|
||||||
final DecimalFormat formatter = new DecimalFormat("0");
|
return String.format("%.2f(%s/%s)", (1 - dura / max) * 100.0, dura, max);
|
||||||
return dura + "/" + max + "(" + formatter.format((1 - dura / max) * 100.0) + ")";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void initialize() {
|
public static void initialize() {
|
||||||
|
Loading…
Reference in New Issue
Block a user