mirror of
https://github.com/songoda/UltimateKits.git
synced 2024-09-06 03:08:02 +02:00
Fix for the weird 0 issue.
This commit is contained in:
parent
8a3b9815ab
commit
7bc52f4dda
@ -1,10 +1,12 @@
|
|||||||
package com.songoda.ultimatekits.handlers;
|
package com.songoda.ultimatekits.handlers;
|
||||||
|
|
||||||
|
import com.songoda.arconix.api.methods.formatting.TextComponent;
|
||||||
import com.songoda.ultimatekits.UltimateKits;
|
import com.songoda.ultimatekits.UltimateKits;
|
||||||
import com.songoda.ultimatekits.kit.Kit;
|
import com.songoda.ultimatekits.kit.Kit;
|
||||||
import com.songoda.ultimatekits.kit.KitBlockData;
|
import com.songoda.ultimatekits.kit.KitBlockData;
|
||||||
import com.songoda.ultimatekits.utils.Debugger;
|
import com.songoda.ultimatekits.utils.Debugger;
|
||||||
import org.bukkit.Bukkit;
|
import org.bukkit.Bukkit;
|
||||||
|
import org.bukkit.ChatColor;
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
import org.bukkit.entity.Entity;
|
import org.bukkit.entity.Entity;
|
||||||
import org.bukkit.entity.EntityType;
|
import org.bukkit.entity.EntityType;
|
||||||
@ -57,7 +59,7 @@ public class DisplayItemHandler {
|
|||||||
i.remove();
|
i.remove();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
int inum = Integer.parseInt(i.getItemStack().getItemMeta().getDisplayName()) + 1;
|
int inum = Integer.parseInt(i.getItemStack().getItemMeta().getDisplayName().replace(String.valueOf(ChatColor.COLOR_CHAR), "")) + 1;
|
||||||
if (inum > list.size()) inum = 1;
|
if (inum > list.size()) inum = 1;
|
||||||
|
|
||||||
ItemStack is = list.get(inum - 1);
|
ItemStack is = list.get(inum - 1);
|
||||||
@ -67,7 +69,7 @@ public class DisplayItemHandler {
|
|||||||
}
|
}
|
||||||
ItemMeta meta = is.getItemMeta();
|
ItemMeta meta = is.getItemMeta();
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
meta.setDisplayName(Integer.toString(inum));
|
meta.setDisplayName(TextComponent.convertToInvisibleString(Integer.toString(inum)));
|
||||||
is.setItemMeta(meta);
|
is.setItemMeta(meta);
|
||||||
i.setItemStack(is);
|
i.setItemStack(is);
|
||||||
i.setPickupDelay(9999);
|
i.setPickupDelay(9999);
|
||||||
@ -78,7 +80,7 @@ public class DisplayItemHandler {
|
|||||||
ItemStack is = list.get(0);
|
ItemStack is = list.get(0);
|
||||||
is.setAmount(1);
|
is.setAmount(1);
|
||||||
ItemMeta meta = is.getItemMeta();
|
ItemMeta meta = is.getItemMeta();
|
||||||
meta.setDisplayName("0");
|
meta.setDisplayName(TextComponent.convertToInvisibleString("0"));
|
||||||
is.setItemMeta(meta);
|
is.setItemMeta(meta);
|
||||||
Item item = location.getWorld().dropItem(location.add(0, 1, 0), list.get(0));
|
Item item = location.getWorld().dropItem(location.add(0, 1, 0), list.get(0));
|
||||||
Vector vec = new Vector(0, 0, 0);
|
Vector vec = new Vector(0, 0, 0);
|
||||||
|
Loading…
Reference in New Issue
Block a user