Update to MC 1.4.4

This commit is contained in:
lishid 2012-11-15 22:45:53 -05:00
parent ab04e461a8
commit 90cbd62859
6 changed files with 31 additions and 34 deletions

View file

@ -60,7 +60,7 @@ public class OpenInv extends JavaPlugin
pm.registerEvents(new OpenInvInventoryListener(), this); pm.registerEvents(new OpenInvInventoryListener(), this);
getCommand("openinv").setExecutor(new OpenInvPluginCommand(this)); getCommand("openinv").setExecutor(new OpenInvPluginCommand(this));
getCommand("searchinv").setExecutor(new SearchInvPluginCommand(this)); getCommand("searchinv").setExecutor(new SearchInvPluginCommand());
getCommand("toggleopeninv").setExecutor(new ToggleOpenInvPluginCommand()); getCommand("toggleopeninv").setExecutor(new ToggleOpenInvPluginCommand());
getCommand("silentchest").setExecutor(new SilentChestPluginCommand(this)); getCommand("silentchest").setExecutor(new SilentChestPluginCommand(this));
getCommand("anychest").setExecutor(new AnyChestPluginCommand(this)); getCommand("anychest").setExecutor(new AnyChestPluginCommand(this));

View file

@ -87,18 +87,10 @@ public class OpenInvPluginCommand implements CommandExecutor
// Read from history if target is not named // Read from history if target is not named
if (args.length < 1) if (args.length < 1)
{
if (history != null && history != "")
{ {
name = history; name = history;
} }
else else
{
sender.sendMessage(ChatColor.RED + "OpenInv history is empty!");
return true;
}
}
else
{ {
name = args[0]; name = args[0];
} }

View file

@ -16,9 +16,9 @@
package lishid.openinv.commands; package lishid.openinv.commands;
import lishid.openinv.OpenInv;
import lishid.openinv.Permissions; import lishid.openinv.Permissions;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor; import org.bukkit.ChatColor;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.command.Command; import org.bukkit.command.Command;
@ -28,11 +28,9 @@ import org.bukkit.entity.Player;
public class SearchInvPluginCommand implements CommandExecutor public class SearchInvPluginCommand implements CommandExecutor
{ {
private final OpenInv plugin; public SearchInvPluginCommand()
public SearchInvPluginCommand(OpenInv plugin)
{ {
this.plugin = plugin;
} }
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
@ -76,7 +74,7 @@ public class SearchInvPluginCommand implements CommandExecutor
return false; return false;
} }
for (Player templayer : plugin.getServer().getOnlinePlayers()) for (Player templayer : Bukkit.getServer().getOnlinePlayers())
{ {
if (templayer.getInventory().contains(material, count)) if (templayer.getInventory().contains(material, count))
{ {

View file

@ -40,6 +40,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
this.armor = player.inventory.armor; this.armor = player.inventory.armor;
} }
@Override
public void onClose(CraftHumanEntity who) public void onClose(CraftHumanEntity who)
{ {
super.onClose(who); super.onClose(who);
@ -71,6 +72,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
playerOnline = false; playerOnline = false;
} }
@Override
public ItemStack[] getContents() public ItemStack[] getContents()
{ {
ItemStack[] C = new ItemStack[getSize()]; ItemStack[] C = new ItemStack[getSize()];
@ -79,11 +81,13 @@ public class OpenInvPlayerInventory extends PlayerInventory
return C; return C;
} }
@Override
public int getSize() public int getSize()
{ {
return super.getSize() + 5; return super.getSize() + 5;
} }
@Override
public ItemStack getItem(int i) public ItemStack getItem(int i)
{ {
ItemStack[] is = this.items; ItemStack[] is = this.items;
@ -111,6 +115,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
return is[i]; return is[i];
} }
@Override
public ItemStack splitStack(int i, int j) public ItemStack splitStack(int i, int j)
{ {
ItemStack[] is = this.items; ItemStack[] is = this.items;
@ -162,6 +167,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
} }
} }
@Override
public ItemStack splitWithoutUpdate(int i) public ItemStack splitWithoutUpdate(int i)
{ {
ItemStack[] is = this.items; ItemStack[] is = this.items;
@ -199,6 +205,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
} }
} }
@Override
public void setItem(int i, ItemStack itemstack) public void setItem(int i, ItemStack itemstack)
{ {
ItemStack[] is = this.items; ItemStack[] is = this.items;
@ -260,6 +267,7 @@ public class OpenInvPlayerInventory extends PlayerInventory
return i; return i;
} }
@Override
public String getName() public String getName()
{ {
if (player.name.length() > 16) if (player.name.length() > 16)
@ -269,7 +277,8 @@ public class OpenInvPlayerInventory extends PlayerInventory
return player.name; return player.name;
} }
public boolean a(EntityHuman entityhuman) @Override
public boolean a_(EntityHuman entityhuman)
{ {
return true; return true;
} }

View file

@ -33,10 +33,8 @@ public class SilentContainerChest extends ContainerChest
} }
@Override @Override
public void a(EntityHuman paramEntityHuman) public void b(EntityHuman paramEntityHuman)
{ {
super.a(paramEntityHuman);
// open signal
inv.startOpen();
} }
} }

View file

@ -1,6 +1,6 @@
name: OpenInv name: OpenInv
main: lishid.openinv.OpenInv main: lishid.openinv.OpenInv
version: 1.8.8 version: 1.9.0
author: lishid author: lishid
website: http://forums.bukkit.org/threads/15379/ website: http://forums.bukkit.org/threads/15379/
description: > description: >