mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 08:36:45 +01: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);
|
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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -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
|
||||||
}
|
}
|
||||||
|
@ -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) {
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
rootProject.name = 'PlotSquared'
|
rootProject.name = 'PlotSquared'
|
||||||
|
|
||||||
include 'Core', 'Bukkit', 'Sponge', 'Nukkit'
|
include 'Core', 'Bukkit', 'Nukkit' //,'Sponge'
|
Loading…
Reference in New Issue
Block a user