retrieve must be called in worker threads

This commit is contained in:
themode 2021-12-22 07:09:40 +01:00 committed by TheMode
parent 8c1c18e345
commit d7ab273b60

View File

@ -82,13 +82,13 @@ public class VillagerInventory extends Inventory {
public void update() {
super.update();
this.tradeCache.invalidate();
sendPacketToViewers(tradeCache.retrieve());
sendPacketToViewers(tradeCache);
}
@Override
public boolean addViewer(@NotNull Player player) {
final boolean result = super.addViewer(player);
if (result) player.sendPacket(tradeCache.retrieve());
if (result) player.sendPacket(tradeCache);
return result;
}