mirror of
https://github.com/zDevelopers/ImageOnMap.git
synced 2025-01-10 09:48:02 +01:00
Maps are now loaded only when they will be displayed
This commit is contained in:
parent
ebafa23827
commit
12e55030fb
@ -20,27 +20,44 @@ public final class ImageOnMap extends JavaPlugin
|
|||||||
boolean dossierCree;
|
boolean dossierCree;
|
||||||
private FileConfiguration customConfig = null;
|
private FileConfiguration customConfig = null;
|
||||||
private File customConfigFile = null;
|
private File customConfigFile = null;
|
||||||
// liste contenant les maps ne pouvant être placé dans l'inventaire du joueur. Je le fous ici afin que ce soit
|
/* liste contenant les maps ne pouvant être placé dans l'inventaire du joueur. Je le fous ici afin que ce soit
|
||||||
// accessible de partout dans le plugin..
|
accessible de partout dans le plugin.. */
|
||||||
private HashMap<String, ArrayList<ItemStack>> cache = new HashMap<String, ArrayList<ItemStack>>();
|
private HashMap<String, ArrayList<ItemStack>> cache = new HashMap<String, ArrayList<ItemStack>>();
|
||||||
|
|
||||||
|
// Index des maps chargées sur le serveur
|
||||||
|
public ArrayList<Short> mapChargee = new ArrayList<Short>();
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onLoad()
|
public void onLoad()
|
||||||
{
|
{
|
||||||
|
/*MapASuppr = (ArrayList<String>) getConfig().getStringList("delete");
|
||||||
|
if(getConfig().get("map_path") != null && !MapASuppr.isEmpty())
|
||||||
|
{
|
||||||
|
for(int i = 0; i < MapASuppr.size(); i++)
|
||||||
|
{
|
||||||
|
File map = new File(getDataFolder()+ "/../../"+ getConfig().getString("map_path")+ "/data/map_"+ MapASuppr.get(i)+ ".dat");
|
||||||
|
boolean deleted = map.delete();
|
||||||
|
if(!deleted)
|
||||||
|
getLogger().info("Could not delete map_"+ MapASuppr.get(i)+ ".dat on world folder " +getConfig().getString("map_path"));
|
||||||
|
}
|
||||||
|
getConfig().set("delete", null);
|
||||||
|
saveConfig();
|
||||||
|
}*/
|
||||||
|
|
||||||
//File map = new File("/home/moribus/Projet/Serveur de dev/world/data/map_1125.dat");
|
|
||||||
//map.delete();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onEnable()
|
public void onEnable()
|
||||||
{
|
{
|
||||||
getLogger().info("World name: "+ getServer().getWorlds().get(0).getName());
|
|
||||||
// On crée si besoin le dossier où les images seront stockées
|
// On crée si besoin le dossier où les images seront stockées
|
||||||
dossierCree = ImgUtility.CreeRepImg(this);
|
dossierCree = ImgUtility.CreeRepImg(this);
|
||||||
|
|
||||||
// On ajoute si besoin les params par défaut du plugin
|
// On ajoute si besoin les params par défaut du plugin
|
||||||
ImgUtility.CreeSectionConfig(this);
|
ImgUtility.CreeSectionConfig(this);
|
||||||
|
if(getConfig().get("map_path") == null)
|
||||||
|
getConfig().set("map_path", getServer().getWorlds().get(0).getName());
|
||||||
|
else if(getConfig().get("map_path") != getServer().getWorlds().get(0).getName())
|
||||||
|
getConfig().set("map_path", getServer().getWorlds().get(0).getName());
|
||||||
|
|
||||||
if(getConfig().getBoolean("import-maps"))
|
if(getConfig().getBoolean("import-maps"))
|
||||||
ImgUtility.ImporterConfig(this);
|
ImgUtility.ImporterConfig(this);
|
||||||
@ -61,8 +78,10 @@ public final class ImageOnMap extends JavaPlugin
|
|||||||
{
|
{
|
||||||
getCommand("tomap").setExecutor(new ImageRenduCommande(this));
|
getCommand("tomap").setExecutor(new ImageRenduCommande(this));
|
||||||
getCommand("maptool").setExecutor(new MapToolCommand(this));
|
getCommand("maptool").setExecutor(new MapToolCommand(this));
|
||||||
|
getServer().getPluginManager().registerEvents(new SendMapOnFrameEvent(this), this);
|
||||||
|
getServer().getPluginManager().registerEvents(new SendMapOnInvEvent(this), this);
|
||||||
this.saveDefaultConfig();
|
this.saveDefaultConfig();
|
||||||
ChargerMap();
|
//ChargerMap();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -13,7 +13,7 @@ public class ImageRenduCommande implements CommandExecutor
|
|||||||
Player joueur;
|
Player joueur;
|
||||||
boolean renderName, imgSvg;
|
boolean renderName, imgSvg;
|
||||||
ImageOnMap plugin;
|
ImageOnMap plugin;
|
||||||
boolean resize;
|
boolean resize, rename;
|
||||||
|
|
||||||
public ImageRenduCommande(ImageOnMap p)
|
public ImageRenduCommande(ImageOnMap p)
|
||||||
{
|
{
|
||||||
@ -30,6 +30,7 @@ public class ImageRenduCommande implements CommandExecutor
|
|||||||
|
|
||||||
joueur = (Player) sender;
|
joueur = (Player) sender;
|
||||||
resize = false;
|
resize = false;
|
||||||
|
rename = true;
|
||||||
|
|
||||||
if(joueur.hasPermission("imageonmap.userender"))
|
if(joueur.hasPermission("imageonmap.userender"))
|
||||||
{
|
{
|
||||||
@ -55,13 +56,19 @@ public class ImageRenduCommande implements CommandExecutor
|
|||||||
return true;
|
return true;
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
if(arg3.length >= 2 && arg3[1].equalsIgnoreCase("resize"))
|
if(arg3.length >= 2)
|
||||||
{
|
{
|
||||||
|
for(int i = 1; i < arg3.length; i++)
|
||||||
|
{
|
||||||
|
if(arg3[i].equalsIgnoreCase("resize:true"))
|
||||||
resize = true;
|
resize = true;
|
||||||
|
if(arg3[i].equalsIgnoreCase("rename:false"))
|
||||||
|
rename = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TacheTraitementMap tache = new TacheTraitementMap(joueur, arg3[0], plugin, resize);
|
TacheTraitementMap tache = new TacheTraitementMap(joueur, arg3[0], plugin, resize, rename);
|
||||||
tache.runTaskTimer(plugin, 0, 10);
|
tache.runTaskTimer(plugin, 0, 10);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -169,7 +169,6 @@ public class ImgUtility
|
|||||||
MapView carte = Bukkit.getMap(id);
|
MapView carte = Bukkit.getMap(id);
|
||||||
|
|
||||||
Set<String> cle = plugin.getCustomConfig().getKeys(false);
|
Set<String> cle = plugin.getCustomConfig().getKeys(false);
|
||||||
plugin.getLogger().info("POINT 2");
|
|
||||||
for (String s: cle)
|
for (String s: cle)
|
||||||
{
|
{
|
||||||
if(plugin.getCustomConfig().getStringList(s).size() >= 3)
|
if(plugin.getCustomConfig().getStringList(s).size() >= 3)
|
||||||
@ -196,8 +195,15 @@ public class ImgUtility
|
|||||||
{
|
{
|
||||||
//joueur.sendMessage("Suppression de la map dans fichier conf + fichier dat");
|
//joueur.sendMessage("Suppression de la map dans fichier conf + fichier dat");
|
||||||
ImageRendererThread.SupprRendu(carte);
|
ImageRendererThread.SupprRendu(carte);
|
||||||
|
/*if(plugin.getConfig().get("delete") != null);
|
||||||
|
{
|
||||||
|
ArrayList<String> ListeSuppr = (ArrayList<String>) plugin.getConfig().getStringList("delete");
|
||||||
|
ListeSuppr.add(plugin.getCustomConfig().getStringList(s).get(0));
|
||||||
|
plugin.getConfig().set("delete", ListeSuppr);
|
||||||
|
}*/
|
||||||
plugin.getCustomConfig().set(s, null);
|
plugin.getCustomConfig().set(s, null);
|
||||||
plugin.saveCustomConfig();
|
plugin.saveCustomConfig();
|
||||||
|
plugin.saveConfig();
|
||||||
File map = new File("./plugins/ImageOnMap/Image/" + s + ".png");
|
File map = new File("./plugins/ImageOnMap/Image/" + s + ".png");
|
||||||
boolean isDeleted = map.delete();
|
boolean isDeleted = map.delete();
|
||||||
//joueur.sendMessage("DEBUG: booléen isDeleted :"+ isDeleted+ "; Nom de la map : "+ plugin.getServer().getWorlds().get(0).getName());
|
//joueur.sendMessage("DEBUG: booléen isDeleted :"+ isDeleted+ "; Nom de la map : "+ plugin.getServer().getWorlds().get(0).getName());
|
||||||
|
@ -69,6 +69,7 @@ public class MapToolCommand implements CommandExecutor
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if(inv.firstEmpty() == -1)
|
if(inv.firstEmpty() == -1)
|
||||||
{
|
{
|
||||||
joueur.sendMessage("Your inventory is full, you can't take the map !");
|
joueur.sendMessage("Your inventory is full, you can't take the map !");
|
||||||
@ -90,6 +91,19 @@ public class MapToolCommand implements CommandExecutor
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(arg3.length <= 1)
|
||||||
|
{
|
||||||
|
if(joueur.getItemInHand().getType() == Material.MAP)
|
||||||
|
{
|
||||||
|
id = joueur.getItemInHand().getDurability();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
joueur.sendMessage(ChatColor.RED+ "You must hold a map or enter an id");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
id = Short.parseShort(arg3[1]);
|
id = Short.parseShort(arg3[1]);
|
||||||
@ -99,6 +113,7 @@ public class MapToolCommand implements CommandExecutor
|
|||||||
joueur.sendMessage("you must enter a number !");
|
joueur.sendMessage("you must enter a number !");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
boolean success = ImgUtility.RemoveMap(plugin, id);
|
boolean success = ImgUtility.RemoveMap(plugin, id);
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ public class SavedMap
|
|||||||
String nomImg, nomJoueur, nomMonde;
|
String nomImg, nomJoueur, nomMonde;
|
||||||
short idMap;
|
short idMap;
|
||||||
BufferedImage image;
|
BufferedImage image;
|
||||||
|
boolean loaded = false;
|
||||||
|
|
||||||
SavedMap(ImageOnMap plug, String nomJ, short id, BufferedImage img, String nomM)
|
SavedMap(ImageOnMap plug, String nomJ, short id, BufferedImage img, String nomM)
|
||||||
{
|
{
|
||||||
@ -27,6 +28,7 @@ public class SavedMap
|
|||||||
image = img;
|
image = img;
|
||||||
nomImg = "map" + id;
|
nomImg = "map" + id;
|
||||||
nomMonde = nomM;
|
nomMonde = nomM;
|
||||||
|
loaded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
SavedMap(ImageOnMap plug, short id)
|
SavedMap(ImageOnMap plug, short id)
|
||||||
@ -34,27 +36,27 @@ public class SavedMap
|
|||||||
idMap = id;
|
idMap = id;
|
||||||
plugin = plug;
|
plugin = plug;
|
||||||
Set<String> cle = plugin.getCustomConfig().getKeys(false);
|
Set<String> cle = plugin.getCustomConfig().getKeys(false);
|
||||||
int tmp = 0;
|
|
||||||
for (String s: cle)
|
for (String s: cle)
|
||||||
{
|
{
|
||||||
if(plugin.getCustomConfig().getStringList(s).size() >= 3 && Short.valueOf(plugin.getCustomConfig().getStringList(s).get(0)) == id)
|
if(plugin.getCustomConfig().getStringList(s).size() >= 3 && Short.valueOf(plugin.getCustomConfig().getStringList(s).get(0)) == id)
|
||||||
{
|
{
|
||||||
tmp++;
|
|
||||||
//System.out.println(tmp);
|
//System.out.println(tmp);
|
||||||
//MapView carte = Bukkit.getMap(Short.parseShort(plugin.getConfig().getStringList(s).get(0)));
|
//MapView carte = Bukkit.getMap(Short.parseShort(plugin.getConfig().getStringList(s).get(0)));
|
||||||
nomImg = plugin.getCustomConfig().getStringList(s).get(1);
|
nomImg = plugin.getCustomConfig().getStringList(s).get(1);
|
||||||
nomJoueur = plugin.getCustomConfig().getStringList(s).get(2);
|
nomJoueur = plugin.getCustomConfig().getStringList(s).get(2);
|
||||||
try {
|
try {
|
||||||
image = ImageIO.read(new File("./plugins/ImageOnMap/Image/"+ nomImg + ".png"));
|
image = ImageIO.read(new File("./plugins/ImageOnMap/Image/"+ nomImg + ".png"));
|
||||||
|
loaded = true;
|
||||||
//System.out.println("Chargement de l'image fini");
|
//System.out.println("Chargement de l'image fini");
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
System.out.println("Image "+ nomImg +".png doesn't exists in Image directory.");
|
System.out.println("Image "+ nomImg +".png doesn't exists in Image directory.");
|
||||||
}
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(tmp == 0)
|
if(!loaded)
|
||||||
{
|
{
|
||||||
System.out.println("No map was loaded");
|
plugin.getLogger().info("No map was loaded");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -87,10 +89,12 @@ public class SavedMap
|
|||||||
Boolean LoadMap()
|
Boolean LoadMap()
|
||||||
{
|
{
|
||||||
MapView carte = Bukkit.getMap(idMap);
|
MapView carte = Bukkit.getMap(idMap);
|
||||||
if(carte != null)
|
if(carte != null && loaded)
|
||||||
{
|
{
|
||||||
ImageRendererThread.SupprRendu(carte);
|
ImageRendererThread.SupprRendu(carte);
|
||||||
carte.addRenderer(new Rendu(image));
|
carte.addRenderer(new Rendu(image));
|
||||||
|
if(!plugin.mapChargee.contains(idMap))
|
||||||
|
plugin.mapChargee.add(idMap);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
57
src/fr/moribus/ImageOnMap/SendMapOnFrameEvent.java
Normal file
57
src/fr/moribus/ImageOnMap/SendMapOnFrameEvent.java
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
package fr.moribus.ImageOnMap;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
|
import org.bukkit.Chunk;
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Entity;
|
||||||
|
import org.bukkit.entity.ItemFrame;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.world.ChunkLoadEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
public class SendMapOnFrameEvent implements Listener
|
||||||
|
{
|
||||||
|
ImageOnMap plugin;
|
||||||
|
Chunk chunk;
|
||||||
|
Entity[] entites;
|
||||||
|
ItemFrame frame;
|
||||||
|
|
||||||
|
SendMapOnFrameEvent(ImageOnMap plug)
|
||||||
|
{
|
||||||
|
plugin = plug;
|
||||||
|
plugin.getLogger().info("Loading event");
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onChunkLoad(ChunkLoadEvent event)
|
||||||
|
{
|
||||||
|
chunk = event.getChunk();
|
||||||
|
//plugin.getLogger().info("Loading entities..");
|
||||||
|
entites = chunk.getEntities().clone();
|
||||||
|
for(int i = 0; i < entites.length; i++)
|
||||||
|
{
|
||||||
|
Entity entite = entites[i];
|
||||||
|
//plugin.getLogger().info("entrée dans la boucle");
|
||||||
|
if(entite instanceof ItemFrame)
|
||||||
|
{
|
||||||
|
ArrayList<Short> ListeId = plugin.mapChargee;
|
||||||
|
//plugin.getLogger().info("entrée dans la condition");
|
||||||
|
frame = (ItemFrame) entite;
|
||||||
|
ItemStack stack = frame.getItem();
|
||||||
|
if(stack.getType() == Material.MAP && !ListeId.contains(stack.getDurability()))
|
||||||
|
{
|
||||||
|
/* c'est dans la méthode LoadMap() qu'on vérifie si la map est bien
|
||||||
|
une map custom et non une map normale*/
|
||||||
|
SavedMap map = new SavedMap(plugin, stack.getDurability());
|
||||||
|
map.LoadMap();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
65
src/fr/moribus/ImageOnMap/SendMapOnInvEvent.java
Normal file
65
src/fr/moribus/ImageOnMap/SendMapOnInvEvent.java
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
package fr.moribus.ImageOnMap;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.logging.Level;
|
||||||
|
|
||||||
|
import org.bukkit.Material;
|
||||||
|
import org.bukkit.entity.Player;
|
||||||
|
import org.bukkit.event.EventHandler;
|
||||||
|
import org.bukkit.event.Listener;
|
||||||
|
import org.bukkit.event.player.PlayerItemHeldEvent;
|
||||||
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
|
|
||||||
|
public class SendMapOnInvEvent implements Listener
|
||||||
|
{
|
||||||
|
|
||||||
|
ImageOnMap plugin;
|
||||||
|
|
||||||
|
SendMapOnInvEvent(ImageOnMap p)
|
||||||
|
{
|
||||||
|
plugin = p;
|
||||||
|
}
|
||||||
|
|
||||||
|
@EventHandler
|
||||||
|
public void onPlayerInv(PlayerItemHeldEvent event)
|
||||||
|
{
|
||||||
|
Player joueur = event.getPlayer();
|
||||||
|
int slot = event.getNewSlot();
|
||||||
|
ItemStack stack = joueur.getInventory().getItem(slot);
|
||||||
|
|
||||||
|
if(stack != null && stack.getType() == Material.MAP)
|
||||||
|
{
|
||||||
|
|
||||||
|
ArrayList<Short> listeId = plugin.mapChargee;
|
||||||
|
Set<String> cle = plugin.getCustomConfig().getKeys(false);
|
||||||
|
for (String s: cle)
|
||||||
|
{
|
||||||
|
|
||||||
|
|
||||||
|
if(!listeId.contains(stack.getDurability()))
|
||||||
|
{
|
||||||
|
//plugin.getLogger().info("map"+ stack.getDurability()+ " dans la main du joueur en cours de recherche...");
|
||||||
|
if(plugin.getCustomConfig().getStringList(s).get(0).equals(String.valueOf(stack.getDurability())))
|
||||||
|
{
|
||||||
|
SavedMap map = new SavedMap(plugin, Short.valueOf(plugin.getCustomConfig().getStringList(s).get(0)));
|
||||||
|
|
||||||
|
if(!map.LoadMap())
|
||||||
|
plugin.getLogger().log(Level.WARNING, "Unable to load map " +stack.getDurability());
|
||||||
|
else
|
||||||
|
{
|
||||||
|
//plugin.getLogger().info("map"+ stack.getDurability()+ " chargée");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
@ -20,17 +20,18 @@ public class TacheTraitementMap extends BukkitRunnable
|
|||||||
PlayerInventory inv;
|
PlayerInventory inv;
|
||||||
ItemStack map;
|
ItemStack map;
|
||||||
ImageOnMap plugin;
|
ImageOnMap plugin;
|
||||||
boolean resized;
|
boolean resized, renamed;
|
||||||
|
|
||||||
TacheTraitementMap(Player j, String u, ImageOnMap plug, boolean r)
|
TacheTraitementMap(Player j, String u, ImageOnMap plug, boolean rs, boolean rn)
|
||||||
{
|
{
|
||||||
i = 0;
|
i = 0;
|
||||||
joueur = j;
|
joueur = j;
|
||||||
renduImg = new ImageRendererThread(u, r);
|
renduImg = new ImageRendererThread(u, rs);
|
||||||
renduImg.start();
|
renduImg.start();
|
||||||
inv = joueur.getInventory();
|
inv = joueur.getInventory();
|
||||||
plugin = plug;
|
plugin = plug;
|
||||||
resized = r;
|
resized = rs;
|
||||||
|
renamed = rn;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("deprecation")
|
@SuppressWarnings("deprecation")
|
||||||
@ -66,18 +67,23 @@ public class TacheTraitementMap extends BukkitRunnable
|
|||||||
ArrayList<ItemStack> restant = new ArrayList<ItemStack>();
|
ArrayList<ItemStack> restant = new ArrayList<ItemStack>();
|
||||||
for (int i = 0; i < nbImage; i++)
|
for (int i = 0; i < nbImage; i++)
|
||||||
{
|
{
|
||||||
|
if(nbImage == 1 && joueur.getItemInHand().getType() == Material.MAP)
|
||||||
|
carte = Bukkit.getMap(joueur.getItemInHand().getDurability());
|
||||||
|
else
|
||||||
carte = Bukkit.createMap(joueur.getWorld());
|
carte = Bukkit.createMap(joueur.getWorld());
|
||||||
ImageRendererThread.SupprRendu(carte);
|
ImageRendererThread.SupprRendu(carte);
|
||||||
carte.addRenderer(new Rendu(renduImg.getImg()[i]));
|
carte.addRenderer(new Rendu(renduImg.getImg()[i]));
|
||||||
map = new ItemStack(Material.MAP, 1, carte.getId());
|
map = new ItemStack(Material.MAP, 1, carte.getId());
|
||||||
if(!resized)
|
if(nbImage > 1 && renamed == true)
|
||||||
{
|
{
|
||||||
ItemMeta meta = map.getItemMeta();
|
ItemMeta meta = map.getItemMeta();
|
||||||
meta.setDisplayName("Map (" +renduImg.getNumeroMap().get(i) +")");
|
meta.setDisplayName("Map (" +renduImg.getNumeroMap().get(i) +")");
|
||||||
map.setItemMeta(meta);
|
map.setItemMeta(meta);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(nbImage == 1 && joueur.getItemInHand().getType() == Material.MAP)
|
||||||
|
joueur.setItemInHand(map);
|
||||||
|
else
|
||||||
ImgUtility.AddMap(map, inv, restant);
|
ImgUtility.AddMap(map, inv, restant);
|
||||||
|
|
||||||
//Svg de la map
|
//Svg de la map
|
||||||
@ -86,7 +92,7 @@ public class TacheTraitementMap extends BukkitRunnable
|
|||||||
joueur.sendMap(carte);
|
joueur.sendMap(carte);
|
||||||
}
|
}
|
||||||
if(!restant.isEmpty())
|
if(!restant.isEmpty())
|
||||||
joueur.sendMessage(restant.size()+ " maps can't be place in your inventory. Please make free space in your inventory and run "+ ChatColor.GOLD+ "/maptool rest");
|
joueur.sendMessage(restant.size()+ " maps can't be place in your inventory. Please make free space in your inventory and run "+ ChatColor.GOLD+ "/maptool getrest");
|
||||||
plugin.setRemainingMaps(joueur.getName(), restant);
|
plugin.setRemainingMaps(joueur.getName(), restant);
|
||||||
joueur.sendMessage("Render finished");
|
joueur.sendMessage("Render finished");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user