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);
}
};
if (!isMerged() && this.area.getRegion().equals(getLargestRegion())) {
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();
}
run.run();
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.PlotId;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.RegionWrapper;
import java.util.Collection;
import java.util.HashSet;
import java.util.UUID;
@ -47,5 +48,16 @@ public class SinglePlot extends Plot {
getArea().loadWorld(getId());
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
}

View File

@ -8,7 +8,6 @@ import com.intellectualcrafters.plot.object.Location;
import com.intellectualcrafters.plot.object.Plot;
import com.intellectualcrafters.plot.object.PlotId;
import com.intellectualcrafters.plot.object.PlotLoc;
import com.intellectualcrafters.plot.object.PlotPlayer;
import com.intellectualcrafters.plot.object.PlotSettings;
import com.intellectualcrafters.plot.object.SetupObject;
import com.intellectualcrafters.plot.util.SetupUtils;
@ -87,14 +86,31 @@ public class SinglePlotArea extends GridPlotWorld {
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();
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;
for (PlotPlayer pp : p.getPlayersInPlot()) {
pp.setMeta("lastplot", p);
}
return this.plots.put(p.getId(), p) == null;
s.flags = s.flags;
return p;
}
public Plot getPlotAbs(PlotId id) {

View File

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