fixed the loading issue

This commit is contained in:
Vlammar 2021-09-19 15:22:04 +02:00
parent c1f793d50a
commit a74734dfb7
2 changed files with 10 additions and 5 deletions

View File

@ -39,6 +39,7 @@ package fr.moribus.imageonmap.image;
import fr.moribus.imageonmap.ImageOnMap;
import fr.moribus.imageonmap.map.MapManager;
import fr.zcraft.quartzlib.core.QuartzLib;
import fr.zcraft.quartzlib.tools.runners.RunTask;
import java.io.File;
import org.bukkit.Bukkit;
import org.bukkit.Material;
@ -97,11 +98,14 @@ public class MapInitEvent implements Listener {
@EventHandler
public void onChunkLoad(ChunkLoadEvent event) {
for (Entity entity : event.getChunk().getEntities()) {
if (entity instanceof ItemFrame) {
initMap(((ItemFrame) entity).getItem());
//Fix for paper
RunTask.later(() -> {
for (Entity entity : event.getChunk().getEntities()) {
if (entity instanceof ItemFrame) {
initMap(((ItemFrame) entity).getItem());
}
}
}
}, 5L);
}
@EventHandler

View File

@ -65,7 +65,8 @@ import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.MapMeta;
//TODO rework splatter effect, using ID is far more stable than nbt tags.
// To update when adding small picture previsualization.
public abstract class SplatterMapManager {
private SplatterMapManager() {
}