mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-08-26 23:19:47 +02:00
Fix world delete
This commit is contained in:
parent
e8672df760
commit
3f54ba23c2
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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) {
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
rootProject.name = 'PlotSquared'
|
||||
|
||||
include 'Core', 'Bukkit', 'Sponge', 'Nukkit'
|
||||
include 'Core', 'Bukkit', 'Nukkit' //,'Sponge'
|
Loading…
Reference in New Issue
Block a user