Update Missile.lore
Dieser Commit ist enthalten in:
Ursprung
4c9327face
Commit
b137aaec24
@ -104,7 +104,7 @@ public class MWTeam {
|
||||
Inventory inventory = p.getInventory();
|
||||
for (int i = 0; i <= 35; i++) { // 35 is the last normal inventory slot
|
||||
ItemStack itemStack = inventory.getItem(i);
|
||||
if (itemStack != null && itemStack.isSimilar(item) && getUsesOfItem(itemStack) + getUsesOfItem(item) <= itemStack.getType().getMaxDurability()) {
|
||||
if (itemStack != null && itemStack.getType() == item.getType() && getUsesOfItem(itemStack) + getUsesOfItem(item) <= itemStack.getType().getMaxDurability()) {
|
||||
int uses = getUsesOfItem(itemStack) + getUsesOfItem(item);
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
Damageable damageable = (Damageable) itemMeta;
|
||||
|
@ -82,32 +82,10 @@ public class Missile extends SpecialItem {
|
||||
|
||||
private void lore(List<String> lore, String[] args, int index, String tag) {
|
||||
if (args.length > index) {
|
||||
try {
|
||||
lore.add(graph(Integer.parseInt(args[index]), GRAPH_SIZE) + tag);
|
||||
return;
|
||||
} catch (NumberFormatException e) {
|
||||
// Ignored
|
||||
}
|
||||
lore.add(tag + " §8: §e" + Integer.parseInt(args[index]) + "§8/§77");
|
||||
} else {
|
||||
lore.add(tag + " §8: §e0§8/§77");
|
||||
}
|
||||
lore.add(graph(0, GRAPH_SIZE) + tag);
|
||||
}
|
||||
|
||||
private String graph(int index, int size) {
|
||||
if (index > size) index = size;
|
||||
StringBuilder st = new StringBuilder();
|
||||
st.append("§8[§e");
|
||||
if (index > 0) st.append(repeat(index));
|
||||
st.append("§7");
|
||||
st.append(repeat(size - index));
|
||||
st.append("§8]");
|
||||
return st.toString();
|
||||
}
|
||||
|
||||
private String repeat(int count) {
|
||||
if (count == 0) return "";
|
||||
StringBuilder st = new StringBuilder();
|
||||
for (int i = 0; i < count; i++) st.append("=");
|
||||
return st.toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren