diff --git a/TwosideKeeper.jar b/TwosideKeeper.jar index 4ce226d..262d996 100644 Binary files a/TwosideKeeper.jar and b/TwosideKeeper.jar differ diff --git a/src/plugin.yml b/src/plugin.yml index 6d6b3d7..115fa1e 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TwosideKeeper main: sig.plugin.TwosideKeeper.TwosideKeeper -version: 3.5.0 +version: 3.5.0a commands: money: description: Tells the player the amount of money they are holding. diff --git a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java index 7174139..901d099 100644 --- a/src/sig/plugin/TwosideKeeper/TwosideKeeper.java +++ b/src/sig/plugin/TwosideKeeper/TwosideKeeper.java @@ -2415,24 +2415,20 @@ public class TwosideKeeper extends JavaPlugin implements Listener { //This means we don't rename the item and copy over the old name, since //They are repairing it. String oldname = ev.getInventory().getItem(0).getItemMeta().getDisplayName(); - ItemMeta m = ev.getResult().getItemMeta(); + ItemMeta m = ev.getInventory().getItem(2).getItemMeta(); m.setDisplayName(oldname); - ev.getResult().setItemMeta(m); - /*//It's possible we may have to fix the color code for this item. Check the first two characters. - String oldname = ev.getInventory().getItem(0).getItemMeta().getDisplayName(); - String strippedname = ChatColor.stripColor(oldname); - String colorcodes = oldname.replace(strippedname, ""); - if (colorcodes.length()==2) { - colorcodes=colorcodes.substring(1); - } else - if (colorcodes.length()==4) { - colorcodes=Character.toString(colorcodes.charAt(1))+Character.toString(colorcodes.charAt(3)); - } - log("Color codes are: <"+colorcodes+">. Length is "+colorcodes.length(),4); - //ev.getWhoClicked().sendMessage(ChatColor.getByChar(colorcodes)+"This is the color."); - ItemMeta m = ev.getResult().getItemMeta(); - m.setDisplayName(ChatColor.getByChar(colorcodes)+m.getDisplayName().replaceFirst(colorcodes, "")); - ev.getResult().setItemMeta(m);*/ + ev.getInventory().getItem(2).setItemMeta(m); + } else { + /*if (ev.getResult()!=null && + ev.getInventory().getItem(0)!=null && + ev.getInventory().getItem(0).getItemMeta().hasDisplayName()) { + String oldname = ev.getInventory().getItem(0).getItemMeta().getDisplayName(); + String strippedname = ChatColor.stripColor(oldname); + String colorcodes = oldname.replace(strippedname, ""); + ItemMeta m = ev.getResult().getItemMeta(); + m.setDisplayName(strippedname.replace(colorcodes, "")); + ev.getResult().setItemMeta(m); + }*/ } }