Updated to MC 1.0.0

Fixed inventory not updating problem.
This commit is contained in:
lishd
2011-12-02 17:28:57 -05:00
parent 493f9b7e2e
commit ea95c5bfd0
6 changed files with 131 additions and 72 deletions

View File

@@ -1,25 +1,33 @@
package lishid.openinv.utils;
import net.minecraft.server.ContainerPlayer;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.InventoryPlayer;
import org.bukkit.entity.Player;
public class PlayerInventoryChest extends InventoryPlayer
import lishid.openinv.commands.OpenInvPluginCommand;
import net.minecraft.server.EntityHuman;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.PlayerInventory;
public class PlayerInventoryChest extends PlayerInventory
{
public PlayerInventoryChest(InventoryPlayer inventory) {
super(inventory.d);
public boolean Offline = false;
public Player Opener;
public Player Target;
public PlayerInventoryChest(PlayerInventory inventory, EntityPlayer entityplayer) {
super(entityplayer);
this.armor = inventory.armor;
this.items = inventory.items;
this.itemInHandIndex = inventory.itemInHandIndex;
this.e = inventory.e;
this.b(inventory.l());
inventory.d.defaultContainer = new ContainerPlayer(this, !inventory.d.world.isStatic);
inventory.d.activeContainer = inventory.d.defaultContainer;
}
@Override
public String getName() {
return "Player Inventory";
if(this.d.name.length() > 16)
return this.d.name.substring(0, 16);
else
return this.d.name;
}
@Override
@@ -27,4 +35,16 @@ public class PlayerInventoryChest extends InventoryPlayer
{
return true;
}
@Override
public void g() {
try{
Player player = OpenInvPluginCommand.offlineInv.get(this);
if(player != null)
{
player.saveData();
OpenInvPluginCommand.offlineInv.remove(this);
}
}catch(Exception e){}
}
}