From 7edfc313d672c98a3b7e0609d8c632826f9b62f3 Mon Sep 17 00:00:00 2001 From: Sauilitired Date: Mon, 21 Jan 2019 12:24:34 +0100 Subject: [PATCH] I did an oopsie --- .../plotsquared/bukkit/util/BukkitHybridUtils.java | 8 +++++++- .../plotsquared/plot/commands/Delete.java | 1 - .../plotsquared/plot/generator/HybridPlotManager.java | 7 ++++++- .../plotsquared/plot/generator/HybridUtils.java | 8 +++++++- 4 files changed, 20 insertions(+), 4 deletions(-) diff --git a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java index b7eebcc04..68b845e58 100644 --- a/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java +++ b/Bukkit/src/main/java/com/github/intellectualsites/plotsquared/bukkit/util/BukkitHybridUtils.java @@ -2,6 +2,7 @@ package com.github.intellectualsites.plotsquared.bukkit.util; import com.github.intellectualsites.plotsquared.bukkit.generator.BukkitPlotGenerator; import com.github.intellectualsites.plotsquared.plot.PlotSquared; +import com.github.intellectualsites.plotsquared.plot.config.Settings; import com.github.intellectualsites.plotsquared.plot.generator.HybridPlotWorld; import com.github.intellectualsites.plotsquared.plot.generator.HybridUtils; import com.github.intellectualsites.plotsquared.plot.object.*; @@ -107,7 +108,12 @@ public class BukkitHybridUtils extends HybridUtils { } rz[i] = v; } - int minY = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT); + int minY; + if ( Settings.Schematics.PASTE_ON_TOP) { + minY = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT); + } else { + minY = 1; + } for (short x = 0; x < 16; x++) { for (short z = 0; z < 16; z++) { BaseBlock[] blocks = hpw.G_SCH.get(MathMan.pair(rx[x], rz[z])); diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java index ede1f14cd..b399f5752 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/commands/Delete.java @@ -16,7 +16,6 @@ import com.github.intellectualsites.plotsquared.plot.util.*; // The syntax also works with any command: /plot @Override public boolean onCommand(final PlotPlayer player, String[] args) { - Location loc = player.getLocation(); final Plot plot = loc.getPlotAbs(); if (plot == null) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java index 1f6429dbd..071af627c 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridPlotManager.java @@ -79,7 +79,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 = Math.min(hpw.PLOT_HEIGHT, hpw.ROAD_HEIGHT); + } else { + minY = 1; + } for (int x = pos1.getX(); x <= pos2.getX(); x++) { short absX = (short) ((x - hpw.ROAD_OFFSET_X) % size); if (absX < 0) { diff --git a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java index 4d46205ad..80b8b0f99 100644 --- a/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java +++ b/Core/src/main/java/com/github/intellectualsites/plotsquared/plot/generator/HybridUtils.java @@ -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.C; +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; @@ -347,7 +348,12 @@ 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; + if (Settings.Schematics.PASTE_ON_TOP) { + minY = Math.min(plotWorld.PLOT_HEIGHT, plotWorld.ROAD_HEIGHT); + } else { + minY = 1; + } int maxY = Math.max(extend, blocks.length); if (blocks != null) { for (int y = 0; y < maxY; y++) {