mirror of
https://github.com/EarthMC/QuickShop-Reremake.git
synced 2026-11-25 09:59:49 -05:00
Don't load chunks in init
This commit is contained in:
1 parent
34b68cf2a6
commit
c38b02f21e
1 file changed
+4
-3
@@ -59,12 +59,11 @@ public class VirtualDisplayItem extends DisplayItem {
|
||||
private static final ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
|
||||
private static PacketAdapter packetAdapter = null;
|
||||
//cache chunk x and z
|
||||
private final ShopChunk chunkLocation;
|
||||
private ShopChunk chunkLocation;
|
||||
|
||||
public VirtualDisplayItem(@NotNull Shop shop) throws RuntimeException {
|
||||
super(shop);
|
||||
Chunk chunk = shop.getLocation().getChunk();
|
||||
chunkLocation = new ShopChunk(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
|
||||
|
||||
if (!managerLoaded.get()) {
|
||||
loadManager();
|
||||
}
|
||||
@@ -260,6 +259,8 @@ public class VirtualDisplayItem extends DisplayItem {
|
||||
private void load() {
|
||||
Util.ensureThread(false);
|
||||
//some time shop can be loaded when world isn't loaded
|
||||
Chunk chunk = shop.getLocation().getChunk();
|
||||
chunkLocation = new ShopChunk(chunk.getWorld().getName(), chunk.getX(), chunk.getZ());
|
||||
chunksMapping.put(chunkLocation, this);
|
||||
if (Util.isLoaded(shop.getLocation())) {
|
||||
//Let nearby player can saw fake item
|
||||
|
||||
Reference in new issue
Block a user