Fixed titles and schematic on clear offset for hybrid generation.

This commit is contained in:
boy0001 2015-07-21 16:03:27 +10:00
parent 488dbb0a63
commit 83bdcbfb97
2 changed files with 11 additions and 7 deletions

View File

@ -91,12 +91,12 @@ public class HybridPlotManager extends ClassicPlotManager {
public void createSchemAbs(HybridPlotWorld hpw, Location pos1, Location pos2, int height, boolean clear) {
final int size = hpw.SIZE;
for (int x = pos1.getX(); x <= pos2.getX(); x++) {
short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size);
if (absX < 0) {
absX += size;
}
for (int z = pos1.getZ(); z <= pos2.getZ(); z++) {
short absX = (short) (x % size);
short absZ = (short) (z % size);
if (absX < 0) {
absX += size;
}
short absZ = (short) ((z - hpw.ROAD_OFFSET_Z) % size);
if (absZ < 0) {
absZ += size;
}
@ -171,9 +171,13 @@ public class HybridPlotManager extends ClassicPlotManager {
public boolean clearPlot(final PlotWorld plotworld, final Plot plot, final boolean isDelete, final Runnable whenDone) {
final String world = plotworld.worldname;
final HybridPlotWorld dpw = ((HybridPlotWorld) plotworld);
final Location pos1 = MainUtil.getPlotBottomLocAbs(world, plot.id).add(1, 0, 1);
final Location pos2 = MainUtil.getPlotTopLocAbs(world, plot.id);
System.out.print(pos1);
System.out.print(pos2);
setWallFilling(dpw, plot.id, new PlotBlock[] { dpw.WALL_FILLING });
final int p1x = pos1.getX();
final int p1z = pos1.getZ();
@ -261,7 +265,7 @@ public class HybridPlotManager extends ClassicPlotManager {
if (!plotworld.PLOT_SCHEMATIC) {
return;
}
createSchemAbs(plotworld, l1.add(1,0,1), l2, plotworld.PLOT_HEIGHT, false);
createSchemAbs(plotworld, l1, l2, plotworld.PLOT_HEIGHT, false);
}
}

View File

@ -202,7 +202,7 @@ public class PlotListener extends APlotListener {
@Override
public void run() {
Plot lastPlot = (Plot) pp.getMeta("lastplot");
if (plot.id.equals(lastPlot.id)) {
if (lastPlot != null && plot.id.equals(lastPlot.id)) {
Map<String, String> replacements = new HashMap<>();
replacements.put("%x%", lastPlot.id.x + "");
replacements.put("%z%", lastPlot.id.y + "");