package com.example.duneterrain; import org.bukkit.Material; import org.bukkit.generator.LimitedRegion; /** Retaining walls, a real floor and foundations: never an unsupported disc of water. */ final class SietchReservoirs { static void build(LimitedRegion region,int x,int floor,int z,int width,int length,int depth){ for(int dx=-width;dx<=width;dx++)for(int dz=-length;dz<=length;dz++){ set(region,x+dx,floor,z+dz,Material.STONE_BRICKS); boolean wall=Math.abs(dx)==width||Math.abs(dz)==length; for(int dy=1;dy<=depth;dy++)set(region,x+dx,floor+dy,z+dz,wall?Material.CUT_SANDSTONE:Material.WATER); if(wall)set(region,x+dx,floor+depth+1,z+dz,Material.SMOOTH_SANDSTONE_SLAB); // Piers under the corners and edges remain visible inside larger caverns. if((Math.abs(dx)==width&&(dz==0||Math.abs(dz)==length))||(dx==0&&Math.abs(dz)==length)) for(int down=1;down<=6;down++)set(region,x+dx,floor-down,z+dz,Material.SANDSTONE); } } private static void set(LimitedRegion r,int x,int y,int z,Material m){if(r.isInRegion(x,y,z))r.setType(x,y,z,m);} }