|
@@ -71,16 +71,25 @@ public class WorldPlotMap {
|
|
return map.getPlotAt(pos.getX(), pos.getY(), pos.getZ());
|
|
return map.getPlotAt(pos.getX(), pos.getY(), pos.getZ());
|
|
}
|
|
}
|
|
|
|
|
|
- public PlotMap.Plot add(World w, BlockPos pos1, BlockPos pos2) {
|
|
|
|
|
|
+ private PlotMap getOrCreate(World w) {
|
|
PlotMap map = maps.get(w);
|
|
PlotMap map = maps.get(w);
|
|
if(map == null) {
|
|
if(map == null) {
|
|
map = new PlotMap();
|
|
map = new PlotMap();
|
|
maps.put(w, map);
|
|
maps.put(w, map);
|
|
}
|
|
}
|
|
- return map.add(pos1.getX(), pos1.getY(), pos1.getZ(), pos2.getX(), pos2.getY(),
|
|
|
|
|
|
+ return map;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public PlotMap.Plot add(World w, BlockPos pos1, BlockPos pos2) {
|
|
|
|
+ return getOrCreate(w).add(pos1.getX(), pos1.getY(), pos1.getZ(), pos2.getX(), pos2.getY(),
|
|
pos2.getZ());
|
|
pos2.getZ());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public PlotMap.Plot add(World w, BlockPos pos1, BlockPos pos2, int id) {
|
|
|
|
+ return getOrCreate(w).add(pos1.getX(), pos1.getY(), pos1.getZ(), pos2.getX(), pos2.getY(),
|
|
|
|
+ pos2.getZ(), id);
|
|
|
|
+ }
|
|
|
|
+
|
|
public void remove(World w, Plot p) {
|
|
public void remove(World w, Plot p) {
|
|
PlotMap map = maps.get(w);
|
|
PlotMap map = maps.get(w);
|
|
if(map != null) {
|
|
if(map != null) {
|