OpenInv 2.2.7

Updated for Spigot 1.8.3
Dropped support for all other versions
Fixed lookup not working for players on first login/incomplete names
This commit is contained in:
Jikoo
2015-03-11 16:37:13 -04:00
parent 21cd1926ae
commit 4058463f7f
9 changed files with 103 additions and 55 deletions

View File

@@ -17,6 +17,7 @@
package com.lishid.openinv.commands;
import java.util.HashMap;
import java.util.List;
import java.util.UUID;
import org.bukkit.Bukkit;
@@ -41,7 +42,8 @@ public class OpenEnderPluginCommand implements CommandExecutor {
this.plugin = plugin;
}
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "You can't use this from the console.");
return true;
@@ -82,6 +84,11 @@ public class OpenEnderPluginCommand implements CommandExecutor {
new BukkitRunnable() {
@Override
public void run() {
List<Player> matches = Bukkit.matchPlayer(name);
if (!matches.isEmpty()) {
openInventory(player, matches.get(0).getUniqueId());
return;
}
final OfflinePlayer offlinePlayer = Bukkit.getOfflinePlayer(name);
if (Bukkit.getPlayer(senderID) == null) {
return;