Fix world delete

This commit is contained in:
Jesse Boyd 2017-04-01 04:36:15 +11:00
parent e8672df760
commit 3f54ba23c2
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F
4 changed files with 37 additions and 19 deletions

View File

@ -799,17 +799,7 @@ public class Plot {
manager.clearPlot(Plot.this.area, current, this); manager.clearPlot(Plot.this.area, current, this);
} }
}; };
if (!isMerged() && this.area.getRegion().equals(getLargestRegion())) { run.run();
final LocalBlockQueue blockQueue = area.getQueue(false);
ChunkManager.largeRegionTask(this.getWorldName(), this.area.getRegion(), new RunnableVal<ChunkLoc>() {
@Override
public void run(ChunkLoc value) {
blockQueue.regenChunk(value.x, value.z);
}
}, whenDone);
} else {
run.run();
}
return true; return true;
} }

View File

@ -6,6 +6,7 @@ import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotArea; import com.intellectualcrafters.plot.object.PlotArea;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer; import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import java.util.Collection; import java.util.Collection;
import java.util.HashSet; import java.util.HashSet;
import java.util.UUID; import java.util.UUID;
@ -47,5 +48,16 @@ public class SinglePlot extends Plot {
getArea().loadWorld(getId()); getArea().loadWorld(getId());
return super.isLoaded(); return super.isLoaded();
} }
private HashSet<RegionWrapper> regions;
{
regions = new HashSet<>();
regions.add(new RegionWrapper(Integer.MIN_VALUE, Integer.MAX_VALUE, Integer.MIN_VALUE, Integer.MAX_VALUE));
}
@Override
public HashSet<RegionWrapper> getRegions() {
return regions;
}
// getCenter getSide getHome getDefaultHome getBiome // getCenter getSide getHome getDefaultHome getBiome
} }

View File

@ -8,7 +8,6 @@ import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot; import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId; import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc; import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotSettings; import com.intellectualcrafters.plot.object.PlotSettings;
import com.intellectualcrafters.plot.object.SetupObject; import com.intellectualcrafters.plot.object.SetupObject;
import com.intellectualcrafters.plot.util.SetupUtils; import com.intellectualcrafters.plot.util.SetupUtils;
@ -87,14 +86,31 @@ public class SinglePlotArea extends GridPlotWorld {
return getPlotAbs(pid); return getPlotAbs(pid);
} }
public boolean addPlot(Plot p) { public boolean addPlot(Plot plot) {
plot = adapt(plot);
return super.addPlot(plot);
}
@Override
public boolean addPlotAbs(Plot plot) {
plot = adapt(plot);
return super.addPlotAbs(plot);
}
@Override
public boolean addPlotIfAbsent(Plot plot) {
plot = adapt(plot);
return super.addPlotIfAbsent(plot);
}
private Plot adapt(Plot p) {
if (p instanceof SinglePlot) {
return p;
}
PlotSettings s = p.getSettings(); PlotSettings s = p.getSettings();
p = new SinglePlot(p.getId(), p.owner, p.getTrusted(), p.getMembers(), p.getDenied(), s.alias, s.getPosition(), null, this, s.merged, p.getTimestamp(), p.temp); p = new SinglePlot(p.getId(), p.owner, p.getTrusted(), p.getMembers(), p.getDenied(), s.alias, s.getPosition(), null, this, s.merged, p.getTimestamp(), p.temp);
p.getSettings().flags = s.flags; s.flags = s.flags;
for (PlotPlayer pp : p.getPlayersInPlot()) { return p;
pp.setMeta("lastplot", p);
}
return this.plots.put(p.getId(), p) == null;
} }
public Plot getPlotAbs(PlotId id) { public Plot getPlotAbs(PlotId id) {

View File

@ -1,3 +1,3 @@
rootProject.name = 'PlotSquared' rootProject.name = 'PlotSquared'
include 'Core', 'Bukkit', 'Sponge', 'Nukkit' include 'Core', 'Bukkit', 'Nukkit' //,'Sponge'