Skip to content

Instantly share code, notes, and snippets.

@ft975
Created June 23, 2013 01:50
Show Gist options
  • Save ft975/5843406 to your computer and use it in GitHub Desktop.
Save ft975/5843406 to your computer and use it in GitHub Desktop.
object MovingRegistry {
case class Key(world: World, pos: WorldPos){
private lazy val hash = world.getWorldInfo.getDimension + pos.x * pos.y * pos.z
override def hashCode(): Int = {
hash
}
override def equals(obj: Any): Boolean = {
obj match {
case obj:Key => obj.world == world && obj.pos == pos
case _ => false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment