mirror of
https://github.com/zDevelopers/ImageOnMap.git
synced 2025-04-10 05:55:42 +02:00
* BUG: Fix splatter maps not initializing their maps properly.
This commit is contained in:
parent
02bf05823f
commit
5027f5bf71
@ -28,8 +28,10 @@ import org.bukkit.entity.Entity;
|
||||
import org.bukkit.entity.ItemFrame;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.inventory.InventoryClickEvent;
|
||||
import org.bukkit.event.player.PlayerInteractEntityEvent;
|
||||
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||
import org.bukkit.event.player.PlayerPickupItemEvent;
|
||||
import org.bukkit.event.world.ChunkLoadEvent;
|
||||
@ -95,16 +97,20 @@ public class MapInitEvent implements Listener
|
||||
}
|
||||
}
|
||||
|
||||
static protected void initMap(ItemStack item)
|
||||
static public void initMap(ItemStack item)
|
||||
{
|
||||
if (item != null && item.getType() == Material.MAP)
|
||||
{
|
||||
MapView map = Bukkit.getMap(item.getDurability());
|
||||
initMap(map);
|
||||
initMap(item.getDurability());
|
||||
}
|
||||
}
|
||||
|
||||
static protected void initMap(MapView map)
|
||||
static public void initMap(short id)
|
||||
{
|
||||
initMap(Bukkit.getMap(id));
|
||||
}
|
||||
|
||||
static public void initMap(MapView map)
|
||||
{
|
||||
if(map == null) return;
|
||||
if(Renderer.isHandled(map)) return;
|
||||
|
@ -18,6 +18,7 @@
|
||||
|
||||
package fr.moribus.imageonmap.ui;
|
||||
|
||||
import fr.moribus.imageonmap.image.MapInitEvent;
|
||||
import fr.moribus.imageonmap.map.ImageMap;
|
||||
import fr.moribus.imageonmap.map.MapManager;
|
||||
import fr.moribus.imageonmap.map.PosterMap;
|
||||
@ -105,7 +106,9 @@ abstract public class SplatterMapManager
|
||||
int i = 0;
|
||||
for(ItemFrame frame : wall.frames)
|
||||
{
|
||||
frame.setItem(new ItemStack(Material.MAP, 1, poster.getMapIdAtReverseY(i)));
|
||||
short id = poster.getMapIdAtReverseY(i);
|
||||
frame.setItem(new ItemStack(Material.MAP, 1, id));
|
||||
MapInitEvent.initMap(id);
|
||||
++i;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user