Browse Source

Peace zone needs to come from zone tree

magicbox-1.5.2
MagicBot 1 year ago
parent
commit
3986dc0686
  1. 12
      src/engine/InterestManagement/Terrain.java
  2. 17
      src/engine/objects/Zone.java

12
src/engine/InterestManagement/Terrain.java

@ -49,8 +49,8 @@ public class Terrain { @@ -49,8 +49,8 @@ public class Terrain {
// Configure terrain based on zone properties
this.terrain_size.x = this.zone.template.major_radius * 2;
this.terrain_size.y = this.zone.template.minor_radius * 2;
this.terrain_size.x = this.zone.major_radius * 2;
this.terrain_size.y = this.zone.minor_radius * 2;
this.cell_count.x = this.terrain_pixel_data.length - 1;
this.cell_count.y = this.terrain_pixel_data[0].length - 1;
@ -62,11 +62,11 @@ public class Terrain { @@ -62,11 +62,11 @@ public class Terrain {
// the blending area between child and parent terrains when
// they are stitched together.
Vector2f major_blend = new Vector2f(this.zone.template.max_blend / this.zone.template.major_radius,
this.zone.template.min_blend / this.zone.template.major_radius);
Vector2f major_blend = new Vector2f(this.zone.template.max_blend / this.zone.major_radius,
this.zone.template.min_blend / this.zone.major_radius);
Vector2f minor_blend = new Vector2f(this.zone.template.max_blend / this.zone.template.minor_radius,
this.zone.template.min_blend / this.zone.template.minor_radius);
Vector2f minor_blend = new Vector2f(this.zone.template.max_blend / this.zone.minor_radius,
this.zone.template.min_blend / this.zone.minor_radius);
if (major_blend.y > 0.4f)
blend_ratio.x = major_blend.y;

17
src/engine/objects/Zone.java

@ -34,10 +34,13 @@ public class Zone extends AbstractWorldObject { @@ -34,10 +34,13 @@ public class Zone extends AbstractWorldObject {
public final Set<Building> zoneBuildingSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
public final Set<NPC> zoneNPCSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
public final Set<Mob> zoneMobSet = Collections.newSetFromMap(new ConcurrentHashMap<>());
public ZoneTemplate template;
public final int playerCityUUID;
public final String zoneName;
public final float major_radius;
public final float minor_radius;
public final float xOffset;
public final float zOffset;
public final float yOffset;
@ -72,17 +75,23 @@ public class Zone extends AbstractWorldObject { @@ -72,17 +75,23 @@ public class Zone extends AbstractWorldObject {
super(rs);
this.parentZoneID = rs.getInt("parent");
this.playerCityUUID = rs.getInt("playerCityUUID");
this.guild_zone = this.playerCityUUID != 0;
this.templateID = rs.getInt("template");
this.zoneName = rs.getString("zone_name");
this.peace_zone = rs.getByte("peace_zone");
this.major_radius = rs.getFloat("major_radius");
this.minor_radius = rs.getFloat("minor_radius");
this.xOffset = rs.getFloat("xOffset");
this.zOffset = rs.getFloat("zOffset");
this.yOffset = rs.getFloat("yOffset");
this.templateID = rs.getInt("template");
this.peace_zone = rs.getByte("peace_zone");
this.playerCityUUID = rs.getInt("playerCityUUID");
this.guild_zone = this.playerCityUUID != 0;
this.icon1 = rs.getString("icon1");
this.icon2 = rs.getString("icon2");
this.icon3 = rs.getString("icon3");
this.min_level = rs.getInt("min_level");
this.max_level = rs.getInt("max_level");

Loading…
Cancel
Save