Fixed items not updating immediately.
This commit is contained in:
parent
8fe4e39207
commit
b0f6435661
@ -112,6 +112,7 @@ public class GadgetPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
public void run()
|
||||
{
|
||||
Plugin.getInventoryManager().addItemToInventory(Player, gadget.getGadgetType().name(), gadget.GetName(), (gadget instanceof ItemGadget ? ((ItemGadget)gadget).getAmmo().getQuantity() : gadget.getQuantity()));
|
||||
Refresh();
|
||||
}
|
||||
}, this, (gadget instanceof ItemGadget ? ((ItemGadget)gadget).getAmmo() : gadget), CurrencyType.Coins, Player));
|
||||
}
|
||||
|
@ -93,6 +93,7 @@ public class MountPage extends ShopPageBase<CosmeticManager, CosmeticShop>
|
||||
public void run()
|
||||
{
|
||||
Plugin.getInventoryManager().addItemToInventory(Player, "Mount", mount.GetName(), 1);
|
||||
Refresh();
|
||||
}
|
||||
}, this, mount, CurrencyType.Coins, Player));
|
||||
}
|
||||
|
@ -68,6 +68,11 @@ public class InventoryManager extends MiniClientPlugin<ClientInventory>
|
||||
{
|
||||
final String uuidString = player.getUniqueId().toString();
|
||||
|
||||
if (_items.containsKey(item))
|
||||
{
|
||||
Get(player).addItem(new ClientItem(_items.get(item), count));
|
||||
}
|
||||
|
||||
Bukkit.getServer().getScheduler().runTaskAsynchronously(GetPlugin(), new Runnable()
|
||||
{
|
||||
public void run()
|
||||
@ -94,8 +99,6 @@ public class InventoryManager extends MiniClientPlugin<ClientInventory>
|
||||
|
||||
updateItems();
|
||||
|
||||
Get(player).addItem(new ClientItem(_items.get(item), count));
|
||||
|
||||
synchronized (_inventoryLock)
|
||||
{
|
||||
_repository.incrementClientInventoryItem(uuidString, _items.get(item).Id, count);
|
||||
|
Loading…
Reference in New Issue
Block a user