new-1.1
This commit is contained in:
parent
ebd5431294
commit
ddc438b2d3
|
@ -54,7 +54,7 @@ public class CommandHandler implements CommandExecutor, TabCompleter {
|
|||
.filter(entry -> entry.getName().equalsIgnoreCase(currentArg))
|
||||
.findFirst();
|
||||
|
||||
if (!optionalEntry.isPresent()) {
|
||||
if (optionalEntry.isEmpty()) {
|
||||
sender.sendMessage(Lang.get("command.unknown-arg", index + 1, currentArg));
|
||||
return;
|
||||
}
|
||||
|
@ -164,7 +164,7 @@ public class CommandHandler implements CommandExecutor, TabCompleter {
|
|||
CommandEntity commandEntity = entityOptional.get();
|
||||
List<CommandEntry> entries = commandEntity.getChildrens();
|
||||
|
||||
if (entries.size() == 0) {
|
||||
if (entries.isEmpty()) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
|
|
@ -80,10 +80,9 @@ public class CommandHelp {
|
|||
private StringBuilder getCommandInfo(CommandEntity command, String commandAlias) {
|
||||
StringBuilder stringBuilder = new StringBuilder("§6/"+ commandAlias +" "+ command.getCommand());
|
||||
stringBuilder.append("§f");
|
||||
if (command.getChildrens().size() > 0) {
|
||||
if (!command.getChildrens().isEmpty()) {
|
||||
if (!(command.getChildrens().size() == 1 && command.getChildrens().get(0).isNodal())) {
|
||||
for (CommandEntry child : command.getChildrens()) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -87,9 +87,7 @@ public class TagStatItem {
|
|||
@Override
|
||||
public TagStatItem clone() {
|
||||
TagStatItem tagStatItem = new TagStatItem(itemStack.clone());
|
||||
Iterator iterator = this.stats.keySet().iterator();
|
||||
while(iterator.hasNext()) {
|
||||
ItemStat itemStat = (ItemStat) iterator.next();
|
||||
for (ItemStat itemStat : this.stats.keySet()) {
|
||||
tagStatItem.stats.put(itemStat, this.stats.get(itemStat));
|
||||
}
|
||||
return tagStatItem;
|
||||
|
|
|
@ -2,6 +2,7 @@ package com.io.yutian.elementoriginlib.item;
|
|||
|
||||
import com.io.yutian.elementoriginlib.tag.ItemProxy;
|
||||
import com.io.yutian.elementoriginlib.tag.TagCompound;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.inventory.meta.ItemMeta;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
@ -46,10 +47,10 @@ public class TagStatItemStackBuilder {
|
|||
itemStack = itemProxy.getItemStack();
|
||||
itemMeta = itemStack.getItemMeta();
|
||||
tagStatItem.getStats().forEach((stat, statData) -> stat.applyMeta(this, statData));
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
List<String> lores = itemMeta.hasLore() ? itemMeta.getLore() : new ArrayList<>();
|
||||
List<Component> lores = itemMeta.hasLore() ? itemMeta.lore() : new ArrayList<>();
|
||||
tagStatItem.getStats().forEach((stat, statData) -> stat.whenApplyLore(this, statData, lores));
|
||||
itemStack.setLore(lores);
|
||||
itemMeta.lore(lores);
|
||||
itemStack.setItemMeta(itemMeta);
|
||||
}
|
||||
|
||||
@NotNull
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
package com.io.yutian.elementoriginlib.item.stat.data;
|
||||
|
||||
import com.io.yutian.elementoriginlib.exception.itemstat.ItemStatDataLoadException;
|
||||
import com.io.yutian.elementoriginlib.item.stat.Mergeable;
|
||||
import com.io.yutian.elementoriginlib.item.stat.StatData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
|
|
@ -1,7 +1,5 @@
|
|||
package com.io.yutian.elementoriginlib.item.stat.data;
|
||||
|
||||
import com.io.yutian.elementoriginlib.item.stat.StatData;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class EnumListData<E extends Enum> extends ListData<E> {
|
||||
|
|
|
@ -1,9 +1,5 @@
|
|||
package com.io.yutian.elementoriginlib.item.stat.data;
|
||||
|
||||
import com.io.yutian.elementoriginlib.item.stat.Mergeable;
|
||||
import com.io.yutian.elementoriginlib.item.stat.StatData;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class StringListData extends ListData<String> {
|
||||
|
|
|
@ -3,7 +3,6 @@ package com.io.yutian.elementoriginlib.manager;
|
|||
import com.io.yutian.elementoriginlib.command.SimpleCommandManager;
|
||||
import com.io.yutian.elementoriginlib.command.list.CommandHelp;
|
||||
import com.io.yutian.elementoriginlib.command.list.CommandReload;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
public class CommandManager extends SimpleCommandManager {
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user