use equals

This commit is contained in:
boy0001 2015-03-24 01:27:42 +11:00
parent 49f8ffaed4
commit 844afb0183

View File

@ -94,7 +94,18 @@ public abstract class PlotWorld {
this.worldname = worldname; this.worldname = worldname;
} }
public boolean compare(PlotWorld plotworld) { @Override
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
if (obj == null) {
return false;
}
if (getClass() != obj.getClass()) {
return false;
}
PlotWorld plotworld = (PlotWorld) obj;
ConfigurationSection section = PlotSquared.config.getConfigurationSection("worlds"); ConfigurationSection section = PlotSquared.config.getConfigurationSection("worlds");
for (ConfigurationNode setting : plotworld.getSettingNodes()) { for (ConfigurationNode setting : plotworld.getSettingNodes()) {
Object constant = section.get(plotworld.worldname + "." + setting.getConstant()); Object constant = section.get(plotworld.worldname + "." + setting.getConstant());