Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/fromgate/obscura/COAlbum.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,9 @@ public short createMap (BufferedImage image, boolean reusedeleted, String name,
if ((!reusedeleted)||deletedmaps.isEmpty()||(deletedmaps.size()==0)) return createNewMap (image);
short id = deletedmaps.get(0);
deletedmaps.remove(0);
return updateMap (id, image);
// don't use reserved map ids - servers can set map ids in the config
if (plg.reserved_maps.contains(id)) return createNewMap(image);
return updateMap (id, image);
}

public boolean isObscuraMap (short id){
Expand Down
2 changes: 2 additions & 0 deletions src/fromgate/obscura/COCamera.java
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,8 @@ public static void updateMapName (ItemStack item){
if ((item==null)||(item.getType()!=Material.MAP)) return;
short id = item.getDurability();
String name_album = plg().album.getPictureName(id);
// don't rename the item as the map may be used by another plugin
if (name_album.isEmpty()) return;
String name_item = getName (item);
if (!name_album.equals(name_item)) setName (item, name_album);
}
Expand Down
4 changes: 4 additions & 0 deletions src/fromgate/obscura/Obscura.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@

import java.io.File;
import java.io.IOException;
import java.util.Arrays;
import java.util.List;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.plugin.PluginManager;
import org.bukkit.plugin.java.JavaPlugin;
Expand Down Expand Up @@ -137,6 +139,7 @@ public class Obscura extends JavaPlugin {
boolean stroke = true;
String name_color = "#000000";
String stroke_color = "#FFFFFF";
List<Short> reserved_maps = Arrays.asList((short)1963, (short)1964);;
int name_x = 1;
int name_y = 122;

Expand Down Expand Up @@ -262,6 +265,7 @@ public void loadCfg(){
name_color = getConfig().getString("picture-name.font-color","#000000");
stroke =getConfig().getBoolean("picture-name.stroke",true);
stroke_color = getConfig().getString("picture-name.stroke-color","#FFFFFF");
reserved_maps = getConfig().getShortList("reserved-maps");
}

}