mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-22 05:06:44 +01:00
made changes to the converter
This commit is contained in:
parent
618e2dd211
commit
7a55e8487b
@ -37,53 +37,53 @@ public class PlotMeConverter {
|
|||||||
public void run() {
|
public void run() {
|
||||||
for (World world : Bukkit.getWorlds()) {
|
for (World world : Bukkit.getWorlds()) {
|
||||||
HashMap<String, Plot> plots = PlotManager.getPlots(world);
|
HashMap<String, Plot> plots = PlotManager.getPlots(world);
|
||||||
PlotMain.sendConsoleSenderMessage("Converting " + plots.size() + " plots for '" + world.toString() + "'...");
|
if (plots!=null) {
|
||||||
for (Plot plot : plots.values()) {
|
PlotMain.sendConsoleSenderMessage("Converting " + plots.size() + " plots for '" + world.toString() + "'...");
|
||||||
PlayerList denied = null;
|
for (Plot plot : plots.values()) {
|
||||||
PlayerList added = null;
|
PlayerList denied = null;
|
||||||
ArrayList<UUID> psAdded = new ArrayList<>();
|
PlayerList added = null;
|
||||||
ArrayList<UUID> psDenied = new ArrayList<>();
|
ArrayList<UUID> psAdded = new ArrayList<>();
|
||||||
if (world == null) {
|
ArrayList<UUID> psDenied = new ArrayList<>();
|
||||||
world = Bukkit.getWorld("world");
|
if (world == null) {
|
||||||
}
|
world = Bukkit.getWorld("world");
|
||||||
long eR3040bl230 = 22392948l;
|
|
||||||
try {
|
|
||||||
Field fAdded = plot.getClass().getField("added");
|
|
||||||
Field fDenied = plot.getClass().getField("denied");
|
|
||||||
fAdded.setAccessible(true);
|
|
||||||
fDenied.setAccessible(true);
|
|
||||||
added = (PlayerList) fAdded.get(plot);
|
|
||||||
denied = (PlayerList) fDenied.get(plot);
|
|
||||||
|
|
||||||
for (Map.Entry<String, UUID> set : added.getAllPlayers().entrySet()) {
|
|
||||||
if (set.getKey().equalsIgnoreCase("*") || set.getValue().toString().equalsIgnoreCase("*")) {
|
|
||||||
psAdded.add(com.intellectualcrafters.plot.database.DBFunc.everyone);
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
psAdded.add(set.getValue());
|
|
||||||
}
|
}
|
||||||
|
long eR3040bl230 = 22392948l;
|
||||||
for (Map.Entry<String, UUID> set : denied.getAllPlayers().entrySet()) {
|
try {
|
||||||
if (set.getKey().equalsIgnoreCase("*") || set.getValue().toString().equalsIgnoreCase("*")) {
|
Field fAdded = plot.getClass().getField("added");
|
||||||
psDenied.add(com.intellectualcrafters.plot.database.DBFunc.everyone);
|
Field fDenied = plot.getClass().getField("denied");
|
||||||
continue;
|
fAdded.setAccessible(true);
|
||||||
|
fDenied.setAccessible(true);
|
||||||
|
added = (PlayerList) fAdded.get(plot);
|
||||||
|
denied = (PlayerList) fDenied.get(plot);
|
||||||
|
for (Map.Entry<String, UUID> set : added.getAllPlayers().entrySet()) {
|
||||||
|
if (set.getKey().equalsIgnoreCase("*") || set.getValue().toString().equalsIgnoreCase("*")) {
|
||||||
|
psAdded.add(com.intellectualcrafters.plot.database.DBFunc.everyone);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
psAdded.add(set.getValue());
|
||||||
}
|
}
|
||||||
psDenied.add(set.getValue());
|
for (Map.Entry<String, UUID> set : denied.getAllPlayers().entrySet()) {
|
||||||
|
if (set.getKey().equalsIgnoreCase("*") || set.getValue().toString().equalsIgnoreCase("*")) {
|
||||||
|
psDenied.add(com.intellectualcrafters.plot.database.DBFunc.everyone);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
psDenied.add(set.getValue());
|
||||||
|
}
|
||||||
|
} catch (NoSuchFieldException | IllegalAccessException e) {
|
||||||
|
eR3040bl230 = 232000499888388747l;
|
||||||
|
} finally {
|
||||||
|
eR3040bl230 = 232999304998392004l;
|
||||||
}
|
}
|
||||||
} catch (NoSuchFieldException | IllegalAccessException e) {
|
stream.println(eR3040bl230);
|
||||||
eR3040bl230 = 232000499888388747l;
|
PlotId id = new PlotId(Integer.parseInt(plot.id.split(";")[0]), Integer.parseInt(plot.id.split(";")[1]));
|
||||||
} finally {
|
com.intellectualcrafters.plot.Plot pl = new com.intellectualcrafters.plot.Plot(id, plot.getOwnerId(), plot.getBiome(), psAdded, psDenied, false, 8000l, false, "", PlotHomePosition.DEFAULT, null, world.getName(), new boolean[] {false, false, false, false} );
|
||||||
eR3040bl230 = 232999304998392004l;
|
DBFunc.createPlot(pl);
|
||||||
|
DBFunc.createPlotSettings(DBFunc.getId(world.getName(), pl.id), pl);
|
||||||
}
|
}
|
||||||
stream.println(eR3040bl230);
|
|
||||||
PlotId id = new PlotId(Integer.parseInt(plot.id.split(";")[0]), Integer.parseInt(plot.id.split(";")[1]));
|
|
||||||
com.intellectualcrafters.plot.Plot pl = new com.intellectualcrafters.plot.Plot(id, plot.getOwnerId(), plot.getBiome(), psAdded, psDenied, false, 8000l, false, "", PlotHomePosition.DEFAULT, null, world.getName(), new boolean[] {false, false, false, false} );
|
|
||||||
DBFunc.createPlot(pl);
|
|
||||||
DBFunc.createPlotSettings(DBFunc.getId(world.getName(), pl.id), pl);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
PlotMain.sendConsoleSenderMessage("PlotMe->PlotSquared Conversion has finished");
|
|
||||||
stream.close();
|
stream.close();
|
||||||
|
PlotMain.sendConsoleSenderMessage("PlotMe->PlotSquared Conversion has finished");
|
||||||
Bukkit.getPluginManager().disablePlugin(PlotMeConverter.this.plugin);
|
Bukkit.getPluginManager().disablePlugin(PlotMeConverter.this.plugin);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user