forked from MagicBane/Server
Terrain zone set in constructor
This commit is contained in:
@@ -31,15 +31,17 @@ public class Terrain {
|
|||||||
|
|
||||||
public Terrain(Zone zone) {
|
public Terrain(Zone zone) {
|
||||||
|
|
||||||
this.heightmap = zone.terrain_image;
|
this.zone = zone;
|
||||||
|
|
||||||
|
this.heightmap = this.zone.terrain_image;
|
||||||
|
|
||||||
// Configure PLANAR
|
// Configure PLANAR
|
||||||
|
|
||||||
if (zone.terrain_type.equals("PLANAR"))
|
if (this.zone.terrain_type.equals("PLANAR"))
|
||||||
this.heightmap = 1006300;
|
this.heightmap = 1006300;
|
||||||
|
|
||||||
this.terrain_size.x = zone.major_radius;
|
this.terrain_size.x = this.zone.major_radius;
|
||||||
this.terrain_size.y = zone.minor_radius;
|
this.terrain_size.y = this.zone.minor_radius;
|
||||||
|
|
||||||
this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap);
|
this.terrain_pixel_data = Terrain._heightmap_pixel_cache.get(heightmap);
|
||||||
|
|
||||||
@@ -52,7 +54,7 @@ public class Terrain {
|
|||||||
this.cell_size.x = terrain_size.x / this.cell_count.x;
|
this.cell_size.x = terrain_size.x / this.cell_count.x;
|
||||||
this.cell_size.y = terrain_size.y / this.cell_count.y;
|
this.cell_size.y = terrain_size.y / this.cell_count.y;
|
||||||
|
|
||||||
this.terrain_scale = zone.terrain_max_y / 255f;
|
this.terrain_scale = this.zone.terrain_max_y / 255f;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user