mirror of
				https://github.com/IntellectualSites/PlotSquared.git
				synced 2025-11-04 11:13:45 +01:00 
			
		
		
		
	OCD
This commit is contained in:
		@@ -25,9 +25,9 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
 | 
			
		||||
    public static SpongeAugmentedGenerator get(World world) {
 | 
			
		||||
        WorldGenerator wg = world.getWorldGenerator();
 | 
			
		||||
        List<GenerationPopulator> populators = wg.getGenerationPopulators();
 | 
			
		||||
        for (GenerationPopulator poplator : populators) {
 | 
			
		||||
            if (poplator instanceof SpongeAugmentedGenerator) {
 | 
			
		||||
                return (SpongeAugmentedGenerator) poplator;
 | 
			
		||||
        for (GenerationPopulator populator : populators) {
 | 
			
		||||
            if (populator instanceof SpongeAugmentedGenerator) {
 | 
			
		||||
                return (SpongeAugmentedGenerator) populator;
 | 
			
		||||
            }
 | 
			
		||||
        }
 | 
			
		||||
        if (generator == null) {
 | 
			
		||||
@@ -38,12 +38,12 @@ public class SpongeAugmentedGenerator implements GenerationPopulator {
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public void populate(final World world, final MutableBlockVolume terrain, final ImmutableBiomeArea biome) {
 | 
			
		||||
    public void populate(World world, MutableBlockVolume terrain, ImmutableBiomeArea biome) {
 | 
			
		||||
        Vector3i min = terrain.getBlockMin();
 | 
			
		||||
        final int bx = min.getX();
 | 
			
		||||
        final int bz = min.getZ();
 | 
			
		||||
        final int cx = bx >> 4;
 | 
			
		||||
        final int cz = bz >> 4;
 | 
			
		||||
        int bx = min.getX();
 | 
			
		||||
        int bz = min.getZ();
 | 
			
		||||
        int cx = bx >> 4;
 | 
			
		||||
        int cz = bz >> 4;
 | 
			
		||||
        AugmentedUtils.generate(world.getName(), cx, cz, new LazyResult<PlotChunk<?>>() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public PlotChunk<?> create() {
 | 
			
		||||
 
 | 
			
		||||
@@ -28,9 +28,9 @@ public class SpongePlotGenerator implements WorldGeneratorModifier, GeneratorWra
 | 
			
		||||
    private final IndependentPlotGenerator plotGenerator;
 | 
			
		||||
    private final List<GenerationPopulator> populators = new ArrayList<>();
 | 
			
		||||
    private final boolean loaded = false;
 | 
			
		||||
    private PlotManager manager;
 | 
			
		||||
    private final WorldGeneratorModifier platformGenerator;
 | 
			
		||||
    private final boolean full;
 | 
			
		||||
    private PlotManager manager;
 | 
			
		||||
    
 | 
			
		||||
    public SpongePlotGenerator(IndependentPlotGenerator generator) {
 | 
			
		||||
        this.plotGenerator = generator;
 | 
			
		||||
@@ -48,34 +48,34 @@ public class SpongePlotGenerator implements WorldGeneratorModifier, GeneratorWra
 | 
			
		||||
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getId() {
 | 
			
		||||
        if (plotGenerator == null) {
 | 
			
		||||
            if (platformGenerator != this) {
 | 
			
		||||
                return platformGenerator.getId();
 | 
			
		||||
        if (this.plotGenerator == null) {
 | 
			
		||||
            if (this.platformGenerator != this) {
 | 
			
		||||
                return this.platformGenerator.getId();
 | 
			
		||||
            }
 | 
			
		||||
            return "null";
 | 
			
		||||
        }
 | 
			
		||||
        return plotGenerator.getName();
 | 
			
		||||
        return this.plotGenerator.getName();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public String getName() {
 | 
			
		||||
        if (plotGenerator == null) {
 | 
			
		||||
            if (platformGenerator != this) {
 | 
			
		||||
                return platformGenerator.getName();
 | 
			
		||||
        if (this.plotGenerator == null) {
 | 
			
		||||
            if (this.platformGenerator != this) {
 | 
			
		||||
                return this.platformGenerator.getName();
 | 
			
		||||
            }
 | 
			
		||||
            return "null";
 | 
			
		||||
        }
 | 
			
		||||
        return plotGenerator.getName();
 | 
			
		||||
        return this.plotGenerator.getName();
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public void modifyWorldGenerator(WorldCreationSettings settings, DataContainer data, WorldGenerator wg) {
 | 
			
		||||
        final String worldname = settings.getWorldName();
 | 
			
		||||
        wg.setBaseGenerationPopulator(new SpongeTerrainGen(this, plotGenerator));
 | 
			
		||||
        String worldName = settings.getWorldName();
 | 
			
		||||
        wg.setBaseGenerationPopulator(new SpongeTerrainGen(this, this.plotGenerator));
 | 
			
		||||
        wg.setBiomeGenerator(new BiomeGenerator() {
 | 
			
		||||
            @Override
 | 
			
		||||
            public void generateBiomes(MutableBiomeArea buffer) {
 | 
			
		||||
                PlotArea area = PS.get().getPlotArea(worldname, null);
 | 
			
		||||
                PlotArea area = PS.get().getPlotArea(worldName, null);
 | 
			
		||||
                if (area != null) {
 | 
			
		||||
                    BiomeType biome = SpongeUtil.getBiome(area.PLOT_BIOME);
 | 
			
		||||
                    Vector2i min = buffer.getBiomeMin();
 | 
			
		||||
@@ -96,17 +96,17 @@ public class SpongePlotGenerator implements WorldGeneratorModifier, GeneratorWra
 | 
			
		||||
    }
 | 
			
		||||
        wg.getGenerationPopulators().clear();
 | 
			
		||||
        wg.getPopulators().clear();
 | 
			
		||||
        PS.get().loadWorld(worldname, this);
 | 
			
		||||
        PS.get().loadWorld(worldName, this);
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public IndependentPlotGenerator getPlotGenerator() {
 | 
			
		||||
        return plotGenerator;
 | 
			
		||||
        return this.plotGenerator;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public WorldGeneratorModifier getPlatformGenerator() {
 | 
			
		||||
        return platformGenerator;
 | 
			
		||||
        return this.platformGenerator;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
@@ -116,7 +116,7 @@ public class SpongePlotGenerator implements WorldGeneratorModifier, GeneratorWra
 | 
			
		||||
    
 | 
			
		||||
    @Override
 | 
			
		||||
    public boolean isFull() {
 | 
			
		||||
        return full;
 | 
			
		||||
        return this.full;
 | 
			
		||||
    }
 | 
			
		||||
    
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user