From 49f8ffaed4e147f71a2130a6c74a259a10cfe118 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Tue, 24 Mar 2015 01:16:33 +1100 Subject: [PATCH] World comparisons (working towards cross world plot moving) --- .../plot/object/PlotWorld.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java index 9af2659b9..345292238 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/object/PlotWorld.java @@ -93,6 +93,20 @@ public abstract class PlotWorld { public PlotWorld(final String worldname) { this.worldname = worldname; } + + public boolean compare(PlotWorld plotworld) { + ConfigurationSection section = PlotSquared.config.getConfigurationSection("worlds"); + for (ConfigurationNode setting : plotworld.getSettingNodes()) { + Object constant = section.get(plotworld.worldname + "." + setting.getConstant()); + if (constant == null) { + return false; + } + if (!constant.equals(section.get(this.worldname + "." + setting.getConstant()))) { + return false; + } + } + return true; + } /** * When a world is created, the following method will be called for each