From 2860b13412dd64c72758f8b0338bf17d759e3178 Mon Sep 17 00:00:00 2001 From: Drakia Date: Sun, 20 Mar 2011 15:59:22 -0700 Subject: [PATCH] Changed hashCode() in Blox to take the world into account --- src/net/TheDgtl/Stargate/Blox.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/net/TheDgtl/Stargate/Blox.java b/src/net/TheDgtl/Stargate/Blox.java index 8689977..d91cee3 100644 --- a/src/net/TheDgtl/Stargate/Blox.java +++ b/src/net/TheDgtl/Stargate/Blox.java @@ -105,11 +105,12 @@ public class Blox { @Override public int hashCode() { - int result = 0; + int result = 18; - result += x * 92821; - result += y * 92821; - result += z * 92821; + result = result * 27 + x; + result = result * 27 + y; + result = result * 27 + z; + result = result * 27 + world.hashCode(); return result; }