19
19
import java .util .TreeMap ;
20
20
21
21
public class GMBCore {
22
- public static void generate (BiomeProvider manager , String mapname , int scale , int radius , int originx , int originz , int width , int height , ICommandSender icommandsender ) {
22
+ public static void generate (BiomeProvider provider , String mapname , int scale , int radius , int originx , int originz , int width , int height , ICommandSender icommandsender ) {
23
23
File gmbpath = new File (GiveMeBiomes .savepath , mapname );
24
24
File path = new File (gmbpath , "data" );
25
25
if (!path .exists ()) {
@@ -38,7 +38,8 @@ public static void generate(BiomeProvider manager, String mapname, int scale, in
38
38
int [] colors = generateColors (path );
39
39
40
40
icommandsender .sendMessage (new TextComponentString ("Beginning render of map with 1:" + scale + " scale covering a " + radius * 2 + "x" + radius * 2 + " block area." ));
41
- generateMap (manager , colors , scale , radius , originx , originz , width , height , path );
41
+
42
+ generateMap (provider , colors , scale , radius , originx , originz , width , height , path );
42
43
43
44
writeAssets (gmbpath );
44
45
@@ -47,15 +48,15 @@ public static void generate(BiomeProvider manager, String mapname, int scale, in
47
48
icommandsender .sendMessage (itextcomponent );
48
49
}
49
50
50
- private static void generateMap (BiomeProvider manager , int [] colors , int scale , int radius , int originx , int originz , int width , int height , File path ) {
51
+ private static void generateMap (BiomeProvider provider , int [] colors , int scale , int radius , int originx , int originz , int width , int height , File path ) {
51
52
int [] pixels = new int [width * height ];
52
- Biome [] biomeTemp = new Biome [1 ];
53
+ Biome [] biome = new Biome [1 ];
53
54
int lastpercent = 0 ;
54
55
55
56
for (int y = 0 ; y < height ; ++y ) {
56
57
for (int x = 0 ; x < width ; ++x ) {
57
- Biome e = manager . getBiomesForGeneration ( biomeTemp , originx - radius + x * scale , originz - radius + y * scale , 1 , 1 )[ 0 ] ;
58
- pixels [y * width + x ] = colors [Biome .getIdForBiome (e )];
58
+ provider . getBiomes ( biome , originx - radius + x * scale , originz - radius + y * scale , 1 , 1 );
59
+ pixels [y * width + x ] = colors [Biome .getIdForBiome (biome [ 0 ] )];
59
60
60
61
double progress = (double )(y * width + x ) / (double )(height * width ) * 100.0D ;
61
62
if (Math .floor (progress ) > (double )lastpercent ) {
0 commit comments