@Override public boolean equals(Object obj) { if (obj == this) return true; if (!(obj instanceof TownBlock)) return false; TownBlock o = (TownBlock) obj; return this.getX() == o.getX() && this.getZ() == o.getZ() && this.getWorld() == o.getWorld(); }
public List<TownBlock> getTownBlocks(Town town) { List<TownBlock> out = new ArrayList<TownBlock>(); for (TownBlock townBlock : town.getTownBlocks()) if (townBlock.getWorld() == this) out.add(townBlock); return out; }