From a74734dfb7ebe331afc9e73e839a7a76dbc7ace5 Mon Sep 17 00:00:00 2001 From: Vlammar Date: Sun, 19 Sep 2021 15:22:04 +0200 Subject: [PATCH] fixed the loading issue --- .../fr/moribus/imageonmap/image/MapInitEvent.java | 12 ++++++++---- .../fr/moribus/imageonmap/ui/SplatterMapManager.java | 3 ++- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main/java/fr/moribus/imageonmap/image/MapInitEvent.java b/src/main/java/fr/moribus/imageonmap/image/MapInitEvent.java index 8bb0d66..ad3e9b2 100644 --- a/src/main/java/fr/moribus/imageonmap/image/MapInitEvent.java +++ b/src/main/java/fr/moribus/imageonmap/image/MapInitEvent.java @@ -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 diff --git a/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java b/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java index 3efc07c..14f717a 100644 --- a/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java +++ b/src/main/java/fr/moribus/imageonmap/ui/SplatterMapManager.java @@ -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() { }