Compare commits

..

1 Commits
2.4.2 ... 2.4.3

Author SHA1 Message Date
Jikoo
7256494df3 Fix inventories of players on their first login not being openable
Closes #7
2016-04-18 13:05:56 -04:00
3 changed files with 9 additions and 3 deletions

View File

@@ -40,6 +40,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
this.plugin = plugin;
}
@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.");
@@ -72,6 +73,7 @@ public class OpenEnderPluginCommand implements CommandExecutor {
}
new BukkitRunnable() {
@Override
public void run() {
List<Player> matches = Bukkit.matchPlayer(name);
final OfflinePlayer offlinePlayer;
@@ -83,11 +85,12 @@ public class OpenEnderPluginCommand implements CommandExecutor {
if (!player.isOnline()) {
return;
}
if (offlinePlayer == null || !offlinePlayer.hasPlayedBefore()) {
if (offlinePlayer == null || !offlinePlayer.hasPlayedBefore() && !offlinePlayer.isOnline()) {
player.sendMessage(ChatColor.RED + "Player not found!");
return;
}
new BukkitRunnable() {
@Override
public void run() {
if (!player.isOnline()) {
return;

View File

@@ -40,6 +40,7 @@ public class OpenInvPluginCommand implements CommandExecutor {
this.plugin = plugin;
}
@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.");
@@ -72,6 +73,7 @@ public class OpenInvPluginCommand implements CommandExecutor {
}
new BukkitRunnable() {
@Override
public void run() {
List<Player> matches = Bukkit.matchPlayer(name);
final OfflinePlayer offlinePlayer;
@@ -83,11 +85,12 @@ public class OpenInvPluginCommand implements CommandExecutor {
if (!player.isOnline()) {
return;
}
if (offlinePlayer == null || !offlinePlayer.hasPlayedBefore()) {
if (offlinePlayer == null || !offlinePlayer.hasPlayedBefore() && !offlinePlayer.isOnline()) {
player.sendMessage(ChatColor.RED + "Player not found!");
return;
}
new BukkitRunnable() {
@Override
public void run() {
if (!player.isOnline()) {
return;

View File

@@ -1,6 +1,6 @@
name: OpenInv
main: com.lishid.openinv.OpenInv
version: 2.4.1
version: 2.4.3
author: lishid
authors: [Jikoo]
description: >