mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-25 22:56:45 +01:00
Merge branch 'breaking' of https://github.com/IntellectualSites/PlotSquared into breaking
This commit is contained in:
commit
34d11bf23d
@ -112,7 +112,7 @@ public class BukkitHybridUtils extends HybridUtils {
|
|||||||
}
|
}
|
||||||
int minY;
|
int minY;
|
||||||
if (Settings.Schematics.PASTE_ON_TOP) {
|
if (Settings.Schematics.PASTE_ON_TOP) {
|
||||||
minY = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT);
|
minY = hpw.SCHEM_Y;
|
||||||
} else {
|
} else {
|
||||||
minY = 1;
|
minY = 1;
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ public class HybridGen extends IndependentPlotGenerator {
|
|||||||
short relativeZ, int x, int z, boolean isRoad) {
|
short relativeZ, int x, int z, boolean isRoad) {
|
||||||
int minY; // Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
|
int minY; // Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
|
||||||
if (isRoad || Settings.Schematics.PASTE_ON_TOP) {
|
if (isRoad || Settings.Schematics.PASTE_ON_TOP) {
|
||||||
minY = Math.min(world.PLOT_HEIGHT, world.ROAD_HEIGHT);
|
minY = world.SCHEM_Y;
|
||||||
} else {
|
} else {
|
||||||
minY = 1;
|
minY = 1;
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,12 @@ public class HybridPlotManager extends ClassicPlotManager {
|
|||||||
private void createSchemAbs(HybridPlotWorld hpw, LocalBlockQueue queue, Location pos1,
|
private void createSchemAbs(HybridPlotWorld hpw, LocalBlockQueue queue, Location pos1,
|
||||||
Location pos2, boolean clear) {
|
Location pos2, boolean clear) {
|
||||||
int size = hpw.SIZE;
|
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++) {
|
for (int x = pos1.getX(); x <= pos2.getX(); x++) {
|
||||||
short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size);
|
short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size);
|
||||||
if (absX < 0) {
|
if (absX < 0) {
|
||||||
|
@ -30,10 +30,12 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
private static AffineTransform transform = new AffineTransform().rotateY(90);
|
private static AffineTransform transform = new AffineTransform().rotateY(90);
|
||||||
public boolean ROAD_SCHEMATIC_ENABLED;
|
public boolean ROAD_SCHEMATIC_ENABLED;
|
||||||
public boolean PLOT_SCHEMATIC = false;
|
public boolean PLOT_SCHEMATIC = false;
|
||||||
|
public int PLOT_SCHEMATIC_HEIGHT = -1;
|
||||||
public short PATH_WIDTH_LOWER;
|
public short PATH_WIDTH_LOWER;
|
||||||
public short PATH_WIDTH_UPPER;
|
public short PATH_WIDTH_UPPER;
|
||||||
public HashMap<Integer, BaseBlock[]> G_SCH;
|
public HashMap<Integer, BaseBlock[]> G_SCH;
|
||||||
private Location SIGN_LOCATION;
|
private Location SIGN_LOCATION;
|
||||||
|
public int SCHEM_Y;
|
||||||
|
|
||||||
public HybridPlotWorld(String worldName, String id, IndependentPlotGenerator generator,
|
public HybridPlotWorld(String worldName, String id, IndependentPlotGenerator generator,
|
||||||
PlotId min, PlotId max) {
|
PlotId min, PlotId max) {
|
||||||
@ -143,7 +145,23 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
Schematic schematic3 = SchematicHandler.manager.getSchematic(schematic3File);
|
Schematic schematic3 = SchematicHandler.manager.getSchematic(schematic3File);
|
||||||
int shift = this.ROAD_WIDTH / 2;
|
int shift = this.ROAD_WIDTH / 2;
|
||||||
int oddshift = (this.ROAD_WIDTH & 1) == 0 ? 0 : 1;
|
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) {
|
if (schematic3 != null) {
|
||||||
this.PLOT_SCHEMATIC = true;
|
this.PLOT_SCHEMATIC = true;
|
||||||
BlockArrayClipboard blockArrayClipboard3 = schematic3.getClipboard();
|
BlockArrayClipboard blockArrayClipboard3 = schematic3.getClipboard();
|
||||||
@ -168,8 +186,6 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
centerShiftX = (PLOT_WIDTH - w3) / 2;
|
centerShiftX = (PLOT_WIDTH - w3) / 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
int startY = minY - PLOT_HEIGHT;
|
|
||||||
|
|
||||||
BlockVector3 min = blockArrayClipboard3.getMinimumPoint();
|
BlockVector3 min = blockArrayClipboard3.getMinimumPoint();
|
||||||
for (short x = 0; x < w3; x++) {
|
for (short x = 0; x < w3; x++) {
|
||||||
for (short z = 0; z < l3; z++) {
|
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()));
|
BaseBlock id = blockArrayClipboard3.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
if (!id.getBlockType().getMaterial().isAir()) {
|
||||||
addOverlayBlock((short) (x + shift + oddshift + centerShiftX),
|
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);
|
id, false, h3);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -234,16 +250,15 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
short w2 = (short) d2.getX();
|
short w2 = (short) d2.getX();
|
||||||
short l2 = (short) d2.getZ();
|
short l2 = (short) d2.getZ();
|
||||||
short h2 = (short) d2.getY();
|
short h2 = (short) d2.getY();
|
||||||
int startY = minY - ROAD_HEIGHT;
|
|
||||||
BlockVector3 min = blockArrayClipboard2.getMinimumPoint();
|
BlockVector3 min = blockArrayClipboard2.getMinimumPoint();
|
||||||
for (short x = 0; x < w2; x++) {
|
for (short x = 0; x < w2; x++) {
|
||||||
for (short z = 0; z < l2; z++) {
|
for (short z = 0; z < l2; z++) {
|
||||||
for (short y = 0; y < h2; y++) {
|
for (short y = 0; y < h2; y++) {
|
||||||
BaseBlock id = blockArrayClipboard2.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
|
BaseBlock id = blockArrayClipboard2.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
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);
|
(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);
|
(short) (shift - x + (oddshift - 1)), id, true, h1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -255,7 +270,7 @@ public class HybridPlotWorld extends ClassicPlotWorld {
|
|||||||
for (short y = 0; y < h2; y++) {
|
for (short y = 0; y < h2; y++) {
|
||||||
BaseBlock id = blockArrayClipboard1.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
|
BaseBlock id = blockArrayClipboard1.getFullBlock(BlockVector3.at(x + min.getBlockX(), y + min.getBlockY(), z + min.getBlockZ()));
|
||||||
if (!id.getBlockType().getMaterial().isAir()) {
|
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);
|
(short) (z - shift), id, false, h2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -2,6 +2,7 @@ package com.github.intellectualsites.plotsquared.plot.generator;
|
|||||||
|
|
||||||
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
import com.github.intellectualsites.plotsquared.plot.PlotSquared;
|
||||||
import com.github.intellectualsites.plotsquared.plot.config.Captions;
|
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.FlagManager;
|
||||||
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
import com.github.intellectualsites.plotsquared.plot.flag.Flags;
|
||||||
import com.github.intellectualsites.plotsquared.plot.listener.WEExtent;
|
import com.github.intellectualsites.plotsquared.plot.listener.WEExtent;
|
||||||
@ -343,7 +344,8 @@ public abstract class HybridUtils {
|
|||||||
}
|
}
|
||||||
if (condition) {
|
if (condition) {
|
||||||
BaseBlock[] blocks = plotWorld.G_SCH.get(MathMan.pair(absX, absZ));
|
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);
|
int maxY = Math.max(extend, blocks.length);
|
||||||
if (blocks != null) {
|
if (blocks != null) {
|
||||||
for (int y = 0; y < maxY; y++) {
|
for (int y = 0; y < maxY; y++) {
|
||||||
|
Loading…
Reference in New Issue
Block a user