mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-08 05:23:12 +00:00
Fix behavior of itemdb command on legacy versions (#4320)
This commit is contained in:
parent
8c8c85d753
commit
33ca3b2981
3 changed files with 14 additions and 4 deletions
|
@ -7,6 +7,7 @@ import org.bukkit.Material;
|
|||
import org.bukkit.Server;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -55,9 +56,13 @@ public class Commanditemdb extends EssentialsCommand {
|
|||
}
|
||||
|
||||
List<String> nameList = ess.getItemDb().nameList(itemStack);
|
||||
nameList = nameList != null ? new ArrayList<>(nameList) : new ArrayList<>();
|
||||
nameList.addAll(ess.getCustomItemResolver().getAliasesFor(ess.getItemDb().name(itemStack)));
|
||||
Collections.sort(nameList);
|
||||
if (nameList.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
Collections.sort(nameList);
|
||||
if (nameList.size() > 15) {
|
||||
nameList = nameList.subList(0, 14);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue