Updated to MC 1.0.0
Fixed inventory not updating problem.
This commit is contained in:
@@ -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){}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user