The PruningConfig class allows you to selectively keep or remove regions of your world during conversion. This is useful for reducing world size, removing unwanted areas, or extracting specific regions.
List<PruningRegion> regions = new ArrayList<>();regions.add(new PruningRegion(-10, -10, 10, 10));// Keep only the specified regionsPruningConfig config = new PruningConfig(true, regions);
True if the regions should be included and outside of it should be excluded. False if the regions should be excluded and outside of it should be included.
import com.hivemc.chunker.pruning.PruningConfig;import com.hivemc.chunker.pruning.PruningRegion;import java.util.ArrayList;import java.util.List;// Create a region around spawnList<PruningRegion> regions = new ArrayList<>();regions.add(new PruningRegion(-10, -10, 10, 10));// Include only this region (exclude everything else)PruningConfig config = new PruningConfig(true, regions);
List<PruningRegion> regionsToRemove = new ArrayList<>();// Remove area 1regionsToRemove.add(new PruningRegion(50, 50, 100, 100));// Remove area 2regionsToRemove.add(new PruningRegion(-50, -50, -25, -25));// Exclude these regions (keep everything else)PruningConfig config = new PruningConfig(false, regionsToRemove);
import com.hivemc.chunker.conversion.WorldConverter;import com.hivemc.chunker.conversion.intermediate.world.Dimension;import com.hivemc.chunker.pruning.PruningConfig;import com.hivemc.chunker.pruning.PruningRegion;import java.util.*;// Create converterWorldConverter worldConverter = new WorldConverter(UUID.randomUUID());// Create pruning config for overworldList<PruningRegion> overworldRegions = new ArrayList<>();overworldRegions.add(new PruningRegion(-10, -10, 10, 10));PruningConfig overworldConfig = new PruningConfig(true, overworldRegions);// Create pruning config for netherList<PruningRegion> netherRegions = new ArrayList<>();netherRegions.add(new PruningRegion(-5, -5, 5, 5));PruningConfig netherConfig = new PruningConfig(true, netherRegions);// Apply per-dimension pruningMap<Dimension, PruningConfig> pruningConfigs = new HashMap<>();pruningConfigs.put(Dimension.OVERWORLD, overworldConfig);pruningConfigs.put(Dimension.NETHER, netherConfig);// The End will not be pruned (not included in map)worldConverter.setPruningConfigs(pruningConfigs);