Minor fixes, don't overlay error many times for the same y

This commit is contained in:
dordsor21 2022-01-26 17:45:52 +00:00 committed by Jordan
parent 7d15cc3ba3
commit ff60ad1e24
3 changed files with 9 additions and 5 deletions

View File

@ -245,7 +245,6 @@ public class ClassicPlotManager extends SquarePlotManager {
int x = MathMan.average(corners[0].getX(), corners[1].getX()); int x = MathMan.average(corners[0].getX(), corners[1].getX());
int z = MathMan.average(corners[0].getZ(), corners[1].getZ()); int z = MathMan.average(corners[0].getZ(), corners[1].getZ());
queue.setBlock(x, classicPlotWorld.PLOT_HEIGHT, z, blocks); queue.setBlock(x, classicPlotWorld.PLOT_HEIGHT, z, blocks);
System.out.println(classicPlotWorld.PLOT_HEIGHT);
return !enqueue || queue.enqueue(); return !enqueue || queue.enqueue();
} }

View File

@ -25,6 +25,7 @@
*/ */
package com.plotsquared.core.generator; package com.plotsquared.core.generator;
import com.plotsquared.core.PlotSquared;
import com.plotsquared.core.configuration.ConfigurationNode; import com.plotsquared.core.configuration.ConfigurationNode;
import com.plotsquared.core.configuration.ConfigurationSection; import com.plotsquared.core.configuration.ConfigurationSection;
import com.plotsquared.core.configuration.ConfigurationUtil; import com.plotsquared.core.configuration.ConfigurationUtil;
@ -46,7 +47,7 @@ public abstract class ClassicPlotWorld extends SquarePlotWorld {
public int ROAD_HEIGHT = 62; public int ROAD_HEIGHT = 62;
public int PLOT_HEIGHT = 62; public int PLOT_HEIGHT = 62;
public int WALL_HEIGHT = 62; public int WALL_HEIGHT = 62;
public int MIN_GEN_HEIGHT = 0; public int MIN_GEN_HEIGHT = PlotSquared.platform().versionMinHeight();
public BlockBucket MAIN_BLOCK = new BlockBucket(BlockTypes.STONE); public BlockBucket MAIN_BLOCK = new BlockBucket(BlockTypes.STONE);
public BlockBucket TOP_BLOCK = new BlockBucket(BlockTypes.GRASS_BLOCK); public BlockBucket TOP_BLOCK = new BlockBucket(BlockTypes.GRASS_BLOCK);
public BlockBucket WALL_BLOCK = new BlockBucket(BlockTypes.STONE_SLAB); public BlockBucket WALL_BLOCK = new BlockBucket(BlockTypes.STONE_SLAB);

View File

@ -79,6 +79,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
public int SCHEM_Y; public int SCHEM_Y;
private Location SIGN_LOCATION; private Location SIGN_LOCATION;
private File root = null; private File root = null;
private int lastOverlayHeightError = Integer.MIN_VALUE;
@Inject @Inject
private SchematicHandler schematicHandler; private SchematicHandler schematicHandler;
@ -262,9 +263,9 @@ public class HybridPlotWorld extends ClassicPlotWorld {
if (schematic3 != null) { if (schematic3 != null) {
if (schematic3.getClipboard().getDimensions().getY() == worldHeight) { if (schematic3.getClipboard().getDimensions().getY() == worldHeight) {
SCHEM_Y = plotY = getMinGenHeight(); SCHEM_Y = plotY = 0;
} else if (!Settings.Schematics.PASTE_ON_TOP) { } else if (!Settings.Schematics.PASTE_ON_TOP) {
SCHEM_Y = plotY = getMinBuildHeight(); SCHEM_Y = plotY = getMinBuildHeight() - getMinGenHeight();
} }
} }
@ -430,7 +431,10 @@ public class HybridPlotWorld extends ClassicPlotWorld {
int pair = MathMan.pair(x, z); int pair = MathMan.pair(x, z);
BaseBlock[] existing = this.G_SCH.computeIfAbsent(pair, k -> new BaseBlock[height]); BaseBlock[] existing = this.G_SCH.computeIfAbsent(pair, k -> new BaseBlock[height]);
if (y >= height) { if (y >= height) {
LOGGER.error("Error adding overlay block. `y > height`"); if (y != lastOverlayHeightError) {
lastOverlayHeightError = y;
LOGGER.error(String.format("Error adding overlay block. `y > height`. y=%s, height=%s", y, height));
}
return; return;
} }
existing[y] = id; existing[y] = id;