55import java .util .Collections ;
66import java .util .Comparator ;
77import java .util .HashMap ;
8- import java .util .Iterator ;
98import java .util .List ;
109import java .util .Map ;
1110import java .util .Set ;
1211import java .util .UUID ;
13- import java .util .concurrent .atomic .AtomicInteger ;
1412
13+ import org .apache .commons .lang .StringEscapeUtils ;
1514import org .apache .commons .lang .StringUtils ;
1615import org .bukkit .World ;
1716import org .bukkit .configuration .ConfigurationSection ;
@@ -110,11 +109,11 @@ public void run() {
110109 private String formatInfoWindow (final PlotWrapper plot ) {
111110 String v = "<div class=\" plotinfo\" >" + this .infowindow + "</div>" ;
112111 v = v .replace ("%id%" , plot .id .x + "," + plot .id .y );
113- v = v .replace ("%alias%" , this .infoelement .replace ("%values%" , plot .alias ).replace ("%key%" , "Alias" ));
112+ v = v .replace ("%alias%" , this .infoelement .replace ("%values%" , StringEscapeUtils . escapeHtml ( plot .alias ) ).replace ("%key%" , "Alias" ));
114113 v = v .replace ("%owner%" , this .infoelement .replace ("%values%" , plot .owner ).replace ("%key%" , "Owner" ));
115114 v = v .replace ("%members%" , this .infoelement .replace ("%values%" , plot .helpers ).replace ("%key%" , "Members" ));
116115 v = v .replace ("%trusted%" , this .infoelement .replace ("%values%" , plot .trusted ).replace ("%key%" , "Trusted" ));
117- v = v .replace ("%flags%" , this .infoelement .replace ("%values%" , plot .flags ).replace ("%key%" , "Flags" ));
116+ v = v .replace ("%flags%" , this .infoelement .replace ("%values%" , StringEscapeUtils . escapeHtml ( plot .flags ) ).replace ("%key%" , "Flags" ));
118117 v = v .replace ("%owner%" , plot .owner );
119118 return v ;
120119 }
@@ -174,7 +173,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
174173 double [] z = null ;
175174
176175 final String id = name ;
177-
176+ int i = 0 ;
178177 for (RegionWrapper region : MainUtil .getRegions (MainUtil .getPlot (world .getName (), plot .id ))) {
179178
180179 x = new double [4 ];
@@ -188,7 +187,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
188187 x [3 ] = region .maxX ;
189188 z [3 ] = region .minZ ;
190189
191- final String markerid = world .getName () + "_" + id ;
190+ final String markerid = world .getName () + "_" + id + ( i == 0 ? "" : "-" + i ) ;
192191 AreaMarker m = this .resareas .remove (markerid ); /* Existing area? */
193192 if (m == null ) {
194193 m = set .createAreaMarker (markerid , name , false , world .getName (), x , z , false );
@@ -207,6 +206,7 @@ private void handlePlot(final World world, final PlotWrapper plot, final Map<Str
207206 m .setDescription (desc ); /* Set popup */
208207
209208 newmap .put (markerid , m );
209+ i ++;
210210 }
211211 }
212212
0 commit comments