Implemented (hopefully) speedier equals() and hashCode() function overrides for the BorderData class

Made round borders the default instead of square, since the server impact is only very slightly higher for round borders and they look nicer on display maps
Added logo PSD just for the heck of it
This commit is contained in:
Brettflan 2011-09-06 16:42:28 -05:00
parent 462c70d335
commit f24c676c18
3 changed files with 21 additions and 2 deletions

View File

@ -220,4 +220,23 @@ public class BorderData
return -1.0; // no safe Y location?!?!? Must be a rare spot in a Nether world or something
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
return true;
else if (obj == null || obj.getClass() != this.getClass())
return false;
BorderData test = (BorderData)obj;
return test.x == this.x && test.z == this.z && test.radius == this.radius;
}
@Override
public int hashCode()
{
return (((int)(this.x * 10) << 4) + (int)this.z + (this.radius << 2));
}
}

View File

@ -41,7 +41,7 @@ public class Config
private static ColouredConsoleSender console = null;
// actual configuration values which can be changed
private static boolean shapeRound = false;
private static boolean shapeRound = true;
private static Map<String, BorderData> borders = Collections.synchronizedMap(new LinkedHashMap<String, BorderData>());
private static String message;
private static boolean DEBUG = false;
@ -340,7 +340,7 @@ public class Config
int cfgVersion = cfg.getInt("cfg-version", currentCfgVersion);
message = cfg.getString("message");
shapeRound = cfg.getBoolean("round-border", false);
shapeRound = cfg.getBoolean("round-border", true);
DEBUG = cfg.getBoolean("debug-mode", false);
whooshEffect = cfg.getBoolean("whoosh-effect", false);
knockBack = cfg.getDouble("knock-back-dist", 3.0);

BIN
worldborder_logo.psd Normal file

Binary file not shown.