Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking

This commit is contained in:
dordsor21 2019-04-05 17:39:33 +01:00
commit 34d11bf23d
5 changed files with 34 additions and 12 deletions

View File

@ -112,7 +112,7 @@ public class BukkitHybridUtils extends HybridUtils {
}
int minY;
if (Settings.Schematics.PASTE_ON_TOP) {
minY = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT);
minY = hpw.SCHEM_Y;
} else {
minY = 1;
}

View File

@ -17,7 +17,7 @@ public class HybridGen extends IndependentPlotGenerator {
short relativeZ, int x, int z, boolean isRoad) {
int minY; // Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
if (isRoad || Settings.Schematics.PASTE_ON_TOP) {
minY = Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
minY = world.SCHEM_Y;
} else {
minY = 1;
}

View File

@ -78,7 +78,12 @@ public class HybridPlotManager extends ClassicPlotManager {
private void createSchemAbs(HybridPlotWorld hpw, LocalBlockQueue queue, Location pos1,
Location pos2, boolean clear) {
int size = hpw.SIZE;
int minY = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT);
int minY;
if (Settings.Schematics.PASTE_ON_TOP) {
minY = hpw.SCHEM_Y;
} else {
minY = 1;
}
for (int x = pos1.getX(); x <= pos2.getX(); x++) {
short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size);
if (absX < 0) {

View File

@ -30,10 +30,12 @@ public class HybridPlotWorld extends ClassicPlotWorld {
private static AffineTransform transform = new AffineTransform().rotateY(90);
public boolean ROAD_SCHEMATIC_ENABLED;
public boolean PLOT_SCHEMATIC = false;
public int PLOT_SCHEMATIC_HEIGHT = -1;
public short PATH_WIDTH_LOWER;
public short PATH_WIDTH_UPPER;
public HashMap<Integer, BaseBlock[]> G_SCH;
private Location SIGN_LOCATION;
public int SCHEM_Y;
public HybridPlotWorld(String worldName, String id, IndependentPlotGenerator generator,
PlotId min, PlotId max) {
@ -143,7 +145,23 @@ public class HybridPlotWorld extends ClassicPlotWorld {
Schematic schematic3 = SchematicHandler.manager.getSchematic(schematic3File);
int shift = this.ROAD_WIDTH / 2;
int oddshift = (this.ROAD_WIDTH & 1) == 0 ? 0 : 1;
int minY = Math.min(PLOT_HEIGHT, ROAD_HEIGHT);
SCHEM_Y = Math.min(PLOT_HEIGHT, ROAD_HEIGHT);
int plotY = PLOT_HEIGHT - SCHEM_Y;
int roadY = ROAD_HEIGHT - SCHEM_Y;
if (schematic3.getClipboard().getDimensions().getY() == 256) {
SCHEM_Y = 0;
plotY = 0;
roadY = ROAD_HEIGHT;
}
if (schematic1.getClipboard().getDimensions().getY() == 256) {
SCHEM_Y = 0;
plotY = Math.min(plotY, PLOT_HEIGHT);
roadY = 0;
}
if (schematic3 != null) {
this.PLOT_SCHEMATIC = true;
BlockArrayClipboard blockArrayClipboard3 = schematic3.getClipboard();
@ -168,8 +186,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
centerShiftX = (PLOT_WIDTH - w3) / 2;
}
int startY = minY - PLOT_HEIGHT;
BlockVector3 min = blockArrayClipboard3.getMinimumPoint();
for (short x = 0; x < w3; x++) {
for (short z = 0; z < l3; z++) {
@ -177,7 +193,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
BaseBlock id = blockArrayClipboard3.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
if (!id.getBlockType().getMaterial().isAir()) {
addOverlayBlock((short) (x + shift + oddshift + centerShiftX),
(short) (y + startY), (short) (z + shift + oddshift + centerShiftZ),
(short) (y + plotY), (short) (z + shift + oddshift + centerShiftZ),
id, false, h3);
}
}
@ -234,16 +250,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
short w2 = (short) d2.getX();
short l2 = (short) d2.getZ();
short h2 = (short) d2.getY();
int startY = minY - ROAD_HEIGHT;
BlockVector3 min = blockArrayClipboard2.getMinimumPoint();
for (short x = 0; x < w2; x++) {
for (short z = 0; z < l2; z++) {
for (short y = 0; y < h2; y++) {
BaseBlock id = blockArrayClipboard2.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
if (!id.getBlockType().getMaterial().isAir()) {
addOverlayBlock((short) (x - shift), (short) (y + startY),
addOverlayBlock((short) (x - shift), (short) (y + roadY),
(short) (z + shift + oddshift), id, false, h1);
addOverlayBlock((short) (z + shift + oddshift), (short) (y + startY),
addOverlayBlock((short) (z + shift + oddshift), (short) (y + roadY),
(short) (shift - x + (oddshift - 1)), id, true, h1);
}
}
@ -255,7 +270,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
for (short y = 0; y < h2; y++) {
BaseBlock id = blockArrayClipboard1.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
if (!id.getBlockType().getMaterial().isAir()) {
addOverlayBlock((short) (x - shift), (short) (y + startY),
addOverlayBlock((short) (x - shift), (short) (y + roadY),
(short) (z - shift), id, false, h2);
}
}

View File

@ -2,6 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.generator;
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
import com.github.intellectualsites.plotsquared.plot.config.Captions;
import com.github.intellectualsites.plotsquared.plot.config.Settings;
import com.github.intellectualsites.plotsquared.plot.flag.FlagManager;
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
import com.github.intellectualsites.plotsquared.plot.listener.WEExtent;
@ -343,7 +344,8 @@ public abstract class HybridUtils {
}
if (condition) {
BaseBlock[] blocks = plotWorld.G_SCH.get(MathMan.pair(absX, absZ));
int minY = Math.min(plotWorld.PLOT_HEIGHT, plotWorld.ROAD_HEIGHT);
int minY = plotWorld.SCHEM_Y;
if (!Settings.Schematics.PASTE_ON_TOP) minY = 1;
int maxY = Math.max(extend, blocks.length);
if (blocks != null) {
for (int y = 0; y < maxY; y++) {