mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	Don't overly extend height when regenerating road region
This commit is contained in:
		@@ -525,28 +525,6 @@ public final class PlotModificationManager {
 | 
			
		||||
        return false;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Remove the south road section of a plot<br>
 | 
			
		||||
     * - Used when a plot is merged<br>
 | 
			
		||||
     *
 | 
			
		||||
     * @param queue Nullable {@link QueueCoordinator}. If null, creates own queue and enqueues,
 | 
			
		||||
     *              otherwise writes to the queue but does not enqueue.
 | 
			
		||||
     */
 | 
			
		||||
    public void removeRoadSouth(final @Nullable QueueCoordinator queue) {
 | 
			
		||||
        if (this.plot.getArea().getType() != PlotAreaType.NORMAL && this.plot
 | 
			
		||||
                .getArea()
 | 
			
		||||
                .getTerrain() == PlotAreaTerrainType.ROAD) {
 | 
			
		||||
            Plot other = this.plot.getRelative(Direction.SOUTH);
 | 
			
		||||
            Location bot = other.getBottomAbs();
 | 
			
		||||
            Location top = this.plot.getTopAbs();
 | 
			
		||||
            Location pos1 = Location.at(this.plot.getWorldName(), bot.getX(), plot.getArea().getMinGenHeight(), top.getZ());
 | 
			
		||||
            Location pos2 = Location.at(this.plot.getWorldName(), top.getX(), plot.getArea().getMaxGenHeight() + 1, bot.getZ());
 | 
			
		||||
            PlotSquared.platform().regionManager().regenerateRegion(pos1, pos2, true, null);
 | 
			
		||||
        } else if (this.plot.getArea().getTerrain() != PlotAreaTerrainType.ALL) { // no road generated => no road to remove
 | 
			
		||||
            this.plot.getManager().removeRoadSouth(this.plot, queue);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Auto merge a plot in a specific direction.
 | 
			
		||||
     *
 | 
			
		||||
@@ -913,6 +891,28 @@ public final class PlotModificationManager {
 | 
			
		||||
        return this.setComponent(component, parsed.toPattern(), actor, queue);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Remove the south road section of a plot<br>
 | 
			
		||||
     * - Used when a plot is merged<br>
 | 
			
		||||
     *
 | 
			
		||||
     * @param queue Nullable {@link QueueCoordinator}. If null, creates own queue and enqueues,
 | 
			
		||||
     *              otherwise writes to the queue but does not enqueue.
 | 
			
		||||
     */
 | 
			
		||||
    public void removeRoadSouth(final @Nullable QueueCoordinator queue) {
 | 
			
		||||
        if (this.plot.getArea().getType() != PlotAreaType.NORMAL && this.plot
 | 
			
		||||
                .getArea()
 | 
			
		||||
                .getTerrain() == PlotAreaTerrainType.ROAD) {
 | 
			
		||||
            Plot other = this.plot.getRelative(Direction.SOUTH);
 | 
			
		||||
            Location bot = other.getBottomAbs();
 | 
			
		||||
            Location top = this.plot.getTopAbs();
 | 
			
		||||
            Location pos1 = Location.at(this.plot.getWorldName(), bot.getX(), plot.getArea().getMinGenHeight(), top.getZ());
 | 
			
		||||
            Location pos2 = Location.at(this.plot.getWorldName(), top.getX(), plot.getArea().getMaxGenHeight(), bot.getZ());
 | 
			
		||||
            PlotSquared.platform().regionManager().regenerateRegion(pos1, pos2, true, null);
 | 
			
		||||
        } else if (this.plot.getArea().getTerrain() != PlotAreaTerrainType.ALL) { // no road generated => no road to remove
 | 
			
		||||
            this.plot.getManager().removeRoadSouth(this.plot, queue);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * Remove the east road section of a plot<br>
 | 
			
		||||
     * - Used when a plot is merged<br>
 | 
			
		||||
@@ -928,7 +928,7 @@ public final class PlotModificationManager {
 | 
			
		||||
            Location bot = other.getBottomAbs();
 | 
			
		||||
            Location top = this.plot.getTopAbs();
 | 
			
		||||
            Location pos1 = Location.at(this.plot.getWorldName(), top.getX(), plot.getArea().getMinGenHeight(), bot.getZ());
 | 
			
		||||
            Location pos2 = Location.at(this.plot.getWorldName(), bot.getX(), plot.getArea().getMaxGenHeight() + 1, top.getZ());
 | 
			
		||||
            Location pos2 = Location.at(this.plot.getWorldName(), bot.getX(), plot.getArea().getMaxGenHeight(), top.getZ());
 | 
			
		||||
            PlotSquared.platform().regionManager().regenerateRegion(pos1, pos2, true, null);
 | 
			
		||||
        } else if (this.plot.getArea().getTerrain() != PlotAreaTerrainType.ALL) { // no road generated => no road to remove
 | 
			
		||||
            this.plot.getArea().getPlotManager().removeRoadEast(this.plot, queue);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user