Add support for 1.7.5 beta

This commit is contained in:
Mike Primm 2012-06-19 05:45:48 +02:00
parent 1ff679e5d7
commit a22151d528
3 changed files with 13 additions and 6 deletions

Binary file not shown.

View File

@ -68,7 +68,7 @@
<dependency>
<groupId>com.massivecraft</groupId>
<artifactId>Factions</artifactId>
<version>1.6.7</version>
<version>1.7.3</version>
<scope>system</scope>
<systemPath>${project.basedir}/Factions.jar</systemPath>
</dependency>

View File

@ -33,6 +33,7 @@ import com.massivecraft.factions.FPlayer;
import com.massivecraft.factions.Factions;
import com.massivecraft.factions.Board;
import com.massivecraft.factions.Faction;
import com.massivecraft.factions.struct.TerritoryAccess;
public class DynmapFactionsPlugin extends JavaPlugin {
private static final Logger log = Logger.getLogger("Minecraft");
@ -379,15 +380,21 @@ public class DynmapFactionsPlugin extends JavaPlugin {
/* Get board in save format - not good, but best option for traversing the data
* Map by world, with Map by coordinate pair ("x,z") with value of faction ID */
Map<String, Map<String, String>> mapdata = Board.dumpAsSaveFormat();
Map<String, Map<String, TerritoryAccess>> mapdata = Board.dumpAsSaveFormat();
/* Parse into faction centric mapping, split by world */
Map<String, FactionBlocks> blocks_by_faction = new HashMap<String, FactionBlocks>();
for(Map.Entry<String, Map<String,String>> me : mapdata.entrySet()) {
for(Map.Entry<String, Map<String,TerritoryAccess>> me : mapdata.entrySet()) {
String world = me.getKey();
for(Map.Entry<String,String> be : me.getValue().entrySet()) {
for(Map.Entry<String,TerritoryAccess> be : me.getValue().entrySet()) {
String coord = be.getKey();
String fact = be.getValue();
Object ta = be.getValue();
String fact;
if(ta instanceof String) {
fact = (String)ta;
}
else {
fact = ((TerritoryAccess)ta).getHostFactionID();
}
FactionBlocks factblocks = blocks_by_faction.get(fact); /* Look up faction */
if(factblocks == null) { /* Create faction block if first time */
factblocks = new FactionBlocks();